specforge-wasp / README.md
designfailure's picture
Run + deploy instructions
8e6791b verified
|
Raw History Blame Contribute Delete
3.4 kB
# SpecForge — full-stack Wasp app
The tech-spec writing tool from the SpecForge conversation, rebuilt on [Wasp](https://github.com/wasp-lang/wasp) as a real full-stack app: specs persisted in a database, per-section editing with autosave, the 12 harness-ready sections with done-detection, and full Markdown export. Structure follows `wasp-lang/wasp@main` `examples/tutorials/TodoApp` (Wasp TS Spec era, pinned `0.26.0`).
## Stack
- **Wasp 0.26** TS Spec (`main.wasp.ts`) — routes, auth, 6 operations declared
- **Prisma + SQLite** in dev (schema.prisma at root); switch to `postgresql` for production
- **React 19** client; username/password auth via `wasp/client/auth`
- Server operations: `getSpecs`, `getSpec` (queries) · `createSpec`, `updateSection`, `resetSection`, `deleteSpec` (actions) — all ownership-checked against `context.user`
## Run locally
Prereqs: **Node.js ≥ 24.14.1**, npm.
```shell
npm install -g @wasp.sh/wasp-cli@latest
git clone <this repo> specforge-wasp && cd specforge-wasp
wasp install # generates .wasp/ + the @wasp.sh/spec package (first run only)
wasp db migrate-dev # creates migrations/ + dev SQLite db
wasp start # → http://localhost:3000
```
Sign up, create a spec — it seeds all 12 sections server-side; edits autosave to the DB; the chip turns `READY FOR HARNESS` when all sections pass the done-check. `wasp compile` typechecks fast.
## Deploy (Fly.io)
Prereqs: [flyctl](https://fly.io/docs/flyctl/) installed, `fly auth signup`/`login`, and a Postgres-capable app (SQLite is dev-only).
1. In `schema.prisma`, change `provider = "sqlite"` → `provider = "postgresql"`.
2. Then, from the app root:
```shell
wasp deploy fly launch specforge-app dfw # region example: dfw / iad / lhr
```
This creates `specforge-app-{client,server,db}`, sets `DATABASE_URL`, `JWT_SECRET`, `WASP_WEB_CLIENT_URL`, `WASP_SERVER_URL`, and runs migrations. Commit the generated `fly-server.toml` / `fly-client.toml`. To redeploy after changes: `wasp deploy fly deploy`. Client env vars must be passed as shell env on every deploy. Health check endpoint is `GET /up` (Wasp ≥ 0.26).
Railway works too: `wasp deploy railway launch`.
## Repo layout
```
main.wasp.ts # Wasp TS Spec: routes, auth, operations
schema.prisma # User, Spec, Section (cascade delete)
src/
sections.js # the 12 sections: hints, starters, shared done-check
queries.js # getSpecs / getSpec (ownership-scoped)
actions.js # createSpec (seeds 12 sections) / updateSection / resetSection / deleteSpec
SpecsPage.jsx # list + create + progress chips + delete
SpecPage.jsx # editor: 12-section sidenav, autosave, preview, Copy Markdown
LoginPage.jsx / SignupPage.jsx
styles.css
```
## Notes & caveats
- `migrations/` are generated by `wasp db migrate-dev` locally; they are not committed here yet (fresh clone generates its own).
- Verified statically against the upstream TodoApp example (spec syntax, imports, config files) as of Wasp `0.26.0`; no compile run was executed for this scaffold — run `wasp install && wasp compile` first after cloning and fix any drift if the CLI reports version drift.
- The 12 sections, hints, starters and done-check are the same harness-ready scaffold from the SPECWORKS methodology — a spec completed here exports as the input table for an agent build harness.