This is a starter template for a NextJs frontend with a FastAPI backend.
You can develop the frontend and backend separately.
To call the backend from the frontend, just prefix the endpoint with /api.
const res = await fetch('/api/hello')-
NodeJS
-
Python
- Frontend
On the root folder:
First Time
npm installRun
npm run dev- Backend
In the backend folder:
First Time
pip install -r requirements.txtRun
uvicorn main:app --reloadOn development, because of the CORS, you need to run browser with security disabled.
(VSCode configuration is already set to run Chrome with security disabled)
- Docker
docker-compose upIt will run on port 8080.