Get Started
This guide assumes you are a developer using an AI agent or working directly in a repo and want to get a W7S app deployed quickly with a clean shape from day one.
What W7S expects
At a high level, W7S deploys a repository archive and exposes:
- backend/webhook routes through
https://<org>.w7s.cloud/<repo>/... - static frontend assets for the same repo
- repo-scoped SQLite databases
- account/session routes under
/_account - plugin runtime access from your handlers
The opinionated repo layout is:
my-app/
backend/
src/
health.ts
notes.ts
db/
schema.ts
db-helpers.ts
db/
app/
migrations/
0001_init.sql
frontend/
dist/
index.html
app.js
w7s.site.json
w7s.json
.github/workflows/
The fastest way to start
Use this order:
- Create a minimal backend route.
- Add database migrations under
db/<database>/migrations. - Add a Drizzle schema and use
createW7SDbClient. - Add a static frontend under
frontend/dist. - Add a deploy workflow that zips the repo and posts it to
/_deploy.
Minimal backend
Create w7s.json at repo root:
[
{
"type": "webhook",
"path": "/health",
"method": "GET",
"handler": "./backend/src/health.ts",
"auth": "none"
}
]
Create backend/src/health.ts:
export default async function handle() {
return {
status: 200,
body: {
ok: true,
service: "my-app",
},
};
}
After deploy, the route is available at:
https://<org>.w7s.cloud/<repo>/health
Database shape
W7S discovers migrations from:
db/<databaseName>/migrations/*.sql
For the default app database:
db/app/migrations/0001_init.sql
Deploy runs those migrations before finalizing the backend snapshot.
Frontend shape
Static site files live under:
frontend/dist/*
The most common setup is a SPA, configured with w7s.site.json:
{
"version": 1,
"root": "frontend/dist",
"mode": "spa",
"fallback": "/index.html",
"cleanUrls": false
}
Deploy workflow
Your GitHub Action typically:
- checks out the repo
- builds backend and/or frontend
- zips the repo
- posts the archive to:
https://<org>.w7s.cloud/<repo>/_deploy?artifact=source
W7S also supports scope=backend and scope=frontend if you want separate workflows for faster deploys.