MiniPay is a lightweight digital wallet and payment management system built with Go. It provides secure user authentication, wallet management, balance deposits, peer-to-peer transfers, and transaction tracking through a RESTful API.
The project demonstrates modern backend development practices including JWT-based authentication, layered architecture, database persistence, and secure transaction handling.
- User registration
- User login
- Password hashing using BCrypt
- JWT token generation and validation
- Protected API routes
- Create a personal wallet
- View wallet details
- Deposit funds into wallet
- Retrieve current wallet balance
- Transfer money between wallets
- Transaction recording and storage
- View transaction history
- Balance validation before transfers
- Password encryption with BCrypt
- JWT authentication middleware
- Protected routes
- Database-backed persistence
- Go (Golang)
- Gin Web Framework
- MySQL
- GORM ORM
- JWT (JSON Web Tokens)
- BCrypt Password Hashing
- HTML
- JavaScript
minipay/
│
├── cmd/
│ └── main.go
│
├── config/
│ ├── config.go
│ ├── database.go
│ └── jwt.go
│
├── handlers/
│ ├── auth.go
│ ├── wallet.go
│ └── transaction.go
│
├── middleware/
│ └── auth.go
│
├── models/
│ ├── user.go
│ ├── wallet.go
│ └── transaction.go
│
├── repositories/
│ ├── wallet_repository.go
│ └── transaction_repository.go
│
├── services/
│ ├── auth_service.go
│ ├── wallet_service.go
│ └── transaction_service.go
│
├── ui/
│ └── index.html
│
├── go.mod
└── README.md
MiniPay follows a layered architecture:
Handles incoming HTTP requests and API responses.
Contains business logic such as:
- Wallet operations
- Money transfers
- Authentication workflows
Responsible for database interactions.
Stores:
- Users
- Wallets
- Transactions
type User struct {
Name string
Email string
Password string
}type Wallet struct {
UserID uint
Balance float64
}type Transaction struct {
SenderWalletID uint
ReceiverWalletID uint
Amount float64
Status string
}POST /registerRequest:
{
"name": "John Doe",
"email": "john@example.com",
"password": "password123"
}POST /loginRequest:
{
"email": "john@example.com",
"password": "password123"
}Response:
{
"message": "Login successful",
"token": "<jwt-token>"
}All routes below require:
Authorization: Bearer <jwt-token>GET /mePOST /wallet/createGET /walletPOST /wallet/depositExample:
{
"amount": 1000
}POST /transferExample:
{
"receiver_wallet_id": 2,
"amount": 250
}GET /transactionsgit clone https://github.com/SulakshanCGhimire/minipay.git
cd minipaygo mod tidyCreate a .env file:
DB_USER=root
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=3306
DB_NAME=minipay
JWT_SECRET=your_secret_keyEnsure MySQL is running and the configured database exists.
go run cmd/main.goServer runs at:
http://localhost:8080
GET /pingResponse:
{
"message": "pong"
}- Transaction reversal support
- Account verification
- Admin dashboard
- Real-time notifications
- Mobile application
- QR-based payments
- Multi-currency wallets
- Payment gateway integration
- Fraud detection module
- Transaction analytics dashboard
This project demonstrates:
- REST API Development
- Backend Engineering
- JWT Authentication
- Password Security
- Database Design
- Layered Architecture
- Repository Pattern
- Financial Transaction Processing
Sulakshan Chandra Ghimire
Computer Engineering Student
GitHub: https://github.com/SulakshanCGhimire
This project is licensed under the MIT License.