mirror of
https://github.com/fastapi/full-stack-fastapi-template.git
synced 2026-11-03 12:29:42 +00:00
♻️ Simplify local development workflow (#2414)
## AI Disclaimer Using Codex with gpt-5.6-sol. Reviewed manually.
This commit is contained in:
committed by
GitHub
parent
66f444a63a
commit
8a213ddae7
+5
-11
@@ -15,7 +15,9 @@ bun run dev
|
||||
|
||||
* Then open your browser at http://localhost:5173/.
|
||||
|
||||
Notice that this live server is not running inside Docker, it's for local development, and that is the recommended workflow. Once you are happy with your frontend, you can build the backend Docker image and start it, to test the production-like setup where FastAPI serves the built frontend at `http://localhost:8000`.
|
||||
Run the backend locally with `uv run fastapi dev` and PostgreSQL in Docker Compose. See [../development.md](../development.md) for the complete setup.
|
||||
|
||||
To serve the frontend with FastAPI, run `bun run build` from the `frontend` directory and open `http://localhost:8000`. To run the full stack with Docker Compose, use `docker compose watch`.
|
||||
|
||||
Check the file `package.json` to see other available options.
|
||||
|
||||
@@ -33,14 +35,6 @@ If you are developing an API-only app and want to remove the frontend, you can d
|
||||
|
||||
Done, you have a frontend-less (api-only) app. 🤓
|
||||
|
||||
---
|
||||
|
||||
If you want, you can also remove the `FRONTEND_HOST` environment variable from:
|
||||
|
||||
* `.env`
|
||||
|
||||
But it would be only to clean them up, leaving them won't really have any effect either way.
|
||||
|
||||
## Generate Client
|
||||
|
||||
### Automatically
|
||||
@@ -56,9 +50,9 @@ bash ./scripts/generate-client.sh
|
||||
|
||||
### Manually
|
||||
|
||||
* Start the Docker Compose stack.
|
||||
* Make sure the backend is running.
|
||||
|
||||
* Download the OpenAPI JSON file from `http://localhost/api/v1/openapi.json` and copy it to a new file `openapi.json` at the root of the `frontend` directory.
|
||||
* Download the OpenAPI JSON file from `http://localhost:8000/api/v1/openapi.json` and copy it to a new file `openapi.json` at the root of the `frontend` directory.
|
||||
|
||||
* To generate the frontend client, run:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user