FastAPI server and React client for session CRUD.
- server/ – FastAPI app (
app/package: main, config, db, models, schemas) - client/ – React + TypeScript app (Vite, MUI, Tailwind, TanStack Query, MobX)
Using Poetry:
poetry installStart MongoDB (required for session CRUD):
docker compose up -d mongodbRun the API from the project root (package app is installed from server/):
poetry run uvicorn app.main:app --reloadOr from server/ so the working directory is correct:
cd server && poetry run uvicorn app.main:app --reload- API: http://127.0.0.1:8000
- Docs: http://127.0.0.1:8000/docs
Default: MONGO_URI=mongodb://localhost:27017. Override if needed (e.g. in Docker: MONGO_URI=mongodb://mongodb:27017).
With MongoDB running (docker compose up -d mongodb):
poetry run pytest server/tests -vTests use the onboarding_test database (set via MONGO_DB_NAME).
cd client && npm installWith the server running on port 8000:
npm run dev- App: http://localhost:5173
- API requests are proxied from
/apitohttp://localhost:8000(seeclient/vite.config.ts). For a different backend, setVITE_API_BASE(e.g.http://localhost:8000).
Unit tests (Vitest + React Testing Library):
cd client && npm run test:runE2E tests (Playwright): Install browsers first (npx playwright install), then start MongoDB and the API. With npm run dev running, use PLAYWRIGHT_BASE_URL=http://localhost:5173 npm run test:e2e:
cd client && npx playwright install
docker compose up -d mongodb
poetry run uvicorn app.main:app --port 8000 # in another terminal
npm run test:e2e| Method | Path | Description |
|---|---|---|
| GET | / |
Welcome message |
| GET | /health |
Health check |
| GET | /sessions |
List sessions (paginated: ?limit=20&offset=0, default limit 20; ?include_deleted=true to include soft-deleted) |
| GET | /sessions/{id} |
Get session by ID |
| POST | /sessions |
Create session |
| PATCH | /sessions/{id} |
Update session (partial) |
| DELETE | /sessions/{id} |
Soft delete (?soft=false for hard delete) |