-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathbackend_design.txt
44 lines (34 loc) · 1.68 KB
/
backend_design.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
The backend will be a Python Flask server with the following components:
1. Database:
- Use SQLite for simplicity
- Tables:
- Projects (id, name, description, start_date, end_date)
- Stages (id, project_id, name, description, start_date, end_date, status)
- Tasks (id, stage_id, name, description, deadline, status)
2. API Endpoints:
- GET /projects: Retrieve all projects
- POST /projects: Create a new project
- GET /projects/<project_id>: Retrieve a specific project
- PUT /projects/<project_id>: Update a project
- DELETE /projects/<project_id>: Delete a project
- GET /projects/<project_id>/stages: Retrieve all stages for a project
- POST /projects/<project_id>/stages: Create a new stage for a project
- PUT /stages/<stage_id>: Update a stage
- DELETE /stages/<stage_id>: Delete a stage
- GET /stages/<stage_id>/tasks: Retrieve all tasks for a stage
- POST /stages/<stage_id>/tasks: Create a new task for a stage
- PUT /tasks/<task_id>: Update a task
- DELETE /tasks/<task_id>: Delete a task
3. Business Logic:
- Calculate progress percentages for projects and stages
- Identify upcoming deadlines (within the next 7 days)
- Sort and filter projects, stages, and tasks by various criteria
4. Data Validation:
- Ensure date consistency (e.g., end dates after start dates)
- Validate required fields and data types
5. Error Handling:
- Proper HTTP status codes and error messages for various scenarios
6. Security:
- Basic authentication for API access
- Input sanitization to prevent SQL injection
The backend will serve the static HTML file for the frontend and handle all data operations through the API endpoints.