Is it any good? yes
- For simple use cases we could just serve html from fastAPI
- For more complex use cases we would use all components
sequenceDiagram
participant Browser
participant NextJS as NextJS Middleware
participant FastAPI as FastAPI Backend
Browser->>NextJS: Request
NextJS->>FastAPI: Proxy API Request (/api/*)
FastAPI-->>NextJS: Response
NextJS-->>Browser: API Response
NextJS-->>Browser: Rendered Page (for non-API requests)
- Install uv
- Install docker
- Run local mongo instance
docker run -p 27017:27017 -d mongo
- Go to backend folder
- Copy create
.env
based on.env.example
in backend folder and set correct configuration properties - Run local server (environment should be automaticly created by uv with correct python and correct dependencies)
uv run fastapi dev
*This modular package structure is inspired by https://github.com/zhanymkanov/fastapi-best-practices
- Go to frontend folder
- Install packages
bun i
- Run application
bun run dev
For the ui use https://ui.shadcn.com/ which speeds up the development a lot!
FastApi by default uses OpenAPI specification. After any changes to the api you can use frontend script that will create typescript types based on that by running
bun run generate:types