Duolingo-style PWA for learning Somali — built for the diaspora. FastAPI + Next.js + PostgreSQL + AWS.
# Somali Language Learning App
A Duolingo-style PWA for learning Somali, built for the diaspora community — especially children reconnecting with their heritage language.
---
## What it is
An interactive web app that teaches Somali through structured lessons, vocabulary, and sentences. Designed to be accessible on mobile and installable as a PWA, with a focus on the Somali diaspora who want to reconnect with the language.
---
## Project Structure
```
somali-app/
├── backend/ FastAPI REST API
├── frontend/ Next.js PWA
└── infrastructure/ Terraform (AWS)
```
---
## Tech Stack
| Layer | Technology |
|----------|-------------------------------|
| Frontend | Next.js 16 + React 19 (TypeScript) |
| Backend | FastAPI (Python) |
| Database | PostgreSQL (RDS) |
| Infra | Terraform + AWS |
| Container | Docker + ECR |
---
## Backend
### Files
| File | Purpose |
|------|---------|
| `main.py` | API routes: `GET /lessons`, `GET /lessons/{id}`, `GET /words`, `GET /words/{category}` |
| `models.py` | SQLAlchemy models: `Word`, `Sentence`, `Lesson` |
| `database.py` | DB connection — reads `DATABASE_URL` from env |
| `seed.py` | Wipes and reloads the DB from `somali_seed_data.json` |
| `somali_seed_data.json` | 156 words, 107 sentences, 18 lessons across 13 categories |
| `Dockerfile` | Builds the container for ECR/EC2 |
### Dependencies
| Package | Version | Role |
|---------|---------|------|
| `fastapi` | 0.115.0 | Web framework |
| `uvicorn` | 0.30.6 | ASGI server |
| `sqlalchemy` | 2.0.35 | ORM / DB layer |
| `psycopg2-binary` | 2.9.9 | PostgreSQL driver |
| `pydantic` | 2.9.2 | Request/response validation |
### Running locally
```bash
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload
```
API runs at `
localhost`.
---
## Frontend
### Files
| File | Purpose |
|------|---------|
| `a …