A live survey room built with SvelteKit and Firestore. One side creates and controls the session, the other joins with a room code and answers the current question in real time.
- Fast landing page with clear paths for participants and admins.
- Real-time question delivery through Firestore snapshots.
- Multiple question types: labeled choices, yes/no, and 1-10 ratings.
- Admin session controls for creating questions, rotating the active prompt, and reading response stats.
- Lightweight browser state with
sessionStorageso participants can pick up where they left off in the same session.
flowchart LR
Landing[/Landing page/] --> Survey[/Survey entry/]
Landing --> Admin
Survey --> Room[Room code + name]
Room --> Live[/Live session/]
Admin[/Admin login/] --> Manage[Create session and questions]
Manage[Create session and questions] --> Stats[View live data stats]
Stats --> Live
Live --> Stats
Live --> Firestore[(Firestore)]
Firestore[(Firestore)] --> Live
- SvelteKit 2 with Svelte 5 runes mode enabled.
- Vite plus Tailwind CSS 4 for the UI.
- Firebase client SDK for auth and Firestore.
firebase-adminis present in the project, but the current app behavior is driven by the client SDK.
/— the main landing page./survey— participant sign-in screen for name and room code./survey/[session]— live response experience tied to a specific session./admin— password-protected admin workspace.
Firestore data is organized like this:
sessions— the session records themselves.sessions/{sessionId}/questions— questions for a session.sessions/{sessionId}/responses— submitted answers from participants.
Each session keeps the active question ID, a generated session name, and timestamps. Questions can be labeled choice lists, yes/no prompts, or rating sliders from 1 to 10.
- Copy
.env.exampleto.env. - Fill in the Firebase values from your project.
- Set a strong
PUBLIC_ADMIN_PASSWORDfor the admin gate. - Install dependencies with
bun install.
Required environment variables:
PUBLIC_FIREBASE_API_KEYPUBLIC_FIREBASE_AUTH_DOMAINPUBLIC_FIREBASE_PROJECT_IDPUBLIC_FIREBASE_STORAGE_BUCKETPUBLIC_FIREBASE_SENDER_IDPUBLIC_FIREBASE_APP_IDPUBLIC_FIREBASE_MEASUREMENT_IDPUBLIC_ADMIN_PASSWORD
The Firebase settings must stay prefixed with PUBLIC_ so SvelteKit can expose them to the client.
bun run devOpen the app in a browser automatically:
bun run dev -- --openBuild for production:
bun run buildPreview the production build:
bun run previewbun run dev— start the local Vite development server.bun run build— create a production build.bun run preview— preview the production bundle locally.bun run lint— check formatting with Prettier.bun run format— format the project with Prettier.
- The app stores the current participant name, room code, and admin login state in
sessionStorage. - Answers are written to Firestore as the session runs, so the admin and participant views stay synchronized without page refreshes.
- Currently not working, due to firebase permissions