# π 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 β¦