Live Backend: https://milesbank-production.up.railway.app
Root Endpoint: GET / → {"message": "Miles Bank API is LIVE"}
A complete, production-ready, full-stack digital banking backend built from scratch with Spring Boot 3 + Java 17.
Inspired by Opay, Kuda & Moniepoint — but faster, cleaner, and ready for millions of users.
This is a real bank backend.
| Feature | Status | Description |
|---|---|---|
| Registration + OTP Login | Done | Email + 6-digit OTP (real Gmail SMTP ready) → OTP printed clearly in Railway logs when SKIP_EMAIL=true (Railway blocks outbound SMTP on free tier, so we skip email in production to avoid crashes — industry-standard practice for demos & interviews) |
| Virtual Debit Cards (NGN & USD) | Done | Create, view, top-up from wallet |
| Internal Transfers | Done | Instant Miles-to-Miles |
| Cross-Currency Transfers | Done | NGN ↔ USD with dynamic rates |
| External Transfers (All Nigerian Banks) | Done | Powered by Paystack |
| Name Enquiry & Bank Validation | Done | 219 Nigerian banks + Miles Bank internal |
| Bill Payments | Done | Airtime, Data, Electricity, TV (DSTV, GOtv, Startimes) |
| Transaction History + PDF Receipts | Done | Professional downloadable receipts (iText7) |
| Profile Picture Upload | Done | Cloudinary integration |
| Admin Panel Endpoints | Done | Full control over users, wallets, rates |
| Exchange Rate Management | Done | Admin sets live USD/NGN rate |
| JWT + Role-Based Security | Done | USER & ADMIN roles |
POST /api/auth/register→ Register user + generate 6-digit OTPPOST /api/auth/login→ Login with email + OTPPOST /api/auth/resend-otp?email=...→ Resend OTPPOST /api/auth/logout→ Invalidate token
POST /api/wallets/create/ngn→ Create NGN wallet + set PINPOST /api/wallets/create/usd→ Create USD wallet + set PINGET /api/wallets/my→ Get both NGN & USD walletsGET /api/wallets/balances→ Current balancesPUT /api/wallets/pin/ngn→ Change NGN PINPUT /api/wallets/pin/usd→ Change USD PIN
POST /api/transactions/internal→ Miles Bank → Miles Bank (instant)POST /api/transactions/cross-currency→ NGN ↔ USD conversionPOST /api/transactions/external→ Transfer to any Nigerian bank (via Paystack)POST /api/transactions/verify-name→ Name enquiry before transferGET /api/transactions/my→ My transaction historyGET /api/transactions/rates→ Current USD/NGN ratesGET /api/transactions/admin/all→ (Admin) All transactions
POST /api/card/create/ngn→ Create NGN virtual cardPOST /api/card/create/usd→ Create USD virtual cardGET /api/card/ngn→ View NGN card detailsGET /api/card/usd→ View USD card detailsPOST /api/card/topup/miles/ngn→ Fund card from wallet
POST /api/bill/pay→ Pay airtime, data, TV, electricityGET /api/bill/data-plans/MTN→ Get MTN data bundlesGET /api/bill/tv-plans/DSTV→ Get DSTV packagesGET /api/bill/history→ Bill payment history
GET /api/history/all→ Full transaction historyGET /api/history/pdf/transaction/{id}→ Download bank-grade PDF receipt
GET /api/users/my-profile→ Get logged-in user detailsPUT /api/users/update-profile-picture→ Upload photo (Cloudinary)GET /api/users/all→ (Admin) List all users
GET /api/admin/rates→ View current exchange ratesPUT /api/admin/rates→ Update USD/NGN ratesGET /api/wallets/admin/all→ View all user wallets
| Service | Purpose | Status | Notes |
|---|---|---|---|
| Paystack | External transfers & bills | Live (Test) | Switched from NuBAPI (down) → Paystack is rock-solid |
| Gmail SMTP | Email delivery | Optional | Disabled on Railway (SKIP_EMAIL=true) |
| Cloudinary | Profile picture storage | Live | Fast, secure, CDN |
| PostgreSQL | Production database | Live (Railway) | Auto-migration |
| iText7 | PDF receipt generation | Done | Bank-grade receipts |
| Luhn Algorithm | Card number validation | Done | Industry standard |
| JWT + BCrypt | Authentication & password hashing with 24-hour token expiration | Done | Military-grade security (BCrypt) + JWT tokens expire automatically after 24 hours |
Paystack Test Mode: Maximum 3 real transactions/day (normal behavior). Switch to live key for unlimited.
- Spring Boot 3.5.6 (Java 17)
- Spring Security + JWT
- Spring Data JPA + Hibernate
- PostgreSQL
- Maven
- Lombok
- Paystack SDK
- Cloudinary
- iText7 PDF
- Railway.app (Production hosting)
git clone https://github.com/lukmanOye/MilesBank.git
cd MilesBank
# Required environment variables
export JWT_SECRET=your_very_long_random_secret
export PAYSTACK_SECRET_KEY=sk_test_xxxxxxxxxx
export CLOUDINARY_CLOUD_NAME=yourname
export CLOUDINARY_API_KEY=123456789
export CLOUDINARY_API_SECRET=your_secret
./mvnw spring-boot:run
### Live API Endpoints
#### Auth