Replace the stub in database/db.py with a working SQLite implementation.
This step establishes the data layer foundation for the Spendly application.
All future features (authentication, profile, expense tracking) depend on this being correctly implemented.
Nothing — this is the first step.
app.py remain unchanged| Column | Type | Constraints |
|---|---|---|
| id | INTEGER | Primary key, autoincrement |
| name | TEXT | Not null |
| TEXT | Unique, not null | |
| password_hash | TEXT | Not null |
| created_at | TEXT | Default datetime('now') |
| Column | Type | Constraints |
|---|---|---|
| id | INTEGER | Primary key, autoincrement |
| user_id | INTEGER | Foreign key → users.id, not null |
| amount | REAL | Not null |
| category | TEXT | Not null |
| date | TEXT | Not null (YYYY-MM-DD format) |
| description | TEXT | Nullable |
| created_at | TEXT | Default datetime('now') |