How gabrieldpzz/wompi-gateway works
Project type and purpose
• This is a full-stack e-commerce gateway built with Spring Boot (Java) on the backend, Thymeleaf/HTML/CSS/JavaScript on the frontend, and MySQL as the database.
• It provides product catalog browsing, cart management, user authentication, and payment processing via the external Wompi payment API.
File structure
• src/main/java/com/ejemplo/wompigateway: Spring Boot application entry point (WompiGatewayApplication.java), controllers, models, repository, and service layers.
• src/main/resources/templates: Thymeleaf (or JSP) templates for UI pages (index, productos, carrito, form, signup, signout, response).
• src/main/resources/static: Frontend assets (config.js, page0.js, page1.js, styles.css).
• Configuration: application.properties for DB and other settings.
• pom.xml, mvnw scripts: Maven build and dependency management.
README for additional insights
• Describes supported API routes (authentication, cart operations, purchase transactions, Wompi payment links).
• Highlights external dependency on MySQL and Wompi’s REST API.
a. Main components
• Client (Browser) – renders Thymeleaf templates, static JS/CSS
• Spring Boot Backend
– Web layer: CompraController, ProductoController
– Service layer: ProductoService (business logic, cart operations, payment orchestration)
– Repository layer: ProductoRepository (CRUD on productos table via JPA)
• MySQL Database – productos table, user sessions stored in HTTP session or DB
• External Service – Wompi Payment API (transaction endpoints)
b. Relationships and interactions
• Browser → HTTP GET/POST → Controllers
• Controllers ↔ Services (cart manipulation, validation)
• Services ↔ Repository (persisting/fetching Producto entities)
• Services → Wompi API (REST calls for transactions, payment link generation)
• Controllers → Thymeleaf templates/static resources → Browser
c. Architectural patterns & design principles
• Layered architecture (Controller → Service → Repository)
• MVC at the web tier (templates as views, controllers as presenters)
• Dependency Injection (Spring-managed beans)
• External service integration via REST client in service layer
d. Technologies & frameworks
• Java 17+, Spring Boot (Web, Data JPA)
• Thymeleaf (view rendering)
• MySQL (relational DB)
• JavaScript/CSS (frontend interactivity & styling)
• Maven (build), Git (VCS)
• Wompi REST API