How siddharthp02/lpay works
Project Type and Purpose
• This is a full-stack, microservices-style simulation of a UPI payment ecosystem (“Lpay – a UPI Clone”)
• Key components:
• UPI Client (Thymeleaf front-end + Spring Boot REST client)
• UPI Server (handles user registration, login, UPI ID generation)
• NPCI Server (central switch that orchestrates transactions)
• Bank Server(s) (one or more bank APIs managing accounts and balances)
• Databases (MySQL instances per server)
File Structure
• Top-level directories: “Client copy” (UPI Client), “UPI Server”, “NPCI Server”, “Bank Server”
• Each service follows the standard Spring Boot layout:
• src/main/java/com/.../controller (REST controllers)
• …/service + …/service/impl (business logic)
• …/repository (JPA interfaces)
• …/entity/domain (data models)
• src/main/resources/application.properties (DB config)
• templates/ (Thymeleaf HTML) for front‐ends
• Maven build files (pom.xml, mvnw) and test directories present per microservice
README Insights
• Architecture described as 3 servers + 1 client, all Spring-Boot REST APIs, front-end via Thymeleaf
• Uses MySQL for persistence
Components & Interactions
• UPI Client (Browser + Thymeleaf UI + REST client module)
• UPI Server (Spring Boot service)
• NPCI Server (Spring Boot orchestration service)
• Bank Server(s) (one or more identical Spring Boot services)
• Optional: Log store (file or centralized logging service)
1. User → UPI Client UI (HTTP)
2. UPI Client → UPI Server (REST call: registration, login, fetch balance)
3. UPI Server ↔ MySQL (JPA)
4. UPI Server → NPCI Server (REST: transaction request)
5. NPCI Server ↔ MySQL (JPA for NPCI accounts, logs)
6. NPCI Server → Bank Server A & B (REST: debit/credit calls)
7. Bank Servers ↔ their MySQL (account/transaction tables)
8. Each server → centralized log (or local log files)
9. Responses flow back in reverse order
c. Architectural Patterns & Principles:
• Microservices per domain (client, UPI, NPCI, bank)
• Layered (Controller → Service → Repository → DB)
• RESTful APIs for inter-service communication
• Domain-driven entities for accounts, transactions, users
• Separation of concerns (UI vs business vs persistence)
d. Key Technologies:
• Java 17+ / Spring Boot (Web, Data JPA, Security)
• Thymeleaf for client templates
• MySQL for persistence
• Maven for build
• Spring Security (custom user details, WebSecurityConfig)
Detailed Guidance
[Controller] → [Service] → [Repository]
This highlights your MVC pattern inside each service.
• Don’t overcrowd—capture only essential data flows and components