Personal Flisk demo
@yourhandle's Flisk stack
- web
- api
- api-migrator
- jobs
- chain
- indexer
✓
Repo ready
- ✓ flisk resource ×5
- ✓ flisk config verify
Why this stack
- chain · solidity, dapp
- db · postgres
- jobs · email
Run it
npm install -g @flisk-sh/flisk git clone -b demo/yourhandle-dapp-77fd5e https://github.com/flisk-sh/demos.git dapp-demo cd dapp-demo flisk doctor flisk up
Or scaffold it yourself
npm install -g @flisk-sh/flisk flisk doctor flisk project --yes flisk resource web --type frontend --stack dapp --framework react --yes flisk resource api --type backend --stack dapp --feature prisma --yes flisk resource jobs --type worker --stack dapp --feature nats --yes flisk resource chain --type bring-your-own --stack dapp --image ghcr.io/foundry-rs/foundry:stable --yes flisk resource indexer --type worker --stack dapp --feature nats --yes flisk up dapp flisk status
Your service.json files
One service.json each. Postgres comes from "prisma" and Traefik routing is built in, so neither needs its own file.
webfrontendreact app
// services/dapp/web/service.json
{
"$schema": "https://flisk.sh/schema.service.json",
"schemaVersion": 1,
"appName": "web",
"appType": "frontend",
"stack": "dapp",
"port": 3000,
"framework": "react",
"dependsOn": [
"api"
]
}apibackendbun + hono API
// services/dapp/api/service.json
{
"$schema": "https://flisk.sh/schema.service.json",
"schemaVersion": 1,
"appName": "api",
"appType": "backend",
"stack": "dapp",
"port": 4000,
"healthCheckPath": "/health",
"dependsOn": [
"api-migrator"
],
"featuresEnabled": [
"prisma"
]
}api-migratormigratorruns Prisma migrations against the shared Postgres before the api starts
// services/dapp/api-migrator/service.json
{
"$schema": "https://flisk.sh/schema.service.json",
"schemaVersion": 1,
"appName": "api-migrator",
"appType": "migrator",
"stack": "dapp"
}jobsworkerbackground work: email
// services/dapp/jobs/service.json
{
"$schema": "https://flisk.sh/schema.service.json",
"schemaVersion": 1,
"appName": "jobs",
"appType": "worker",
"stack": "dapp",
"port": 4100,
"dependsOn": [
"api-migrator"
],
"featuresEnabled": [
"nats"
]
}chainbring-your-ownexperimentallocal Anvil node for your contracts. Not yet run end to end with flisk up: anvil must listen on the container port Flisk routes to
// services/dapp/chain/service.json
{
"$schema": "https://flisk.sh/schema.service.json",
"schemaVersion": 1,
"appName": "chain",
"appType": "bring-your-own",
"stack": "dapp",
"port": 4200,
"image": "ghcr.io/foundry-rs/foundry:stable"
}indexerworkerreads contract events into Postgres
// services/dapp/indexer/service.json
{
"$schema": "https://flisk.sh/schema.service.json",
"schemaVersion": 1,
"appName": "indexer",
"appType": "worker",
"stack": "dapp",
"port": 4300,
"params": {
"RPC_URL": "http://chain:3000"
},
"dependsOn": [
"chain",
"api-migrator"
],
"featuresEnabled": [
"nats"
]
}Note: No frontend framework named, so this uses React. Say vue, svelte or solid to switch.
Want one for a friend?
Ask @grok on X with their handle and what they build.
Make one for a friend