# Sonora deliverable

Built a runnable Typeform competitor prototype with a voice-first respondent experience.

## Start here

```bash
npm install
npm run dev
```

Then open `http://localhost:5173` and click “Continue with demo workspace”. The demo credentials are `maya@northstar.design` / `demo1234`.

## Service keys

No paid key is required for the included browser voice demo. To enable server-side natural-language extraction and more natural replies, provide:

```env
OPENAI_API_KEY=...
OPENAI_MODEL=gpt-4o-mini
SONORA_AUTH_SECRET=...
```

These are documented in `.env.example`. I assumed OpenAI for the optional AI layer because the brief did not specify a provider; the browser Web Speech fallback keeps the app usable while keys are pending.

## What is included

- Auth: register, login, logout, signed httpOnly cookie session, bcrypt password hashing.
- Backend: structured forms, ordered questions, required/type metadata, responses, and answer maps keyed by question ID.
- Frontend: overview dashboard, forms list, form builder, responses, response detail drawer, settings, auth, and a public-style voice interview.
- Seeded data: one live “Customer discovery call” form and three example responses.
- Verification: `npm run build` passes; auth → current user → forms API smoke test returns 200.

Local persistence uses `data.json`, created automatically by the server. For production, replace that adapter with a durable database and rotate `SONORA_AUTH_SECRET`.
