How buianhtai1205/techstore works
Project type and purpose
• Type: A monolithic, Spring Boot-based e-commerce REST API with additional support for WebSocket chat, templated e-mail, and scheduled tasks.
• Purpose: Expose endpoints for product/catalog management, user authentication, orders, payment (VNPay), feedback, and real-time chat; persist data in a relational database; store files in S3; send emails via FreeMarker templates; run in Docker with CI/CD via Jenkins.
Break down the file structure into architectural layers
• Presentation Layer (Controllers):
– Packages: com.vn.TECHstore.controller.*
– Handles HTTP (REST), WebSocket connections (ChatController + WebSocketConfig), and serves FreeMarker email/order templates.
• Service Layer:
– com.vn.TECHstore.service.*
– Business logic for products, orders, users, feedback, payments, mail, scheduling (TaskSchedule).
• Data Access Layer (Repositories + Entities):
– com.vn.TECHstore.repository.* + com.vn.TECHstore.entity.*
– JPA Repositories (common, order, product, user, feedback) with some custom implementations; maps to underlying RDBMS tables.
• Configuration & Infrastructure:
– com.vn.TECHstore.config.*
– Security (JWT filter, CORS, custom auth handlers), Async, Swagger, S3 storage, payment (VNPay), WebSocket, FreeMarker, and environment-specific application-*.properties.
• Utilities & Validators:
– com.vn.TECHstore.util.* + com.vn.TECHstore.validator.*
– Shared constants, DateTimeUtils, FileUtils, validators.
External Systems & Resources
• Relational Database (MySQL/Postgres) holds all entities.
• Amazon S3 (or S3‐compatible) for file uploads (images, order attachments).
• VNPay payment gateway.
• SMTP/Email server for transactional emails (configured via FreeMarker templates).
• Clients (Web UI, Mobile apps) communicate over HTTPS.
• CI/CD pipeline: Jenkins server builds Docker image, pushes to Docker Hub, deploys via docker-compose.
Capturing Essential Details
• At least one sample flow end-to-end (e.g., Order placement: Client → OrderController → OrderService → Payment → Repository → Email notification).
• JWT filter sits between clients and controllers.
• Scheduling component separately (cron jobs).