DataGhana.io is one website where anyone can come to find clean, reliable Ghana data. They can browse it, download it, or access it through an API
# DataGhana.io - Public Data Portal
DataGhana.io is a public data portal for Ghana agriculture and economic data. Organizations can publish datasets, and developers can access them via a REST API using API keys.
---
## Tech Stack
- **Frontend**: Next.js 14 (App Router), TypeScript, Tailwind CSS, TanStack Query, Recharts
- **Backend**: Python 3.11, FastAPI, SQLAlchemy 2.0, Alembic
- **Database**: PostgreSQL 15 (Supabase)
- **Cache**: Redis (Upstash)
- **Storage**: Cloudflare R2 via boto3
- **Auth**: JWT tokens (python-jose, passlib[bcrypt])
- **Payments**: Stripe Subscriptions
- **AI**: Anthropic Claude API (claude-sonnet-4-6)
---
## Project Structure
```
dataghana.io/
├── backend/ # Python FastAPI codebase
│ ├── main.py # FastAPI application entry point
│ ├── database.py # DB connection and session setup
│ ├── config.py # Config parser from environment
│ ├── requirements.txt # Python package dependencies
│ ├── Dockerfile # Container definition
│ ├── models/ # SQLAlchemy ORM models
│ ├── routers/ # Endpoint path definitions
│ ├── schemas/ # Pydantic input/output validation schemas
│ ├── services/ # Business logic (Auth, AI, R2 Storage, Cache)
│ ├── scrapers/ # Scrapers for Ghana financial/economic data
│ ├── middleware/ # Rate limiting and other middlewares
│ └── scripts/ # Migration, test, and seed scripts
└── frontend/ # Next.js Application
├── app/ # Pages, layout, routing
├── components/ # UI and layout components
└── lib/ # Utility and core API fetchers
```
---
## Development Setup
### Prerequisites
- Docker Desktop
- Python 3.11+
- Node.js 20+
### Local Database and Redis Cache
Run Postgres and Redis locally using Docker:
```bash
docker compose up -d
```
### Backend Setup
1. Change directory to backend:
```bash
cd b …