Cross-border trade and investment platform for SADC and broader Africa
# SAREGO — Southern Africa Regional Economic Growth Office
A full-stack scaffold for a cross-border trade, investment, and project pipeline platform serving SADC and broader Africa.
> **What this is:** a working foundation — not a finished product. It runs locally, the design language is set, the data model is real, and the core APIs work end-to-end.
>
> **What this is not (yet):** S3-backed deal-room file uploads, real-time messaging, the admin moderation UI, or KYC document upload flow. Those are the next iterations.
---
## What's in the box
```
sarego/
├── docs/
│ ├── ARCHITECTURE.md # System architecture, modules, security posture
│ └── API.md # API reference
├── backend/ # Node.js + Express + Postgres
│ ├── src/
│ │ ├── db/
│ │ │ ├── schema.sql # ← Run this against an empty Postgres DB
│ │ │ └── index.js
│ │ ├── middleware/ # auth, error handling
│ │ ├── routes/ # auth, projects, investor, admin, reference
│ │ ├── utils/auth.js
│ │ └── server.js
│ ├── package.json
│ └── .env.example
└── frontend/ # React + Vite
├── src/
│ ├── components/ # Brand, Header, Footer, AfricaMap
│ ├── lib/api.js # Fetch wrapper with auto-refresh
│ ├── pages/
│ │ ├── LandingPage.jsx
│ │ ├── LoginPage.jsx
│ │ ├── InvestorDashboard.jsx
│ │ └── ProjectDetailPage.jsx
│ ├── styles/global.css
│ └── main.jsx
├── index.html
├── package.json
└── vite.config.js
```
---
## Running it locally
### 1. Database
You need PostgreSQL 13+ running locally (or anywhere reachable).
```bash
createdb sarego
psql -d sarego -f backend/src/db/schema.sql
```
### 2. Backend
```bash
cd backend
cp .env.example .env
# Edit .env and set DATABASE_URL + generate JWT secrets
# Generate a secret: node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
npm install
npm run dev
```
Backend runs on `
localhost`.
### 3. Frontend
```bash
cd frontend
np …