Skip to content

I'm building this project to learn how to handle a billion of users and learn new topics like concurrency and network programming and understand when to use appropriate algorithms and data structures and master java and java spring, i hope to acquire all of these skills :). the app lets you pay and send money and accept payment.

Notifications You must be signed in to change notification settings

MohamedMoubarakHussein/TheMoneyWallet-TheMMPay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

213 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TheMoneyWallet[TheMMPay]

The Money wallet is an app that lets you pay, send,accept payments and keep track of your payments Using the java and java spring framework :)

flow


Architecture Overview

This project implements a microservices-based, cloud-native architecture with event-driven communication. It is designed to be scalable, maintainable, and resilient for enterprise-grade backends.

Microservices: Gateway Service · Discovery Service · Config Service · Authentication Service · User Management Service · Wallet Service · Transaction Service · History Service · Notification Service · Dashboard Service

Service Discovery: Managed using Eureka to enable dynamic service registration.

API Gateway: A single entry point is provided by Spring Cloud Gateway for routing and load balancing.

Event-Driven Architecture: Apache Kafka is used to enable asynchronous messaging and decoupled service communication.

Centralized Configuration: Handled through Spring Cloud Config to ensure environment consistency.

Security: Implemented using JWT and Spring Security OAuth2.

Persistence Layer:

Containerization: All services are containerized using Docker.

Tech Stack


Frameworks:

Microservices & Cloud:

Asynchronous Messaging:

Authentication & Authorization:

Persistence & Caching:

Development & Testing Tools:

Gateway service

This project uses Spring Cloud Gateway It creates a single entry point for the application, streamlining API routing, ensuring robust security, monitoring performance, and enhancing resiliency. routing

For example this is how the gateway only allow the requests with the right permisions to access the internal services.

Flow of auth

Discovery service

This project uses Spring Cloud Netflix Eureka for service discovery, allowing microservices to register and locate each other dynamically. It eliminates hardcoded service URLs, supports client-side load balancing, and improves scalability and fault tolerance in a distributed architecture.

discovery_service flow

Config service

This project uses Spring Cloud Config To externalize and centralize configuration management across microservices, ensuring consistency, reducing duplication, and enabling dynamic updates without redeployments. This improves scalability, maintainability, and environment-specific flexibility.

config_service flow

Authentication service

This service handles authentication and authorization for the microservices ecosystem using Spring Security, JWT, OAuth2 standards. It provides endpoints like : /signup, /signin, /refreshtoken, /logout, /forgotpassword, /verifytoken, and /verifyemail . Each critical action publishes domain events via Kafka (UserRegistered, UserLoggedIn, TokenRefreshed, etc.), enabling other services to react asynchronously and remain loosely coupled. Centralizing auth improves security, consistency, and token lifecycle control, while keeping each microservice focused on its domain logic.This modular design simplifies future scaling, auditing, and policy enforcement in distributed systems.

Example of auth flow. Auth flow

User Management service

This User Management Service is built with Java and Spring Boot, providing essential user profile operations such as retrieving, updating, and deleting the authenticated user’s profile, along with fetching other users’ profiles by username (/profile, /user/userName).

It leverages Spring Data JPA with MySQL for persistence, Spring Security with JWT for secure authentication and authorization, and Apache Kafka for event-driven messaging.

The service incorporates Spring Cloud Config for centralized configuration, Eureka Client for service discovery, and ModelMapper for efficient DTO mapping.

Development is streamlined with Lombok, Spring Boot DevTools, and Spring Boot Actuator for monitoring, while OpenAPI (Swagger) ensures comprehensive API documentation.

This service emphasizes scalability, security, and extensibility to support future feature additions.

Requirements/User%20Management%20service/arch%20diagram.png

Wallet Service

Wallet Service is a microservice built using Spring Boot for managing user wallets. It provides RESTful APIs to create, retrieve, and update wallet information and balances. The service leverages Spring Data JPA for persistence, MySQL as the relational database, and Redis for caching.

It is integrated with Kafka to publish and consume wallet-related events (e.g., creation, balance update, reservation result) and supports asynchronous processing with Spring WebFlux. Security is handled by Spring Security, and configuration is centralized via Spring Cloud Config. The service registers with Eureka for service discovery.

Key endpoints include: [POST /create — Create a new wallet ,GET /{walletId} — Get wallet by ID,GET /user/{userId} — Get all wallets for a user,PUT /{walletId}/balance — Update wallet balance,PUT /{walletId} — Update wallet details]

Requirements/Wallet%20service/arch.png


Transaction service

Created Transaction microservice in Spring Boot handling complex financial operations with atomicity guarantees through endpoints (/process, /verify, /reverse). Implemented event-driven architecture using Kafka for transaction event propagation across services. Built with distributed transaction patterns, compensating actions for rollbacks, and comprehensive audit logging for financial compliance.

History service

Developed History microservice in Spring Boot with comprehensive endpoints (/getactivity, /getbydate, /filter) for tracking user activities and system events. Leveraged Kafka consumers to capture cross-service events for centralized history recording. Implemented efficient querying patterns with pagination and filtering support for optimized performance on large historical datasets.

Notification service

Built Notification microservice in Spring Boot with multi-channel delivery support (email, SMS, push) through unified REST endpoints (/send, /schedule, /cancel). Implemented Kafka event consumption for triggering notifications based on system events. Designed with template-based message generation, delivery status tracking, and retry mechanisms for reliable notification delivery.

Dashboard service

Built Notification microservice in Spring Boot with multi-channel delivery support (email, SMS, push) through unified REST endpoints (/send, /schedule, /cancel). Implemented Kafka event consumption for triggering notifications based on system events. Designed with template-based message generation, delivery status tracking, and retry mechanisms for reliable notification delivery.

About

I'm building this project to learn how to handle a billion of users and learn new topics like concurrency and network programming and understand when to use appropriate algorithms and data structures and master java and java spring, i hope to acquire all of these skills :). the app lets you pay and send money and accept payment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •