-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathdesign.prompt.txt
More file actions
107 lines (84 loc) · 3.83 KB
/
design.prompt.txt
File metadata and controls
107 lines (84 loc) · 3.83 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
claude-3-5-sonnet-20240620
You are Claude, an AI assistant powered by Anthropic's Claude-3.5-Sonnet model, specialized in software development.
You are a software designer.
Your job to design an app. The app is usually very simple and can be always expressed in a python web server backend plus a single html page frontend.
The given input is the app description.
Use your imagination to design a fancy app with only one python server (backend) with only one html page (frontend).
The output backend design should be in <BACKEND_DESIGN></BACKEND_DESIGN> block.
The output frontend design should be in <FRONTEND_DESIGN></FRONTEND_DESIGN> block.
There should be exactly one <BACKEND_DESIGN> and one <FRONTEND_DESIGN>.
=== 0: user ===
The app description:
```
I have one-time and recursive expenses all the time. I want to create a tracker. Maybe it's a table with some diagram show how I spend money.
```
Based on given app description, generate <BACKEND_DESIGN> and <FRONTEND_DESIGN>.
<BACKEND_DESIGN> will be written in "backend_design.txt".
<FRONTEND_DESIGN> will be written in "frontend_design.txt".
=== Reply 0 ===
Here's a design for an expense tracker app based on your description:
<BACKEND_DESIGN>
The backend will be a Python Flask server with the following components:
1. Database:
- Use SQLite for simplicity
- Two tables:
a. Expenses: id, date, amount, description, category, is_recurring
b. Categories: id, name
2. API Endpoints:
- GET /expenses: Retrieve all expenses
- POST /expenses: Add a new expense
- PUT /expenses/<id>: Update an existing expense
- DELETE /expenses/<id>: Delete an expense
- GET /categories: Retrieve all categories
- POST /categories: Add a new category
3. Data Processing:
- Calculate total expenses by category
- Calculate monthly recurring expenses
- Calculate one-time expenses
4. Dependencies:
- Flask
- SQLAlchemy (for database ORM)
- Flask-RESTful (for API endpoints)
5. Main app structure:
- app.py: Main Flask application
- models.py: Database models
- routes.py: API route definitions
- utils.py: Helper functions for data processing
The server will handle all CRUD operations for expenses and categories, as well as provide processed data for the frontend to display in charts and tables.
</BACKEND_DESIGN>
<FRONTEND_DESIGN>
The frontend will be a single HTML page with embedded JavaScript and CSS. It will have the following components:
1. HTML Structure:
- Header with app title
- Form for adding/editing expenses
- Table to display expenses
- Charts section for visualizing spending
- Categories management section
2. CSS Styling:
- Use a modern, responsive design
- Implement a clean, minimalist color scheme
- Use Flexbox or Grid for layout
3. JavaScript Functionality:
- Fetch and display expenses from the backend
- Handle form submission for adding/editing expenses
- Implement client-side form validation
- Create interactive charts using Chart.js library
- Enable sorting and filtering of the expense table
- Implement category management (add, edit, delete)
4. Charts and Visualizations:
- Pie chart for expenses by category
- Bar chart for monthly spending
- Line chart for spending trends over time
5. Interactive Elements:
- Clickable table rows to edit expenses
- Toggle between one-time and recurring expenses view
- Date range picker for filtering expenses
6. Responsive Design:
- Ensure the layout adapts to different screen sizes
- Use media queries to adjust the layout for mobile devices
7. Dependencies:
- Chart.js for creating interactive charts
- Axios for making API requests
- Date-fns for date manipulation
The frontend will provide an intuitive interface for users to manage their expenses, visualize spending patterns, and gain insights into their financial habits.
</FRONTEND_DESIGN>