Skip to content

IRAGAME/Mpay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MPay

Node.js CI License: MIT Docker

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.

Features

  • ⚑ 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

Tech Stack

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

Quick Start

Prerequisites

  • Node.js >= 18
  • Docker & Docker Compose
  • A Blink.sv API key
  • LNbits instance (or use Docker Compose)

Installation

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

Environment Variables

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)

API Endpoints

Authentication

Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login User login

Wallet

Method Endpoint Description
GET /api/wallet/balance Get wallet balance
GET /api/wallet/transactions Get transaction history
POST /api/wallet/deposit Create deposit invoice

Cards

Method Endpoint Description
GET /api/cards List user cards
POST /api/cards/create Create virtual card
PATCH /api/cards/:id/freeze Freeze/unfreeze card

Admin

Method Endpoint Description
GET /api/admin/users List all users
GET /api/admin/dashboard Admin dashboard stats

Project Structure

β”œβ”€β”€ 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/

Roadmap

  • Unit and integration tests
  • LNbits wallet-per-user creation
  • KYC verification flow
  • Mobile app (React Native)
  • Multi-currency support
  • Recurring payments
  • P2P transfers between users

Contributing

Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Empowering financial inclusion through Bitcoin Lightning technology.

About

FinTech platform integrating the Bitcoin Lightning Network for virtual Visa/Mastercard card funding. Empowering unbanked users in Africa.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors