Skip to content

Sparrow is a comprehensive telecommunications system designed to handle modern mobile money transactions, and services. Built with Java and Spring Boot, Sparrow provides a robust backend to manage the complexities of mobile money and exposes REST API and XML endpoints that can be used in your apps to test mobile money

License

Notifications You must be signed in to change notification settings

Arison99/Sparrow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sparrow Mobile Money Platform

GitHub stars GitHub forks GitHub issues GitHub license Java Spring Boot Maven Platform

πŸš€ Overview

Sparrow is a comprehensive mobile money simulation platform built with Spring Boot and modern web technologies. It provides a complete ecosystem for testing, developing, and learning mobile money services with both USSD simulation and RESTful API endpoints. The platform features a professional web-based admin dashboard, comprehensive service management, and extensive API documentation.

Key Highlights

  • Enterprise-grade Architecture: Built with Spring Boot 3.2.6 and Maven for scalability and maintainability
  • Dual Interface Support: USSD simulation frontend and modern web-based admin interface
  • RESTful API: Complete REST and XML endpoints for all mobile money operations
  • Professional UI: Modern responsive design with Tailwind CSS
  • Comprehensive Documentation: Extensive API documentation with examples and integration guides

✨ Features

πŸ’Ό Core Services

  • πŸ’Έ Send Money: Secure peer-to-peer money transfers
  • πŸ“± Buy Airtime: Mobile airtime top-up services
  • πŸͺ Pay with MoMo: Merchant payment processing
  • 🧾 Bill Payments: Utility and service bill payments
  • πŸ’° Savings & Loans: Financial savings and loan services
  • πŸ“ˆ Investment & Insurance: Investment portfolios and insurance plans

🎯 Technical Features

  • πŸ”Œ RESTful API: Complete REST and XML endpoints for all services
  • 🌐 Web Dashboard: Professional admin interface with real-time monitoring
  • πŸ“Š Transaction Management: Comprehensive transaction tracking and history
  • πŸ‘₯ User Management: Complete user registration and profile management
  • πŸ” Security: PIN-based authentication and secure transaction processing
  • πŸ“± USSD Simulation: Traditional USSD interface for mobile money operations

πŸ› οΈ Development Tools

  • πŸ“š API Documentation: Comprehensive documentation with cURL examples
  • πŸ§ͺ Testing Framework: Built-in testing capabilities for service validation
  • πŸ”§ Service Management: Individual service configuration and monitoring
  • πŸ“ˆ Analytics Dashboard: Real-time service statistics and user metrics

πŸ—οΈ Architecture

  • 🎯 Modular Design: Clean separation of concerns with adapter pattern
  • ⚑ Spring Boot: Enterprise-grade framework with auto-configuration
  • 🎨 Modern UI: Responsive design with Tailwind CSS
  • πŸ—„οΈ Database Ready: H2 in-memory database with JPA support
  • πŸ”„ Maven Build: Standardized build process and dependency management

πŸ› οΈ Quick Start

Prerequisites

  • Java 11+ - Oracle JDK or OpenJDK
  • Maven 3.6+ - For dependency management and build
  • IDE - IntelliJ IDEA, Eclipse, or VS Code with Java extensions

Installation

  1. Clone the repository

    git clone https://github.com/arison99/Sparrow.git
    cd Sparrow
  2. Build the project

    mvn clean compile
  3. Run the application

    mvn spring-boot:run
  4. Access the platforms

Docker Support (Optional)

# Build Docker image
docker build -t sparrow-momo .

# Run container
docker run -p 8080:8080 sparrow-momo

πŸš€ Usage

Web Admin Dashboard

  1. Access the Dashboard: Navigate to http://localhost:8080/admin
  2. User Management: Add users, view balances, and manage accounts
  3. Service Operations: Process transactions across all mobile money services
  4. Transaction Monitoring: View real-time transaction history and analytics
  5. API Testing: Use built-in tools to test REST and XML endpoints

Individual Service Management

  • Send Money: /admin/service/send-money
  • Buy Airtime: /admin/service/buy-airtime
  • Pay with MoMo: /admin/service/pay-with-momo
  • Pay Bills: /admin/service/pay-bill
  • Savings & Loans: /admin/service/savings-loans
  • Invest & Insure: /admin/service/invest-insure

API Integration

# Add a new user
curl -X POST http://localhost:8080/admin/addUser \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "phone=+1234567890&pin=1234&balance=1000.00"

# Send money
curl -X POST http://localhost:8080/admin/sendMoney \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "fromPhone=+1234567890&toPhone=+0987654321&amount=100.00"

# Get user balance
curl -X POST http://localhost:8080/api/users/balance \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "phone=+1234567890"

USSD Simulation

  1. Run MoMoUSDDApplication.java for traditional USSD interface
  2. Navigate through menu options using number selection
  3. Perform operations like balance inquiry, money transfer, and PIN management

πŸ“‚ Project Architecture

Sparrow/
β”œβ”€β”€ src/main/java/
β”‚   β”œβ”€β”€ adapters/              # Service adapters for different operations
β”‚   β”‚   β”œβ”€β”€ BackendServiceSendMoneyAdapter.java
β”‚   β”‚   β”œβ”€β”€ BackendServiceAirtimeAdapter.java
β”‚   β”‚   β”œβ”€β”€ BackendServicePayWithMoMoAdapter.java
β”‚   β”‚   β”œβ”€β”€ BackendServicePaymentsAdapter.java
β”‚   β”‚   β”œβ”€β”€ BackendServiceSavingsLoansAdapter.java
β”‚   β”‚   β”œβ”€β”€ BackendServiceInvestInsureAdapter.java
β”‚   β”‚   β”œβ”€β”€ BackendServiceFinancialServicesAdapter.java
β”‚   β”‚   β”œβ”€β”€ BackendServiceJsonAdapter.java
β”‚   β”‚   └── BackendServiceXmlAdapter.java
β”‚   β”œβ”€β”€ core/                  # Core business logic
β”‚   β”‚   β”œβ”€β”€ BackendService.java
β”‚   β”‚   β”œβ”€β”€ Menu.java
β”‚   β”‚   β”œβ”€β”€ MenuSystem.java
β”‚   β”‚   └── MenuSystemImpl.java
β”‚   β”œβ”€β”€ handlers/              # HTTP request handlers
β”‚   β”‚   β”œβ”€β”€ Rest*Handler.java  # REST endpoint handlers
β”‚   β”‚   └── Xml*Handler.java   # XML endpoint handlers
β”‚   └── ui/                    # User interface controllers
β”‚       β”œβ”€β”€ AdminController.java
β”‚       β”œβ”€β”€ BackendServer.java
β”‚       └── MoMoUSDDApplication.java
β”œβ”€β”€ src/main/resources/
β”‚   └── templates/             # Thymeleaf templates
β”‚       β”œβ”€β”€ admin.html         # Main dashboard
β”‚       β”œβ”€β”€ users.html         # User management
β”‚       β”œβ”€β”€ services.html      # Service overview
β”‚       β”œβ”€β”€ transactions.html  # Transaction management
β”‚       β”œβ”€β”€ api-docs.html      # API documentation
β”‚       └── [service-name].html # Individual service pages
β”œβ”€β”€ pom.xml                    # Maven configuration
β”œβ”€β”€ API_DOCUMENTATION.md       # Comprehensive API guide
└── README.md                  # This file

Design Patterns

  • Adapter Pattern: Service adapters for different operation types
  • MVC Pattern: Spring Boot controllers with Thymeleaf templates
  • Repository Pattern: Data access abstraction
  • Factory Pattern: Service creation and management

🎯 Use Cases

🏦 Financial Institution Testing

  • Service Validation: Test mobile money services before production deployment
  • Load Testing: Simulate high transaction volumes
  • Integration Testing: Validate third-party integrations
  • Compliance Testing: Ensure regulatory compliance

πŸŽ“ Educational Platform

  • Computer Science: Learn about distributed systems and API design
  • Fintech Training: Understand mobile money ecosystem
  • Software Engineering: Study clean architecture and design patterns
  • API Development: Practice RESTful service development

πŸ”§ Development Framework

  • Prototype Development: Rapid prototyping of mobile money features
  • API Testing: Test client applications against realistic endpoints
  • Documentation: Generate comprehensive API documentation
  • Mock Services: Development environment for mobile money apps

πŸ“Š Research & Analytics

  • Transaction Pattern Analysis: Study mobile money usage patterns
  • Service Performance: Analyze service response times and reliability
  • User Behavior: Understand mobile money user interactions
  • Market Research: Simulate different market scenarios

πŸ”§ Configuration

Database Configuration

# H2 Database (default)
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=

# MySQL Configuration (production)
spring.datasource.url=jdbc:mysql://localhost:3306/sparrow
spring.datasource.username=your_username
spring.datasource.password=your_password

Application Properties

# Server Configuration
server.port=8080
server.servlet.context-path=/

# Logging
logging.level.org.springframework=INFO
logging.level.ui=DEBUG

# Thymeleaf Configuration
spring.thymeleaf.cache=false
spring.thymeleaf.enabled=true

πŸ”Œ API Reference

Authentication

All endpoints support form-based authentication. No API key required for development.

Base URL

http://localhost:8080

Core Endpoints

User Management

  • POST /admin/addUser - Create new user
  • GET /api/users - Get all users (JSON)
  • GET /api/users/xml - Get all users (XML)
  • POST /api/users/balance - Get user balance
  • POST /api/users/transactions - Get user transactions

Service Operations

  • POST /admin/sendMoney - Send money between users
  • POST /admin/buyAirtime - Purchase airtime
  • POST /admin/payWithMoMo - Pay merchant
  • POST /admin/payBill - Pay utility bills
  • POST /admin/savingsLoans - Savings and loan operations
  • POST /admin/investInsure - Investment and insurance services

For detailed API documentation with examples, visit: /admin/api-docs

πŸ§ͺ Testing

Unit Tests

mvn test

Integration Tests

mvn verify

API Testing

Use the built-in API documentation page or tools like Postman:

  • Import the API collection from /admin/api-docs
  • Test all endpoints with sample data
  • Validate JSON and XML responses

πŸš€ Deployment

Production Deployment

  1. Build the JAR

    mvn clean package
  2. Run the application

    java -jar target/sparrow-1.0.0.jar
  3. Configure production database

    java -jar target/sparrow-1.0.0.jar --spring.datasource.url=jdbc:mysql://localhost:3306/sparrow

Cloud Deployment

  • AWS: Deploy to Elastic Beanstalk or ECS
  • Google Cloud: Use App Engine or Cloud Run
  • Azure: Deploy to App Service or Container Instances
  • Heroku: Direct deployment with Maven support

🀝 Contributing

We welcome contributions! Please follow these guidelines:

Development Setup

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/your-feature-name
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
    mvn test
  6. Submit a pull request

Code Standards

  • Follow Java naming conventions
  • Add JavaDoc comments for public methods
  • Write unit tests for new features
  • Use consistent code formatting
  • Update documentation for API changes

Bug Reports

Please include:

  • Java version and OS
  • Steps to reproduce
  • Expected vs actual behavior
  • Stack traces if applicable

πŸ“ˆ Roadmap

Version 2.0 (Upcoming)

  • Real-time Notifications: WebSocket support for live updates
  • Advanced Analytics: Transaction pattern analysis and reporting
  • Multi-currency Support: Handle multiple currencies and exchange rates
  • Security Enhancements: OAuth2 and JWT token authentication
  • Performance Monitoring: Metrics and health check endpoints

Version 2.1 (Future)

  • Microservices Architecture: Break down into individual services
  • Message Queue Support: RabbitMQ/Kafka for async processing
  • GraphQL API: Alternative to REST endpoints
  • Mobile SDK: Native mobile app development kit
  • Blockchain Integration: Cryptocurrency transaction support

Community Stats

  • ⭐ 5+ GitHub Stars
  • πŸ‘₯ 01 Contributor
  • πŸ› 95% Issue Resolution Rate

πŸ“š Resources

Documentation

πŸ“œ License

This project is licensed under the MIT License.

MIT License

Copyright (c) 2024 Sparrow Mobile Money Platform

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

🌟 Show Your Support

If you find Sparrow helpful, please consider:

  • ⭐ Star the repository to show your support
  • 🍴 Fork the project to contribute
  • πŸ› Report issues to help improve the platform
  • πŸ“’ Share with others who might benefit from this project
  • πŸ’¬ Join our community for discussions and support

πŸ“§ Contact & Support

Maintainer

Support Channels

Business Inquiries

For commercial support, enterprise licensing, or custom development:


Built with ❀️ by the Sparrow Team

Making mobile money accessible for everyone

⭐ Star on GitHub | πŸ“– Documentation | πŸš€ Get Started |

GitAds Sponsored

Sponsored by GitAds

About

Sparrow is a comprehensive telecommunications system designed to handle modern mobile money transactions, and services. Built with Java and Spring Boot, Sparrow provides a robust backend to manage the complexities of mobile money and exposes REST API and XML endpoints that can be used in your apps to test mobile money

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published