How shambhugohel/vroom-api works
Project type and purpose
• This is a monolithic Spring Boot “CarSellingAPI” backend: a RESTful web service exposing endpoints to list, search, and manage used‐car data. It uses Spring MVC for the web layer, JPA/Hibernate for persistence to MySQL, AOP for cross-cutting concerns, and Swagger for API documentation.
File structure
• Top-level files: pom.xml (Maven build), application-*.properties (profiles), Tables.sql, logback.xml.
• Key packages under src/main/java/com/carportal:
• api/rest/controller (Web layer: CarDetailController, CarEngineController, etc.)
• api/rest/dto (DTOs for request/response plus paging wrappers)
• service & service/impl (Business logic interfaces & implementations)
• repository (Spring Data JPA repositories)
• entity (JPA entities: ECarDetails, ECarEngine, etc.)
• mapper (MapStruct-style or manual mappers converting between entities and DTOs/models)
• config (WebConfig, JpaConfig, AuditorAware, custom ID generators)
• audit (Auditable base classes & LogAspect for AOP logging)
• utils, exceptions, enums, constants.
README for additional insights
• Technology stack: Spring MVC, JPA/Hibernate, Hikari, MySQL, AspectJ AOP, SLF4J+Logback, Swagger UI.
• Future integrations: AI OCR, ML recommendation engine, data lake, chat/integration services, payment/escrow, analytics dashboards.
Main components
a. API Clients (Web/Mobile)
b. Spring Boot Monolith
1) Web Layer
• Spring MVC Dispatcher → Controllers (CarDetailController, CarEngineController, …)
2) Service Layer
• Business services (CarDetailService, CarEngineService, …)
3) Data Layer
• Repositories (CarDetailRepository, …) → JPA/Hibernate → MySQL
4) Cross-cutting modules
• AOP logging (LogAspect)
• Auditing (AuditableEntity, AuditorAwareImpl)
• Custom ID generation (PrefixedSequenceIdGenerator)
5) DTO & Mapping
• Request/response DTOs and mapper classes
6) Configuration & Docs
• WebConfig (CORS, resource handlers), Swagger UI (Springfox)
c. External Services (future or runtime)
• AI OCR & ML recommendation microservices (HTTP/REST)
• Data Lake / Analytics cluster
• Authentication Providers (OAuth social logins)
• Payment Gateway / Escrow
• Notification services (Email/SMS/Push)
d. Database
• MySQL instance (schema as per Tables.sql)
Relationships and interactions
• Client → (HTTPS) → API Gateway/Load Balancer (if present) → Spring MVC Dispatcher
• Controller → Service → Repository → MySQL
• Controllers ↔ DTOs ↔ Mappers ↔ Entities
• Service → External AI/ML services (HTTP calls)
• AOP Aspect intercepts Controllers & Services for logging/auditing
• Swagger UI served by Springfox
Architectural patterns & design principles
• Layered (Controller → Service → Repository)
• Dependency Injection / Inversion of Control (Spring)
• Aspect-Oriented Programming for logging & audit
• DTO pattern to decouple API model from persistence entities
• Repository pattern via Spring Data JPA
• Configuration & profile separation (dev/prod)