Logo Lanfrica

EmmanuelAdah/PanAfrik_Store

Domain:

digital infrastructure

Record type:

software
Creator:
Emm
Host:
Pan Afric Store -- An express based application, focused on currency conversion and locking in four major African currencies (NGN, GHS, ZAR, KES) and USD. # 🌍 Pan-Afrik Store API **Pan-Afrik Store** is a high-performance cross-border e-commerce backend engine. It solves the critical challenge of currency volatility in African trade by implementing automated exchange rate synchronization, rate-locking at checkout, and decoupled merchant payout logic. --- ## πŸš€ Key Technical Features - **Automated Currency Sync**: Integrated `RateService` that fetches, caches, and manages exchange rates via a PostgreSQL-backed `RateCache`. - **Atomic Checkout**: A robust transaction-based checkout system that locks exchange rates to prevent price fluctuations during payment. - **Merchant Payout Management**: Automatically calculates merchant earnings in their local `baseCurrency`, ensuring sellers receive exact amounts regardless of the buyer's currency. - **Security & Resilience**: - **JWT & Role-Based Access**: Strict boundaries for `merchant` and `customer` roles. - **Rate Limiting**: Protects sensitive checkout and auth endpoints from brute-force attacks. - **Cloudinary Integration**: Secure handling and storage of product imagery. --- ## πŸ—οΈ Project Architecture ``` β”œβ”€β”€ config/ # Cloudinary, CORS, Prisma, and Redis setups β”œβ”€β”€ controllers/ # Express handlers (Auth, Cart, Order, Product, Rate, User) β”œβ”€β”€ coverage/ # LCOV and Jest test coverage reports β”œβ”€β”€ middleware/ # Hash, JWT Auth, Rate Limiter, and Role Check logic β”œβ”€β”€ prisma/ β”‚ β”œβ”€β”€ migrations/ # SQL migration history β”‚ └── schema.prisma # PostgreSQL relational schema β”œβ”€β”€ routes/ # Unified API route definitions β”œβ”€β”€ services/ # Business Logic: Currency, Rates, Webhooks, Image Uploads β”œβ”€β”€ test/ # Comprehensive Jest integration and unit test suites β”œβ”€β”€ utils/ # AppError, catchAsyncErrors, Logger, and Validators β”œβ”€β”€ app.js # Express application configuration └── server.js # Server entry point ``` # API Documentation **Base URL:** panafrik-store.on …