# Uganda Insights (Sentinel Edition)
A production-ready economic intelligence platform for Uganda featuring economic dashboards, sentiment analysis, and sovereign data protection.
## Features
- **Economic Dashboard**: Interactive Recharts visualizations of UBOS inflation and trade data
- **Luganda Sentiment Module**: Python NLP with custom Luganda dictionary for market analysis
- **Sentinel Firewall**: Node.js middleware that auto-blocks non-African IPs for 24 hours when accessing classified data
- **Sovereignty Credit Score**: Logic engine calculating 0-100 scores based on local value addition and supply chain transparency
## Tech Stack
| Layer | Technology |
|-------|------------|
| Frontend | Next.js 14 + Tailwind CSS + Recharts + Lucide React |
| Backend | Node.js Express + Prisma ORM + SQLite |
| NLP | Python FastAPI + TextBlob |
## Quick Start
### Prerequisites
- Node.js 18+
- Python 3.8+
- Bun (optional)
### Installation
```bash
# Install Node.js dependencies
npm install
# Generate Prisma client
npx prisma generate
# Push database schema
npx prisma db push
# Install Python dependencies
pip install fastapi uvicorn textblob
```
### Running the Application
```bash
# Terminal 1: Start the backend server
npm run server
# Terminal 2: Start the NLP engine (optional)
python nlp_engine/nlp_engine.py
# Terminal 3: Start the frontend
npm run dev
```
Then open
localhost in your browser.
## API Endpoints
| Method | Endpoint | Description |
|--------|----------|-------------|
| GET | /api/health | Health check |
| GET | /api/economic-data | Get economic indicators |
| POST | /api/economic-data/seed | Seed demo UBOS data |
| GET | /api/businesses | List registered businesses |
| POST | /api/businesses | Register business with sovereignty score |
| PUT | /api/businesses/:id | Update business and recalculate score |
| POST | /api/sentiment/analyze | Analyze text sentiment |
| GET | /api/sentiment/history | Get sentiment history |
| GET | /api/cl …