Monorepo with a FastAPI backend, a Next.js frontend, and a TypeScript scraper for Great British Bake Off recipes.
- Node.js and npm (repo uses
npm@11) - Python 3.9
- Poetry (for Python deps)
- Optional: Docker and Docker Compose
- Install dependencies at the root (also installs Python deps via postinstall):
npm installcd packages/api && poetry install
- Initialize the SQLite database (runs scraper setup):
npm run setup
- Start dev servers (API on 8000, frontend on 3000):
npm run dev
Root scripts (powered by Turborepo):
npm run dev— runsdevin all packagesnpm run build— builds all packagesnpm run start— starts all packagesnpm run lint— lints all packagesnpm run setup— runs setup tasks (e.g., DB init via scraper)
You can run both services with Docker:
docker compose up --build
Services/ports (see docker-compose.yml):
- API: http://localhost:8000
- Frontend: http://localhost:3000 (expects
NEXT_PUBLIC_API_URL=http://localhost:8000)
packages/api— FastAPI app with SQLModel/SQLitepackages/frontend— Next.js app (Mantine UI)packages/scraper— Python scraper and DB setup utilities
Base URL (local): http://localhost:8000
Routers and key routes:
/recipeGET /recipe— list recipes with filters:q,difficulty(1-3),time(minutes),baker_ids,diet_ids,category_ids,bake_type_idsGET /recipe/count— total recipe count with same filtersGET /recipe/{id}— recipe by id
/bakerGET /baker— list bakers (filterq)GET /baker/count— baker countGET /baker/{id}— baker by id
/diet,/category,/bake_type- Each supports:
GET /(list withq),GET /count,GET /{id}
- Each supports:
CORS: frontend origin http://localhost:3000 is allowed in dev.
From the root you can run via Turbo:
- Setup/DB init:
npm run setup
Or directly in the scraper package:
cd packages/scraper- Initialize DB:
npm run setup - Scrape data:
npm run scrape
- Database: SQLite (see API
db.py). Docker compose setsDATABASE_URL=sqlite:///./sql_app.dbfor container runs. - Frontend -> API URL:
NEXT_PUBLIC_API_URL(defaults tohttp://localhost:8000in Docker compose).
packages/
api/ # FastAPI app
frontend/ # Next.js app
scraper/ # Python scraper & DB setup
- Python version is pinned to 3.9 in Poetry configs.
- If ports are busy, adjust
docker-compose.ymlor package scripts.