Team 4:
- Anh Tran
- Alicia Shi
- Jonathan Wu
- Samson Xu
GreenPath is a comprehensive web application for tracking environmental impact and promoting sustainable practices. The platform helps users monitor their carbon footprint, set sustainable goals, and discover eco-friendly alternatives.
- React 19 - UI Framework with latest features
- TypeScript ~5.8.3 - Type safety and better DX
- FastAPI - Modern Python web framework
- MySQL 8.0 - Relational database
- Docker & Docker Compose (recommended approach)
- OR if running locally:
- Node.js >= 22.12.0
- Python 3.11+
- MySQL 8.0
Docker provides the fastest and most reliable way to get started. All services (frontend, backend, database) will run in containers.
Before running docker-compose up, you need to create a .env file in the backend directory:
cp backend/env.example backend/.envThe .env file should contain:
DATABASE_URL=mysql+pymysql://user:password@mysql:3306/greenpath
SECRET_KEY=your-secret-key-here-change-in-production
NEWS_API_KEY=your-news-api-key-here
- Visit NewsAPI.org
- Sign up for a free account
- Get your API key from the dashboard after signing up
- Add it to
.envfile:NEWS_API_KEY=your-actual-api-key-here
- Replace
your-news-api-key-herein the.envfile with your actual API key
# Clone the repository (if not already done)
git clone <repository-url>
cd cs160_project
# Build and start all services
docker-compose up --buildOnce containers are running:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- Database: localhost:3306 (user:
user, password:password, database:greenpath)
Login with these default credentials:
- Email: test@gmail.com
- Password: test
If you need to reset the database to a clean state:
# Stop containers and remove the database volume
docker-compose down -v
# Restart - database will reinitialize automatically
docker-compose up# Stop all containers (preserves data and dependencies)
docker-compose down
# Stop and remove all volumes (clean slate - use after adding new dependencies)
docker-compose down -vcs160_project/
├── frontend/ # React + Vite frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components (Dashboard, Auth, etc.)
│ │ ├── services/ # API service layer
│ │ ├── hooks/ # Custom React hooks
│ │ └── lib/ # Utilities
│ ├── Dockerfile # Frontend container config
│ └── package.json # Frontend dependencies
├── backend/ # FastAPI backend
│ ├── app/
│ │ ├── api/ # API routes
│ │ ├── core/ # Config, database, security
│ │ ├── models/ # Database models
│ │ └── schemas/ # Pydantic schemas
│ ├── Dockerfile # Backend container config
│ └── requirements.txt # Python dependencies
├── docker-compose.yml # Docker orchestration
└── README.md # This file