This project is a web-based agent application bundled with Webpack.
Before you begin, ensure you have the following tools installed on your system:
- Node.js (v18 or higher is recommended)
- pnpm: A fast and efficient package manager. See the pnpm installation guide.
- protoc: The Protobuf compiler. This is only required if you need to modify and re-compile the
smmp.protofile.
-
Clone the repository:
git clone [repository_url] cd [project_folder_name] -
Install dependencies: Use
pnpmto install all the required packages.pnpm install
This project uses webpack-dev-server for the development environment, which supports Hot Reloading for an improved workflow. Use the appropriate command for your target environment.
-
Run the dev server for the MCC environment:
pnpm run serve_mcc
-
Run the dev server for the AIVN environment:
pnpm run serve_aivn
Once the server is running, you can access the application at the address shown in your terminal (usually http://localhost:8080).
To bundle and optimize the project for deployment, use the following build commands.
-
Production Build (Recommended): This command minifies and optimizes the code for the final deployment.
pnpm run build:prod
-
Development Build: This command builds the project with source maps for easier debugging.
pnpm run build:dev
After the build is complete, the output files will be generated in the dist folder (this may vary depending on your Webpack configuration).
Deployment involves uploading the static files generated by the production build to a web server or hosting service.
- Run the production build:
pnpm run build:prod
- Upload the build artifacts:
Upload all files from the generated
distfolder (index.html,main.js, etc.) to a static hosting service like Netlify, Vercel, AWS S3, or your own server.
If you modify the smmp.proto file in the project's root directory, you must re-generate the smmp.d.ts and smmp.js files by running the following command. This makes the changes available in TypeScript.
protoc -I=. --ts_out=. smmp.proto