Files
AutoDeploy/docs/superpowers/specs/2026-07-02-deploy-tool-workbench-design.md

42 lines
1.9 KiB
Markdown
Raw Normal View History

2026-07-14 16:30:36 +08:00
# Workbench Deploy Tool Design
## Goal
Build a Python desktop tool that helps deploy separated Spring Boot + Vue projects. The user selects one folder, then the tool detects backend, frontend, SQL files, required local environments, configurable deployment settings, and deployment command steps.
## Interface
Use a workbench layout:
- Left navigation for Project, Environment, Database, Deployment, Logs.
- Top action bar with folder selection, scan, environment check, and deploy actions.
- Main dashboard cards for backend, frontend, SQL, and environment status.
- Configuration fields for backend port, frontend build directory, MySQL connection, and deployment output directory.
- Log panel for command output and status messages.
## Architecture
Use Python standard library only for the first version. Keep business logic outside the GUI:
- `deploy_tool/scanner.py` detects Spring Boot, Vue, and SQL files.
- `deploy_tool/environment.py` checks commands such as Java, Maven, Gradle, Node, npm, Vue CLI, and MySQL.
- `deploy_tool/deployer.py` builds deployment steps and can run shell commands with streamed output.
- `deploy_tool/gui.py` implements the tkinter/ttk workbench.
- `main.py` starts the application.
## Behavior
The scanner walks the selected folder and recognizes:
- Spring Boot backend by `pom.xml`, `build.gradle`, `src/main/java`, and Spring Boot dependency text.
- Vue frontend by `package.json` containing Vue dependencies or scripts plus common Vue config files.
- SQL files by `.sql` extension.
Environment checks run non-destructive version commands and report installed/missing states.
Deployment starts with a dry, visible command plan. The first version focuses on local build/import/start orchestration and clear logs rather than remote server provisioning.
## Testing
Use `unittest` from the standard library. Tests cover scanner detection, environment command handling with injected runners, and deployment plan generation.