Production-ready fintech platform for Ghana internet data bundles (VTU), featuring secure authentication, wallet management, Mobile Money integration, and admin controls.
| Component | Technology |
|---|---|
| Frontend | Next.js 16.2.x + React 19 + Tailwind CSS |
| Backend | Node.js + Express (modular architecture) |
| Database | PostgreSQL with connection pooling |
| Authentication | JWT + bcrypt |
| Payments | Hubtel, Paystack, ExpressPay (pluggable) |
| Hosting | Render (recommended), PM2 + Nginx, or Docker |
backend/src/ # Express backend
โโโ config/ # Environment & config
โโโ db/ # Database utilities
โโโ middleware/ # Auth, validation, errors
โโโ modules/ # Feature modules
โ โโโ auth/ # Registration, login, OTP
โ โโโ payment/ # Payment processing
โ โโโ vtu/ # Data bundle purchases
โ โโโ wallet/ # Wallet operations
โ โโโ transaction/ # Transaction history
โ โโโ admin/ # Admin operations
โโโ utils/ # Utility functions
frontend/ # Next.js frontend
โโโ app/ # Pages & layouts
โโโ components/ # React components
โโโ lib/ # API & utilities
docs/ # Documentation
database/ # SQL schema
# Install and setup
cd backend && npm install && npm run db:setup
cd ../frontend && npm install
cd ..
# Copy environment files
cp backend/.env.example backend/.env
cp frontend/.env.local.example frontend/.env.local
# Start services (in separate terminals)
cd backend && npm run dev # http://localhost:4000
cd frontend && npm run dev # http://localhost:3000
โ See DEVELOPMENT_SETUP.md for detailed setup
Follow the DEPLOYMENT.md guide for step-by-step production deployment.
Before deploying, complete the PRODUCTION_CHECKLIST.md.
SELECT FOR UPDATE to prevent double-spending| Document | Purpose |
|---|---|
| DEVELOPMENT_SETUP.md | Local development environment setup |
| DEPLOYMENT.md | Production deployment instructions |
| PRODUCTION_CHECKLIST.md | Pre-deployment verification |
| PRODUCTION_READY.md | Production hardening summary |
| API.md | Complete API endpoint reference |
| HUBTEL_SMS_SETUP.md | SMS gateway configuration |
| SMS_QUICK_START.md | SMS setup quick reference |
Backend tests:
cd backend
npm test # Run all tests
npm run test:watch # Watch mode
Frontend E2E tests:
cd frontend
npm run test:e2e # Run Playwright tests
npm run test:e2e:ui # Run with UI
To test payment callback handling:
curl -X POST http://localhost:4000/api/payment/callback \
-H "Content-Type: application/json" \
-H "x-callback-token: your_callback_token" \
-d '{
"externalReference": "REF-123",
"status": "SUCCESS",
"providerReference": "PROV-456"
}'
docker compose up --build
All environment variables are documented in:
backend/.env.example - Backend configurationfrontend/.env.local.example - Frontend configurationโ ๏ธ Never commit .env files - Use .env.example templates only
See API.md for complete endpoint documentation including:
npm test (backend) or npm run test:e2e (frontend)For deployment or configuration issues, see:
[Add your license here]
cd backend npm test
Frontend:
```bash
cd frontend
npx playwright install
npm run test:e2e
See: