this repo has no description
1# Development
2
3This document covers day-to-day local development for Lively Forms.
4
5## Prerequisites
6
7- Bun
8- Podman + Podman Compose
9- PostgreSQL container support via `compose.yaml`
10- A Google OAuth client for creator sign-in during local development
11
12## Local setup
13
14```bash
15bun install
16bun run hooks:install
17cp .env.example .env
18bun run db:up
19bun run prisma:migrate
20bun run dev
21```
22
23Open `http://localhost:3000`.
24
25For environment variables and OAuth setup details, see [deployment.md](./deployment.md).
26
27## Daily workflow
28
29### Start the database
30
31```bash
32bun run db:up
33```
34
35### Start the app
36
37```bash
38bun run dev
39```
40
41### Stop the database
42
43```bash
44bun run db:down
45```
46
47### View database logs
48
49```bash
50bun run db:logs
51```
52
53### Reset the local database volume
54
55```bash
56bun run db:reset
57```
58
59## Database workflow
60
61Generate Prisma client after schema changes:
62
63```bash
64bun run prisma:generate
65```
66
67Create and apply a local migration during development:
68
69```bash
70bun run prisma:migrate
71```
72
73Open Prisma Studio:
74
75```bash
76bun run prisma:studio
77```
78
79## Quality checks
80
81Run the full local verification suite used by CI:
82
83```bash
84bun run check
85```
86
87Run lint only:
88
89```bash
90bun run lint
91```
92
93Run a production build only:
94
95```bash
96bun run build
97```
98
99Install git hooks for this repo:
100
101```bash
102bun run hooks:install
103```
104
105Notes:
106
107- The pre-commit hook runs `bun run check`, which includes formatting, linting, type-checking, and a production build.
108- `bun run build` also validates translation resources before the Next.js build.
109- There is currently no separate test suite command in `package.json`.
110
111## Important directories
112
113- `app/` — App Router pages, layouts, and API routes
114- `components/` — UI and feature components
115- `lib/` — business logic, auth, forms, branching, i18n, exports
116- `locales/` — translation YAML files
117- `prisma/` — schema and migrations
118- `docs/` — project documentation
119- `openspec/` — product/spec workflow artifacts
120
121## Important files
122
123- `lib/blocks.ts` — block types, config parsing, branch operator support
124- `lib/branching.ts` — branching resolution and validation helpers
125- `lib/forms.ts` — form loading, publish flow, submission shaping, response access
126- `components/form-builder.tsx` — creator builder shell
127- `components/form-builder-panels.tsx` — block settings and branching controls
128- `components/public-form-runner.tsx` — public respondent flow
129
130## Notes for contributors
131
132- Use `bun` commands for project workflows.
133- Creator routes require authentication; public form routes do not.
134- Responses are stored anonymously.
135- Editing a published form updates the live public form immediately.
136- When changing UI copy, update both `locales/en.yml` and `locales/ru.yml`.