Week 4/40 — First Full-Stack App (React + TS + FastAPI)
Tech stack (this week)
Frontend: React + TypeScript (Vite)
Backend: Python + FastAPI (Swagger docs)
Dev environment: GitHub Codespaces
Data: in-memory for now (next week adds persistence)
New topic: frontend ↔ backend integration + environment variables + ports.
Why this week?
This was the “real step”: separate frontend + backend, talk over HTTP, and learn how modern dev environments actually run.
What I shipped
A “Learning Log”:
Create entries
List entries
Toggle a favorite flag
Frontend fetches data from the backend API
Swagger (copy/paste):
https://orange-disco-pj4g9w4w46prh96pw-8000.app.github.dev/docs
Frontend (copy/paste):
https://orange-disco-pj4g9w4w46prh96pw-5173.app.github.dev/
The One Feature Rule
One feature: full-stack “create + list + favorite” with a clean API boundary.
Not doing: auth, database, UI polish.
What broke / surprised me
The hardest part wasn’t code — it was mental models (what runs where, what needs a restart, why localhost isn’t what you think in Codespaces).
Follow along (code it yourself): This week’s task
Task: Build a tiny full-stack app with one real API boundary.
Backend: create a FastAPI app with:
GET /entries→ returns a listPOST /entries→ creates a new entry
Frontend: create a React+TS app that:
fetches and displays entries
posts a new entry from a form
Verify everything works by checking:
Swagger docs open
frontend page loads
creating an entry updates the list
Success criteria: You can create an entry in the UI and immediately see it in the list.
Extra help & hints
Biggest mental model: frontend and backend are two separate servers.
If frontend can’t reach backend, your first check is: is
VITE_API_BASEcorrect and did you restart the frontend?Ports reminder (common): backend 8000, frontend 5173.