Start clean:
git status # must be clean
The request
Add card storage to this project.
Goal:
Store study cards in a SQLite database file, and show them on a page at /cards.
Limits:
- TypeScript.
- SQLite, using Node's built-in node:sqlite module. No other libraries.
- The database file is recall.db in the project root.
- Add recall.db to .gitignore.
- Do not change the server setup from step 1 more than you must.
The cards table needs:
- id
- question (text)
- answer (text)
- gap_days (number, how many days until the next review)
- next_review (a date, stored as YYYY-MM-DD text)
- created_at
Also add a small script I can run to insert one card by hand, so I can test
without a form.
Done when:
- Running the insert script puts a card in recall.db.
- Opening /cards shows that card's question and answer.
- recall.db is not tracked by git.
Notice what that request does
It names the exact columns. This is not because the agent could not design a table — it
could, easily. It is because you need to know what the columns are, since your
scheduling rules depend on gap_days and next_review being exactly those things.
Handing over a decision you have already made is how projects drift away from you.
Watch for these
- Does it read your existing files before changing them? (Lesson 3.2, warning sign 1)
- Does it add a library you said not to add?
- Does it actually run the insert script and load the page, or just say it works?
Check it yourself
npm start
# open /cards in the browser
git status # recall.db must NOT be listed
git diff
Read the whole change. It is still small. Build the habit while it is easy.
Commit
git add -A
git commit -m "Step 2-3: cards table, insert script, /cards page"
Try this before the next lesson
- Add two more cards with the script. Does /cards show all three?
- Open
recall.db. Are the columns what you asked for? - Delete
recall.dband run the script again. Does the app recreate it, or break? Which
would you prefer, and did you ever say?