# 📚 Elimu Hub Tanzania
An online learning platform for Tanzanian students and teachers. Built with React, Node.js/Express, and PostgreSQL.
## Features
- 🎓 Student & Teacher dashboards
- 📖 Subject resource library (notes, PDFs, videos)
- 📝 NECTA past papers (PSLE, CSEE, ACSEE)
- 🧠 Interactive quizzes with instant scoring
- 📊 Progress tracking & leaderboards
- 🔐 JWT authentication with role-based access
---
## 🚀 Quick Deploy (Docker)
### 1. Prerequisites
- Docker & Docker Compose installed on your server
- Port 80 open on your firewall
### 2. Set up environment variables
```bash
cp .env.example .env
nano .env
```
At minimum, set these in `.env`:
```
JWT_SECRET=your_long_random_secret_here
DB_PASSWORD=a_strong_database_password
FRONTEND_URL=
your-server-ip-or-domain
REACT_APP_API_URL=
your-server-ip-or-domain
```
### 3. Build and start
```bash
docker compose up -d --build
```
That's it! The app will be available at `
your-server-ip`.
- **Frontend**: `
your-server-ip`
- **API**: `
your-server-ip`
- **API Docs (Swagger)**: `
your-server-ip` *(expose port 5000 temporarily if needed)*
### 4. Check logs
```bash
docker compose logs -f
docker compose ps
```
### 5. Stop
```bash
docker compose down
```
---
## 🏗️ Project Structure
```
elimu-hub-tanzania/
├── backend/ Node.js/Express API
│ ├── config/ Database connection
│ ├── middleware/ Auth & error handlers
│ └── routes/ API route handlers
├── frontend/ React app (MUI)
│ └── src/
│ ├── contexts/ Auth & loading contexts
│ ├── pages/ All page components
│ ├── components/ Shared components
│ └── services/ Axios API client
├── database/
│ ├── schema.sql PostgreSQL schema + seed data
│ └── migrate.js Migration helper script
├── nginx/
│ └── nginx.conf Reverse proxy config
├── docker-compose.yaml
└── .env.example
```
---
## 🔧 Loc …