GOV.UK‑styled Next.js app that renders Firmstep form definitions and pairs them with an AI assistant. The assistant can explain the form, ask questions conversationally, and update the form on the user's behalf.
Live demo: forms-ai.lang.scot
- Clone the repo
git clone https://github.com/langscot/forms-ai && cd forms-ai
- Install dependencies
pnpm install
- Create environment file
- Copy
.env.exampleto.env.local
- Copy
- (Optional) Disable Cloudflare Turnstile
- Set
CLOUDFLARE_TURNSTILE_ENABLED=falsein.env.local
- Set
- Set your OpenAI API key
OPENAI_API_KEY=...- If you want Turnstile enabled, also set
NEXT_PUBLIC_CF_SITE_KEYandCF_SECRET_KEY
- Add a Firmstep JSON form definition
- Place your
.jsoninexample_forms/ - Ensure the form's
formNameis unique among files in that directory
- Place your
- Run the dev server
pnpm devthen openhttp://localhost:3000
- Example forms live in
example_forms/and are auto‑loaded at startup. - The assistant uses the current section's fields and can call a tool to update form state when you answer.