Files
rtu_v5/.planning/quick/2-store-this-current-interface-as-v1-and-w/2-PLAN.md
2026-05-29 14:48:36 +08:00

125 lines
4.0 KiB
Markdown

---
phase: quick
plan: 2
type: execute
wave: 1
depends_on: []
files_modified: []
autonomous: true
requirements: []
user_setup: []
must_haves:
truths:
- "Current Flask v1 interface is preserved in a dedicated directory"
- "v2 project structure is initialized with sample_interface as reference"
artifacts:
- path: "src_v1/"
provides: "Archived Flask application (app.py + templates)"
- path: "v2/"
provides: "New v2 project based on sample_interface"
key_links: []
---
<objective>
Store the current Flask v1 interface and initialize v2 project based on sample_interface reference implementation.
Purpose: Preserve working v1 while setting up v2 development environment using the React/Next.js sample as a template.
Output:
- src_v1/ - Archived Flask v1 application
- v2/ - Initial v2 project structure (copied from sample_interface)
</objective>
<context>
@./.planning/STATE.md
# v1 Interface (current - to be archived)
src/app.py - Flask backend
src/templates/dashboard.html - Main rainfall dashboard
src/templates/calibration.html - Sensor calibration page
src/templates/files.html - Flash memory/file manager
src/templates/settings.html - System settings
# v2 Reference (sample_interface)
sample_interface/guidelines/Guidelines.md - Design system specification
sample_interface/src/app/ - Complete React app structure
</context>
<tasks>
<task type="auto">
<name>task 1: Archive current Flask v1 interface</name>
<files>src_v1/app.py, src_v1/templates/*.html</files>
<action>
1. Create src_v1/ directory
2. Copy src/app.py to src_v1/app.py
3. Copy src/templates/*.html to src_v1/templates/ (create directory first)
4. Copy src/static/ to src_v1/static/ (if exists)
5. Copy src/data/ to src_v1/data/ (if exists)
6. Copy src/routes/ to src_v1/routes/ (if exists)
7. Copy src/services/ to src_v1/services/ (if exists)
8. Copy requirements.txt to src_v1/requirements.txt
This preserves the complete working Flask v1 application.
</action>
<verify>
<automated>ls -la src_v1/ && ls src_v1/templates/</automated>
</verify>
<done>src_v1/ directory exists with complete Flask application copied</done>
</task>
<task type="auto">
<name>task 2: Initialize v2 project from sample_interface</name>
<files>v2/</files>
<action>
1. Create v2/ directory
2. Copy entire sample_interface/src/ to v2/src/
3. Copy sample_interface/package.json to v2/ (create if needed)
4. Copy sample_interface/tsconfig.json to v2/ (if exists)
5. Copy sample_interface/vite.config.ts to v2/ (if exists)
6. Copy sample_interface/index.html to v2/ (if exists)
7. Copy sample_interface/guidelines/ to v2/guidelines/
This establishes v2 project with the sample React interface as starting point.
</action>
<verify>
<automated>ls -la v2/ && ls v2/src/app/</automated>
</verify>
<done>v2/ directory exists with React application structure from sample_interface</done>
</task>
<task type="auto">
<name>task 3: Document v1 and v2 structure in README</name>
<files>README.md</files>
<action>
Update project README to document the new v1/v2 structure:
- Explain src_v1 contains the archived Flask v1 application
- Explain v2 contains the new React-based interface
- Reference which interface is currently active/deployed
Add a version history section documenting this transition.
</action>
<verify>
<automated>grep -E "v1|v2|version" README.md</automated>
</verify>
<done>README documents the v1/v2 structure and version history</done>
</task>
</tasks>
<verification>
- [ ] src_v1/ contains complete Flask application
- [ ] v2/ contains React application from sample_interface
- [ ] README documents the new structure
</verification>
<success_criteria>
- Current Flask v1 interface archived in src_v1/
- v2 project initialized with sample_interface React code
- Project documentation updated
</success_criteria>
<output>
After completion, create `.planning/quick/2-store-this-current-interface-as-v1-and-w/2-SUMMARY.md`
</output>