This is a full stack template using FastAPI and Next.js.
- deploy api with fly.io
- app config with consul (via fly.io)
- deploy frontend with cloudflare pages
Command line tools:
api
create your app with fly.io
fly apps create --name <your app name> -o <org name>
attach consul to api
fly consul attach -a <your app name>
set config with consul
- get consul url,
fly ssh console -a <your app name>
- show consul url,
echo $FLY_CONSUL_URL
example:
https://:<token>@consul-syd-5.fly-shared.net/<app name>-xxxxxxxxxx/
consul-syd-5.fly-shared.net
is consul server, open in browser- click
Login
and input consul<token>
- click
Key/Value
and input<app name>-xxxxxxxxxx/<app-name>
inKey or folder
input; example:appname-xxxxxxxxx/appname
- copy
config.yml
content toValue
input, clickSave
main.py
will read consul config; see config.py
ui
create project with cloudflare pages
cd ui && pnpm wrangler pages project create <app name> --production-branch master
deploy project with cloudflare pages , See this file Makefile
make ui # deploy ui
deploy api
make api
deploy frontend
make ui
If you like this project, please consider supporting me for coffee ☕️