
FinTech platform integrating the Bitcoin Lightning Network for virtual Visa/Mastercard card funding.
MPay enables users to create virtual Visa and Mastercard cards funded via Bitcoin Lightning Network deposits. Built for unbanked and underbanked users in Francophone Africa.
- β‘ Bitcoin Lightning deposits via Blink.sv API
- π³ Virtual Visa/Mastercard card generation (Luhn-valid PAN, CVV, expiry)
- π User wallet with LNbits sub-wallet management
- π Real-time transaction history and balance tracking
- π JWT-based authentication with bcrypt password hashing
- π‘οΈ Admin dashboard for user and card management
- π³ Docker Compose for easy infrastructure setup
- π± Responsive web interface with Chart.js analytics
| Layer |
Technology |
| Frontend |
HTML5, CSS3, JavaScript, Chart.js, QRCode.js |
| Backend |
Node.js, Express 4, Sequelize 6 ORM |
| Database |
PostgreSQL 16 |
| Lightning |
Blink.sv GraphQL API, LNbits |
| Auth |
bcryptjs + JWT (7-day expiry) |
| Containerization |
Docker, Docker Compose |
- Node.js >= 18
- Docker & Docker Compose
- A Blink.sv API key
- LNbits instance (or use Docker Compose)
git clone https://github.com/IRAGAME/Mpay.git
cd Mpay
# Set up environment variables
cp backend/.env.example backend/.env
# Edit .env with your configuration
# Start infrastructure (PostgreSQL + LNbits)
docker compose -f backend/docker-compose.yml up -d
# Install backend dependencies
cd backend
npm install
# Start the application
node server.js
| Variable |
Description |
PORT |
Server port (default: 3000) |
DATABASE_URL |
PostgreSQL connection string |
JWT_SECRET |
Secret key for JWT signing |
BLINK_API_KEY |
Blink.sv GraphQL API key |
BLINK_API_URL |
Blink.sv API endpoint |
LN_BITS_URL |
LNbits server URL |
LN_BITS_API_KEY |
LNbits API key |
ADMIN_EMAIL |
Admin account email |
ADMIN_PASSWORD |
Admin account password |
COMMISSION_RATE |
Deposit commission rate (default: 0.01) |
| Method |
Endpoint |
Description |
| POST |
/api/auth/register |
Register new user |
| POST |
/api/auth/login |
User login |
| Method |
Endpoint |
Description |
| GET |
/api/wallet/balance |
Get wallet balance |
| GET |
/api/wallet/transactions |
Get transaction history |
| POST |
/api/wallet/deposit |
Create deposit invoice |
| Method |
Endpoint |
Description |
| GET |
/api/cards |
List user cards |
| POST |
/api/cards/create |
Create virtual card |
| PATCH |
/api/cards/:id/freeze |
Freeze/unfreeze card |
| Method |
Endpoint |
Description |
| GET |
/api/admin/users |
List all users |
| GET |
/api/admin/dashboard |
Admin dashboard stats |
βββ backend/
β βββ server.js
β βββ package.json
β βββ docker-compose.yml
β βββ config/
β β βββ db.js
β β βββ env.js
β βββ controllers/
β β βββ adminController.js
β β βββ authController.js
β β βββ cardController.js
β β βββ walletController.js
β β βββ webhookController.js
β βββ middleware/
β β βββ admin.js
β β βββ auth.js
β βββ models/
β β βββ index.js
β β βββ User.js
β β βββ Card.js
β β βββ Transaction.js
β βββ routes/
β β βββ admin.js
β β βββ auth.js
β β βββ cards.js
β β βββ wallet.js
β β βββ webhooks.js
β βββ services/
β β βββ blinkService.js
β β βββ lnbitsService.js
β βββ utils/
β βββ errors.js
β βββ logger.js
βββ frontend/
βββ index.html
βββ dashboard.html
βββ auth.html
βββ virtual-card.html
βββ recharge.html
βββ history.html
βββ settings.html
βββ admin.html
βββ css/
βββ js/
Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
Empowering financial inclusion through Bitcoin Lightning technology.