Tutorials
Frontend Quick Start
Run the frontend locally: install, set two env vars, and start the dev server.
In about two minutes you will have the frontend running on http://localhost:5173 against a local
backend. To deploy to a server, see docs/how-to/deploy.md.
Prerequisites
- Node.js 22+. The full
npm run buildalso builds the docs site, which needs 22. - A running DARE backend on
http://localhost:8000(seedare-backend). To run the whole platform at once, follow the backend's getting started tutorial.
1. Clone the repo
git clone https://github.com/cmudco/dare-frontend.git
cd dare-frontend2. Install dependencies
npm installnpm ci also works and installs exactly what package-lock.json pins.
3. Configure the environment
The defaults point at a backend on http://localhost:8000.
cp .env.example .envIf your backend runs elsewhere, set VITE_DJANGO_BACKEND_URL in .env; REST and Socket.IO both
use it.
docs/reference/configuration.md lists every variable.
4. Start the dev server
npm run devVerify
Open http://localhost:5173 and sign in. The page hot-reloads when you save a file.
Scripts
| Command | What it does |
|---|---|
npm run dev | Vite dev server on port 5173 |
npm run app:build | tsc -b and vite build into dist/; the real type check |
npm run build | app:build, then builds docs-site/ and copies it into dist/docs and dist/_next |
npm run preview | Serve the built dist/ locally |
npm run lint | ESLint over the repo, failing on any warning |
npm run docs:sync | Copy these docs and ../dare-backend/docs into docs-site/content/docs |
node scripts/test-ensemble-state.mjs | The ensemble reducer test (node:test) |
Do not run npm run format: it rewrites every file in the repo. Format the files you changed with
npx prettier --write <files>.
Troubleshooting
- The UI loads but shows empty state or auth errors. The backend is not reachable. Check it
answers on
http://localhost:8000and thatVITE_DJANGO_BACKEND_URLpoints at it. - Chat never streams. Check the
/socket.io/request to the backend in the browser's network panel. A failed handshake or a CORS rejection leaves the Vite log looking clean. /docsreturns the app instead of the docs. The dev server serves the docs fromdocs-site/out, which exists only afternpm run build(ornpm run docs:build).