Welcome to the comprehensive documentation for the Online Shopping System. This documentation covers all aspects of the system including architecture, design, workflows, and API specifications.
1. Introduction
Comprehensive overview of the Online Shopping System project.
Contents:
- Executive Summary
- Project Purpose and Scope
- Core Functionalities (Customer & Admin)
- Technology Stack
- Key Features (Security, Performance, UX)
- System Architecture Overview
- Non-Functional Requirements
- Project Status and Future Enhancements
Audience: All stakeholders, new team members, project managers
2. UML Diagrams
Complete set of UML diagrams illustrating system design and interactions.
Contents:
- Use Case Diagram: User and admin interactions
- Class Diagrams: Entity models for all services
- User Auth Service (User, Address, Role)
- Product Service (Product, Image)
- Order Service (Order, OrderItem, Cart, CartItem)
- Payment Service (Payment, Coupon, SavedPaymentMethod)
- Sequence Diagrams: Key workflows
- User Registration and Login
- Browse and Add to Cart
- Checkout and Place Order
- Payment Processing
- Admin Product Management
- Component Diagram: Service architecture and dependencies
- Activity Diagrams: Complete shopping flow, admin workflows
Audience: Developers, architects, technical leads
3. ER Diagram
Detailed database schema and entity relationships.
Contents:
- Database Overview (Database-per-Service pattern)
- User Auth Database: users, addresses tables
- Product Database: products, images tables
- Order Database: orders, order_items, carts, cart_items tables
- Payment Database: payments, saved_payment_methods, coupons tables
- Complete System ER Diagram with cross-service relationships
- Table Specifications (data types, constraints, indexes)
- Data Encryption details
- Database Statistics and Backup Strategy
Audience: Database administrators, backend developers, architects
Comprehensive workflow diagrams for all system processes.
Contents:
- User Workflows:
- User Registration
- User Login
- Product Browsing and Search
- Shopping Cart Management
- Checkout and Order Placement
- Payment Processing
- Order Tracking
- Admin Workflows:
- Product Management (Create, Update, Delete)
- Coupon Management
- Order Management
- System Workflows:
- Service Startup Sequence
- JWT Authentication Flow
- Inter-Service Communication
- Payment Workflows:
- Payment Processing (Detailed)
- Coupon Validation
- Error Handling Workflows
Audience: Developers, QA engineers, business analysts
Detailed system architecture and design decisions.
Contents:
- Architecture Overview and Principles
- Microservices Architecture
- Service Catalog
- Service Interaction Diagrams
- Component Details (all 7 services)
- Communication Patterns
- Synchronous (REST/Feign)
- Service Discovery (Eureka)
- API Gateway Pattern
- Data Architecture (Database-per-Service)
- Security Architecture
- Authentication Flow (JWT)
- Authorization (RBAC)
- Security Layers
- Deployment Architecture
- Current (Development)
- Planned (Production with Kubernetes)
- Scalability & Performance
- Technology Decisions & Rationale
Audience: Architects, senior developers, DevOps engineers
Guide for implementing API documentation using Swagger/OpenAPI.
Contents:
- Overview and Benefits
- Maven Dependencies
- Configuration Classes for each service
- Application Properties setup
- Controller Annotations (examples)
- DTO/Model Annotations
- API Documentation Access URLs
- Best Practices
- Implementation Steps
- Troubleshooting Guide
Audience: Backend developers, API consumers
Complete guide for running the application manually and using automated scripts.
Contents:
- Prerequisites (Java, Maven, MySQL, Node.js, Angular CLI)
- Manual Startup: Step-by-step instructions for starting each service
- MySQL Database
- Discovery Server
- API Gateway
- All Microservices (User Auth, Product, Order, Payment)
- Frontend (Angular)
- Automated Startup - Linux/Mac: Using
start_all.shscript- Script features and execution flow
- Viewing logs
- Automated Startup - Windows: Using
start_services.batscript- Script features and execution flow
- Viewing logs
- Verification steps and health checks
- Stopping services (manual and automated)
- Troubleshooting common issues
- Quick reference (URLs, commands, credentials)
Audience: All developers, DevOps engineers, new team members
βββββββββββββββ
β Frontend β (Angular - Port 4200)
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββββββ
β API Gateway β (Port 8181)
ββββββββββ¬βββββββββ
β
ββββββ΄βββββββββββββββββββββββββ
β Discovery Server (Eureka) β (Port 8761)
ββββββ¬βββββββββββββββββββββββββ
β
ββββββ΄ββββββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββ ββββββββββββββββ
β User Auth β β Product β
β Service β β Service β
β (Port 9090) β β (Port 8083) β
βββββββββββββββββ ββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββ ββββββββββββββββ
β Order β β Payment β
β Service β β Service β
β (Port 8084) β β (Port 8085) β
βββββββββββββββββ ββββββββββββββββ
- user_auth_db: User accounts and addresses
- product_db: Product catalog and images
- order_db: Orders, order items, shopping carts
- payment_db: Payments, saved payment methods, coupons
Each microservice owns its database (Database-per-Service pattern).
- JWT Authentication: Stateless, secure token-based auth
- RBAC: Role-based access control (USER, ADMIN)
- Data Encryption: AES-256 for sensitive data
- BCrypt: Password hashing
- CORS: Configured for frontend origin
- Java 17
- Maven 3.8+
- MySQL 8.0+
- Node.js 16+ (for frontend)
- Angular CLI
# Start all services
bash start_all.sh
# Or manually:
# 1. Start MySQL
sudo service mysql start
# 2. Build backend
cd backend
mvn clean install -DskipTests
# 3. Start services (in order)
java -jar discovery-server/target/discovery-server-0.0.1-SNAPSHOT.jar &
java -jar api-gateway/target/api-gateway-0.0.1-SNAPSHOT.jar &
java -jar user-auth-service/target/user-auth-service-0.0.1-SNAPSHOT.jar &
java -jar product-service/target/product-service-0.0.1-SNAPSHOT.jar &
java -jar order-service/target/order-service-0.0.1-SNAPSHOT.jar &
java -jar payment-service/target/payment-service-0.0.1-SNAPSHOT.jar &
# 4. Start frontend
cd ../frontend
ng serve- Frontend: http://localhost:4200
- Eureka Dashboard: http://localhost:8761
- API Gateway: http://localhost:8181
- Swagger UI (after configuration):
- User Auth: http://localhost:9090/swagger-ui.html
- Product: http://localhost:8083/swagger-ui.html
- Order: http://localhost:8084/swagger-ui.html
- Payment: http://localhost:8085/swagger-ui.html
- Spring Boot 3.2.1
- Spring Cloud 2023.0.0
- Java 17
- MySQL 8.0
- Netflix Eureka
- Spring Cloud Gateway
- OpenFeign
- Spring Security + JWT
- Angular (latest)
- TypeScript
- RxJS
- CSS3
- Maven
- Git
- Docker (planned)
- Kubernetes (planned)
- Backend Developers: Microservices development
- Frontend Developers: Angular application
- DevOps Engineers: Infrastructure and deployment
- QA Engineers: Testing and quality assurance
- Architects: System design and technical decisions
- Product Owner: Requirements and prioritization
When contributing to documentation:
- Keep it Current: Update docs when code changes
- Use Mermaid: For diagrams (renders in GitHub)
- Be Concise: Clear and to the point
- Add Examples: Code snippets and screenshots
- Link Related Docs: Cross-reference other documentation
For questions or issues:
- Technical Issues: Check troubleshooting sections in relevant docs
- Architecture Questions: Refer to Architecture Documentation
- API Questions: Check Swagger documentation
- Database Questions: Refer to ER Diagram documentation
Apache 2.0 License
Documentation Version: 1.0
Last Updated: December 26, 2025
Maintained By: Development Team
- Start with Introduction
- Review Architecture
- Study UML Diagrams
- Understand Workflows
- Set up Swagger for API testing
- Review ER Diagram
- Check Architecture - Data Layer
- Understand cross-service data references
- Read Introduction
- Study Workflows - User Workflows
- Review Architecture - API Gateway
- Check Swagger for API contracts
- Review Architecture - Deployment
- Understand Workflows - System Workflows
- Check service dependencies in Architecture
Happy Coding! π