A graph-based relational database management system (RDBMS) API for alternative credit scoring of Small and Medium Enterprises (SMEs) in Africa.
# CreditGraph Backend - Neural Risk Infrastructure
The **CreditGraph Backend** is a high-concurrency event-driven API cluster built with Flask. It serves as the institutional gateway for credit scoring, node relationship mapping, and financial protocol orchestration.
---
## 🏗 High-Speed Architecture
This backend is optimized for enterprise scale using a multi-layer async architecture:
1. **API Gateway (Flask)**: Handles institutional handshakes, JWT-based authentication, and CRUD operations for nodes and edges.
2. **Async Task Cluster (Celery + Redis)**: Offloads heavy computation (GNN scoring, data syncs) to background workers to maintain sub-second API latency.
3. **Performance Cache (Redis)**: High-speed caching for aggregated dashboard metrics and network discovery maps.
4. **Institutional Models (SQLAlchemy)**: Structured storage for businesses, transactions, credit scores, and institutional integrations.
---
## 🛠 Tech Stack
- **Kernel**: Python 3.10+
- **Framework**: Flask 3.0
- **ORM**: SQLAlchemy
- **Task Queue**: Celery
- **Message Broker**: Redis
- **Auth**: Flask-JWT-Extended
- **Migrations**: Flask-Migrate
---
## 📡 API Nodes & Protocols
### 1. **Institutional Auth**
| Endpoint | Method | Protocol |
| :--- | :--- | :--- |
| `/api/v1/auth/register` | POST | Register SME Lead |
| `/api/v1/auth/login` | POST | Authenticate Node |
### 2. **Dashboard & Discovery**
- `GET /api/v1/dashboard/stats`: Aggregated node statistics (Redis-cached).
- `GET /api/v1/businesses`: List discoverable institutional nodes.
### 3. **Protocol Integrations**
- `POST /api/v1/integrations`: Link institutional SaaS nodes (Stripe, Plaid, M-PESA).
- `POST /api/v1/integrations/ /sync`: Trigger async node synchronization (Celery-driven).
### 4. **Institutional Lender Ecosystem**
- `GET /api/v1/lender/stats`: Institutional portfolio KPIs and yield metrics.
- `GET /api/v1/lender/marketplace`: Discovery hub for pending SME funding requests.
- `POST /api/v1/lender/disburse`: …