https://github.com/chasenio/full-stack-fastapi-nextjs
Full Stack With FastAPI & Next.js
https://github.com/chasenio/full-stack-fastapi-nextjs
fastapi flyio full-stack fullstack indiehacker nextjs wrangler
Last synced: 6 months ago
JSON representation
Full Stack With FastAPI & Next.js
- Host: GitHub
- URL: https://github.com/chasenio/full-stack-fastapi-nextjs
- Owner: chasenio
- License: mit
- Created: 2024-10-17T23:38:59.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-10-19T00:51:36.000Z (12 months ago)
- Last Synced: 2025-02-11T12:45:46.407Z (8 months ago)
- Topics: fastapi, flyio, full-stack, fullstack, indiehacker, nextjs, wrangler
- Language: Python
- Homepage: https://full-stack-fastapi-nextjs.pages.dev
- Size: 65.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
- [Full Stack With FastAPI \& Next.js](#full-stack-with-fastapi--nextjs)
- [Dependencies](#dependencies)
- [Services ops](#services-ops)
- [Deploy](#deploy)
- [Support](#support)## Full Stack With FastAPI & Next.js
This is a full stack template using FastAPI and Next.js.
- deploy api with [fly.io][1]
- app config with consul (via fly.io)
- deploy frontend with [cloudflare pages][2]## Dependencies
Command line tools:
- [flyctl](https://fly.io/docs/flyctl/install/)
- [pnpm](https://pnpm.io/installation)
- [wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/)## Services ops
**api**
create your app with fly.io
```shell
fly apps create --name -o
```attach consul to api
```shell
fly consul attach -a
```set config with consul
1. get consul url, `fly ssh console -a `
2. show consul url, `echo $FLY_CONSUL_URL`example:
`https://:@consul-syd-5.fly-shared.net/-xxxxxxxxxx/`
- `consul-syd-5.fly-shared.net` is consul server, open in browser
- click `Login` and input consul ``
- click `Key/Value` and input `-xxxxxxxxxx/` in `Key or folder` input; example: `appname-xxxxxxxxx/appname`
- copy `config.yml` content to `Value` input, click `Save`
- `main.py` will read consul config; see [config.py][4]**ui**
create project with cloudflare pages
```shell
cd ui && pnpm wrangler pages project create --production-branch master
```deploy project with cloudflare pages , See this file [Makefile][3]
```shell
make ui # deploy ui
```## Deploy
deploy api
```
make api
```deploy frontend
```
make ui
```## Support
If you like this project, please consider supporting me for coffee ☕️
[](https://www.buymeacoffee.com/chasengao) [](https://www.buymeacoffee.com/invite/chasengao)
[1]: https://fly.io
[2]: https://pages.cloudflare.com
[3]: Makefile
[4]: src/config.py