The Smart-API Work Order System is a backend management system developed in Go, featuring a front-end and back-end separation. The back-end uses the Gin framework, while the front-end uses Vue.js and Element UI. This system aims to efficiently handle work order management, including task allocation, execution monitoring, and real-time updates.
简体中文 | English
Based on Gin + Vue + Element UI (or Arco Design/Ant Design), the Smart-API system is a front-end and back-end separated work order management system. Initialization is simple, with just minor database connection configuration needed. The system supports multiple command operations, including database migration commands for simplified initialization.
Default login:
admin/123456
You need to have Go, Gin, Node.js, and Git installed locally.
Clone the project:
git clone https://github.com/sunwenbo/smart-api.git
cd smart-api
Install dependencies:
go mod tidy
Configure database connection:
cp config/settings.full.yml config/settings.yml
⚠️ : Modify the database connection information in config/settings.yml to ensure that the database configuration is correct. Create the database manually before you initialize it.
Modify the database information in the configuration file
Note the configuration data in settings.database
Confirm the log path
Compile
go build -o smart-api main.go
Initialize the Database:
# The first configuration requires initializing the database resource information.
# Use on macOS or Linux
$ ./smart-api migrate -c config/settings.yml
# ⚠️ Note: Use on Windows
$ smart-api.exe migrate -c config/settings.yml
# Start the project; you can also debug it using an IDE.
# Use on macOS or Linux
$ ./smart-api server -c config/settings.yml
# ⚠️ Note: Use on Windows
$ smart-api.exe server -c config/settings.yml
How to Add Data to the sys_api Table:
# When the project starts, using `-a true` will automatically add missing interface data.
./smart-api server -c config/settings.yml -a true
Update Swagger Documentation Generation:
go generate
Start Service:
./smart-api server -c config/settings.yml
Local Development Database Migration:
Generate migration files: go run main.go migrate -g true -c config/settings.yml Generate migration files -- system-related: go run main.go migrate -g true -a true -c config/settings.yml After modifying the migration files, execute the command below to start changes: go run main.go migrate -c config/settings.yml Interface management generation: go run main.go server -c config/settings.yml -a false
# windows
env GOOS=windows GOARCH=amd64 go build main.go
# or
# linux
env GOOS=linux GOARCH=amd64 go build main.go
Clone the frontend project:
git clone https://github.com/sunwenbo/smart-ui.git
cd smart-ui
Install dependencies:
npm config set registry https://registry.npmmirror.com/
npm config get registry
npm install --legacy-peer-deps
Start the development server:
npm run dev
Access the address:
Open your browser and visit http://localhost:9527 to view the frontend interface.
If not deploying locally, you need to initialize the database data first. You can use the locally compiled binary file to execute the following command.
⚠️⚠️⚠️ Modify the database information in the settings.yml file.
./smart-api migrate -c config/settings.yml
If you are on an ARM architecture locally but want to build an x86 architecture image:
# Build the image
docker buildx build --platform linux/amd64 -t registry.cn-beijing.aliyuncs.com/sunwenbo/smart-api:latest . --load
# Push to the image repository
docker push registry.cn-beijing.aliyuncs.com/sunwenbo/smart-api:latest
# Start the backend service, mount the settings.yml file
docker run -itd \
-p 8000:8000 \
-v /data/config/:/home/service/config/ \
--name smart-api \
registry.cn-beijing.aliyuncs.com/sunwenbo/smart-api:latest
# Build the image
docker buildx build --platform linux/amd64 -t registry.cn-beijing.aliyuncs.com/sunwenbo/smart-ui:latest . --load
# Push to the image repository
docker push registry.cn-beijing.aliyuncs.com/sunwenbo/smart-ui:latest
# Start the frontend service, mount the Nginx configuration file
docker run -itd \
-p 80:80 \
-v /data/default.conf:/etc/nginx/conf.d/default.conf \
--name smart-ui \
registry.cn-beijing.aliyuncs.com/sunwenbo/smart-ui:latest

The method to initialize data is as mentioned above ☝️
cd smart-api/scripts/
bash install.sh
cd smart-ui/scripts/
# Before executing deployment, modify the configurations in the yaml file, such as ingress
bash install.sh
kubectl get cm -n sre kubectl get pod -n sre kubectl get ingress -n sre
admin to log in.[Data Statistics]
[Work Order Application]
[Custom Process]
[Custom Template]
[Work Order Management]
[Task Type]



We welcome community developers to contribute code or provide feedback. If you would like to participate in this project, please follow these steps:
Fork this repository: Click the Fork button in the upper right corner to copy the project to your GitHub account.
Clone your fork: Run the following command in the terminal to clone the project to your local machine:
git clone https://github.com/your-username/smart-api-backend.git
Create a branch: In the cloned project directory, create a new branch for development:
git checkout -b feature-branch-name
Commit your changes: After development, use git add and git commit to submit your code changes.
git add .
git commit -m "Describe your changes"
Submit a Pull Request: Submit a Pull Request on GitHub, ensuring your code passes all tests and adheres to coding standards.
Database configurations are stored in config/settings.yml. You can modify the database configuration items according to your needs.
Create new handling logic in the api directory and register that route in the router. The service layer logic should be placed in the service directory.
During task execution, the system pushes task status updates to the frontend via WebSocket. The frontend uses the WebSocket interface to receive and dynamically display task execution logs.
The Smart-API work order system is open-sourced under the MIT License. Personal and commercial use and modifications are welcome.
![]() | ![]() |
| Personal WeChat | WeChat Group 🔥🔥🔥 |
Thanks to the following developers for their contributions to this project:
If you have any questions or suggestions, please submit an issue.
The smart-api project has always been developed using JetBrains' GoLand IDE, based on free JetBrains Open Source license(s). Thank you for your support.
If you find this project helpful, you can buy the author a cup of ☕️ as encouragement:
Copyright (c) 2022 sunwenbo