Welcome to the codebase of the Zero Waste Challenge, a gamified platform designed to promote sustainable living through personalized goals, community challenges, and collaborative efforts.
This repository contains the implementation of the Zero Waste Challenge platform, encompassing backend services, frontend interfaces, and supporting tools.
For detailed information, please refer to Software Requirement Specifications page
** TO BE COMPLETED**
For detailed information on project requirements, design diagrams, and meeting notes, please refer to our Project Wiki.
- Node.js (v18 or later)
- npm (v8 or later)
- Docker (for local deployment)
- Copy and adapt the following files:
backend/.env.example→backend/.env(create this file; see below for required variables)front-end/zero-waste/.env.production(already provided, edit if needed)mobile/.env.example→mobile/.env
SECRET_KEY=your-django-secret-key
DEBUG=True
MYSQL_DATABASE=main_db
MYSQL_USER=admin
MYSQL_PASSWORD=123456789
MYSQL_ROOT_PASSWORD=123456789
[email protected]
EMAIL_HOST_PASSWORD=your-email-password
ALLOWED_HOSTS=localhost,127.0.0.1
-
Start all services:
docker compose up --build
- Backend: http://localhost:8000
- Frontend: http://localhost:3000
-
Apply migrations and seed data: Open a shell in the backend container:
docker compose exec backend-web python manage.py migrate docker compose exec backend-web python manage.py create_badges docker compose exec backend-web python manage.py create_mock_data
- This will create all required tables, badges, and mock/demo data.
-
Default Test Users:
- Regular User:
- Username:
test_user - Password:
test123 - Email:
[email protected]
- Username:
- Admin User:
- Username:
admin - Password:
admin123 - Email:
[email protected]
- Username:
- Regular User:
- Adjust
.envfiles for production (setDEBUG=False, use strongSECRET_KEY, set real email credentials, etc). - Use a production-ready database and configure allowed hosts.
- Build and run with Docker Compose as above.
- Install dependencies:
cd front-end/zero-waste npm install - Start the dev server:
npm run dev
- App runs at http://localhost:5173 (default)
- Copy and edit
mobile/.env.exampletomobile/.env. - Install dependencies:
cd mobile npm install - Start Metro bundler:
npx react-native start
- Start emulator or connect device, then run:
npm run android # or npm run ios
- View running containers:
docker ps
- Enter backend container shell:
docker compose exec backend-web /bin/bash - Stop all containers:
docker compose down
- To re-seed the database with mock/demo data:
docker compose exec backend-web python manage.py create_badges docker compose exec backend-web python manage.py create_mock_data
- To reset the database, stop containers, remove volumes, and restart:
docker compose down -v docker compose up --build # Then re-run the seeding commands above
- The backend and frontend are fully containerized for local and production use.
- The backend mock data script creates a regular test user (
test_user/test123) and at least one admin user. - For more details, see the documentation and comments in each service's README.
For any issues, please refer to the Project Wiki or contact the maintainers.