A comprehensive survey application for collecting housing market data in Tanzania, with secure Firebase backend and admin dashboard., this will help to come up with new features and modification on the main app (roomlink.co.tz)
# π Utafiti Survey - Housing Survey Application
A comprehensive Kiswahili survey application for collecting housing market data in Tanzania, with secure Firebase backend and admin dashboard.
## π Quick Start
### Deployed App
- **Survey Form:**
utafiti-tz.web.app
- **Admin Dashboard:**
utafiti-tz.web.app
### Local Development
```bash
# Build and deploy
npm run deploy
# Backup database
npm run backup
# Local testing
npm run serve
```
## π Features
### Survey Form (index.html)
- β
20-question survey in Kiswahili
- β
Conditional logic (questions shown based on previous answers)
- β
Real-time validation
- β
Firestore database integration
- β
Prevents duplicate submissions (localStorage)
- β
Share functionality (WhatsApp, Facebook)
- β
Mobile-optimized design
### Admin Dashboard (admin.html)
- β
Real-time response viewer
- β
Simple view (user-friendly cards) & Raw view (JSON)
- β
CSV export for all responses
- β
Response statistics
- β
Copy response IDs to clipboard
- β
Secure configuration (API keys hidden)
## π Security
### API Keys Protection
- β
All credentials stored in `.env.local`
- β
`config.js` auto-generated from environment variables
- β
Both files in `.gitignore` (never committed)
- β
No exposed keys in source code
### Database Backups
- β
Automated Firestore backup script
- β
Daily backups with timestamps
- β
Complete data preservation
- β
Restore-ready JSON format
## π¦ Setup & Deployment
### 1. Firebase Authentication
```bash
export PATH="$HOME/.npm-global/bin:$PATH"
firebase login:ci --no-localhost
```
### 2. Build & Deploy
```bash
npm run deploy
```
This automatically:
- Generates `config.js` from `.env.local`
- Deploys to Firebase Hosting
- Updates live app at
utafiti-tz.web.app
### 3. Setup Database Backups
See BACKUP_SETUP.md for detailed instructions.
## π Project Structure
```
utafiti/
βββ index.html # Survey form
βββ admin.html # Admin dashboard
βββ config.js β¦