A full-stack app is two separate applications that talk to each other: a React frontend (what users see) and a FastAPI backend (your API and database). They run independently, communicate over HTTP, and live in separate folders.
This lesson uses a simplified JS-first structure to teach the pattern clearly. The companion repo uses a more production-style layout: backend/main.py + backend/routers/users.py + backend/models.py + backend/database.py, a TypeScript web frontend (.tsx/.ts), and a mobile/ Expo app that uses the same API.
The frontend and backend run on different ports (5173 and 8000). They’re completely separate applications. The frontend doesn’t know or care that the backend is Python — it just makes HTTP requests and gets JSON back.
The frontend uses fetch() to make HTTP requests (GET, POST, PUT, DELETE). The backend processes the request and returns JSON. The frontend updates its state with the response and re-renders the UI.This is the same architecture used by every major web application — Gmail, Twitter, Spotify. The only difference is scale.
Keep both terminals visible. When you see an error in the browser, check both terminals — the bug could be on either side. FastAPI’s terminal shows Python errors. Vite’s terminal shows JavaScript build errors.
Make sure you don’t commit dependencies or secrets:
Copy
# Pythonbackend/venv/backend/__pycache__/backend/.env# JavaScriptfrontend/node_modules/frontend/dist/# Environment files with secrets.env*.env.local# OS files.DS_Store