“Labari” means stories/news in Hausa
# Labari
> **Labari** (Hausa: *stories / news*) — a production-grade blog platform built on AWS
A portfolio project demonstrating end-to-end DevOps ownership: containerised application deployment, Infrastructure as Code, CI/CD pipelines, database migrations, and security hardening on EC2.
---
## Features
- Blog listing with live search and category filters
- Full post detail with Markdown rendering, likes, and comments
- Responsive dark-mode UI (Next.js 14 + Tailwind CSS)
- Admin dashboard — create, edit, publish posts with image uploads
- JWT authentication
---
## Architecture
```text
Users
│
DNS (Route 53)
│ ALIAS record
ALB (HTTPS :443 / HTTP :80→redirect)
ACM certificate (DNS-validated)
│ HTTP :80
EC2 m5.xlarge
┌─── nginx :80 ──────────────────┐
│ │
│ / → static files │
│ /posts → FastAPI :8000 │
│ /auth/ → FastAPI :8000 │
│ /search → FastAPI :8000 │
│ /images/ → FastAPI :8000 │
│ /health → FastAPI :8000 │
│ │
│ FastAPI + Uvicorn (x2) │
│ :8000 │
│ │ │
│ ▼ │
│ PostgreSQL 16 │
└─────────────────────────────────┘
```
HTTPS is terminated at the ALB using an ACM certificate (DNS-validated via Route 53). HTTP traffic is permanently redirected to HTTPS at the ALB listener. All three Docker services run on the EC2 instance managed by Compose. The EC2 security group allows port 80 only from the ALB — direct access is blocked. The Elastic IP is kept for SSH.
---
## Tech Stack
| Layer | Technology |
| ----- | ---------- |
| IaC | Terraform ≥ 1.9 |
| Config management | Ansible |
| Compute | EC2 m5.xlarge (Ubuntu 22.04) |
| Load balancer | ALB (HTTPS termination, HTTP→HTTPS redirect) |
| TLS | ACM certificate (DNS-validated) |
| Backend | FastAPI + SQLAlchemy + Uvicorn |
| Migrations | Alembic (runs on container startup) |
| Dat …