A community platform for disaster preparedness, mutual aid, and neighbourhood resilience. Users can register as Standard members or Experts, connect with neighbours, and access critical information — even offline.
├── backend/ Django REST API
├── frontend/ React (Vite) web client
├── mobile/ Android (Kotlin) app
├── nginx/ Nginx config for production
└── docker-compose.yml
Two options: Docker Compose (easiest, no local installs needed) or native setup.
| Tool | Version |
|---|---|
| Docker | Latest |
| Android Studio | Latest (for mobile only) |
docker-compose -f docker-compose.yml -f docker-compose.local.yml up --build- Frontend: http://localhost
- API: http://localhost/api/
Subsequent runs (no code changes):
docker-compose -f docker-compose.yml -f docker-compose.local.yml upTo stop:
docker-compose -f docker-compose.yml -f docker-compose.local.yml downOn first run, sample users, posts, help requests, and offers are automatically populated. Login with
[email protected]/[email protected]and passwordpassword123.
If you have a
backend/firebase-credentials.jsonfile it will be used for push notifications. Without it the app runs normally — only push notifications to mobile are disabled.
Mobile: Android emulator debug builds automatically connect to
http://10.0.2.2:8000— this works out of the box since the local Docker Compose exposes port 8000 directly. Run the emulator from Android Studio while Docker Compose is up.
| Tool | Version |
|---|---|
| Python | 3.10+ |
| Node.js | 18+ |
| npm | 9+ |
| Docker | Latest (for local Postgres) |
| Android Studio | Latest (for mobile) |
The backend requires PostgreSQL. Choose one of the options below.
docker run -d \
--name emergencyhub-db \
-e POSTGRES_DB=emergencyhub \
-e POSTGRES_USER=emergencyhub \
-e POSTGRES_PASSWORD=emergencyhub \
-p 5432:5432 \
postgres:16-alpineTo stop/start it later:
docker stop emergencyhub-db
docker start emergencyhub-dbmacOS (Homebrew):
brew install postgresql@16
brew services start postgresql@16
psql postgres -c "CREATE USER emergencyhub WITH PASSWORD 'emergencyhub';"
psql postgres -c "CREATE DATABASE emergencyhub OWNER emergencyhub;"Ubuntu/Debian:
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql
sudo -u postgres psql -c "CREATE USER emergencyhub WITH PASSWORD 'emergencyhub';"
sudo -u postgres psql -c "CREATE DATABASE emergencyhub OWNER emergencyhub;"Windows:
Download and install from https://www.postgresql.org/download/windows/, then open pgAdmin or psql and run:
CREATE USER emergencyhub WITH PASSWORD 'emergencyhub';
CREATE DATABASE emergencyhub OWNER emergencyhub;Either option works — the Django settings default to
DB_NAME=emergencyhub,DB_USER=emergencyhub,DB_PASSWORD=emergencyhub,DB_HOST=localhost. No.envfile needed if you use these exact credentials.
python -m venv .venv
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windows
cd backend
pip install -r requirements.txt
python manage.py migrate
python manage.py runserverAPI is now live at http://localhost:8000.
cd frontend
npm install
npm run devOpen http://localhost:5173 in your browser.
No .env file needed — the frontend automatically falls back to http://localhost:8000 when VITE_API_BASE is not set.
Both servers must run simultaneously.
Open the mobile/ folder in Android Studio and run on an emulator.
No configuration needed — debug builds automatically point to http://10.0.2.2:8000 (the emulator's address for localhost:8000 on your machine).
The backend must be running locally for the mobile app to work.
Production is deployed on EC2 via Docker Compose and served through Nginx with HTTPS.
| Layer | Role |
|---|---|
| Nginx | Terminates SSL, routes /api/ → Django, /media/ → files, / → React |
| Django | Runs via Gunicorn on port 8000 (internal) |
| React | Built with VITE_API_BASE=/api, served as static files by Nginx |
| Mobile (release) | Points to https://emergencyhub.duckdns.org/api/ |
Deployment is automatic — push to main triggers the CI/CD pipeline:
- Runs backend, frontend, and Android unit tests in parallel
- SSHes into EC2 and runs
docker-compose up --build -d(only if all tests pass)
To deploy manually:
ssh -i <your-key.pem> ubuntu@<EC2_HOST>
cd bounswe2026group8
git pull origin main
docker-compose up --build -dCreate a .env file on the EC2 server next to docker-compose.yml:
DJANGO_SECRET_KEY=your-secret-key
DB_NAME=emergencyhub
DB_USER=emergencyhub
DB_PASSWORD=your-db-password
DJANGO_DEBUG=False
docker-compose run --rm backend python manage.py test accounts forum help_requestscd frontend
npm testRequires Android Studio installed (sets up JDK and ANDROID_HOME automatically).
macOS / Linux / WSL:
cd mobile
echo "sdk.dir=$ANDROID_HOME" > local.properties
./gradlew testDebugUnitTest --no-daemonWindows — without Android Studio (Docker required):
docker run --rm `
-v "C:/path/to/repo/mobile:/app" `
-w /app `
mingc/android-build-box:latest `
bash -c "echo 'sdk.dir=`$ANDROID_HOME' > local.properties && ./gradlew testDebugUnitTest --no-daemon"Replace C:/path/to/repo with the actual path to your clone.
- Backend: Django 4.2, Django REST Framework, PostgreSQL
- Frontend: React 19, Vite, React Router
- Mobile: Android (Kotlin), Retrofit, OkHttp
- Auth: JWT (SimpleJWT)
- Infrastructure: EC2, Docker Compose, Nginx, Let's Encrypt
CMPE354 — Group 8