Overview
Sistema de Ventas is a modern, enterprise-grade sales management system designed using microservices architecture. The platform enables complete management of sales operations including customer management, product catalog, inventory control, purchase orders, sales transactions, and payment processing.8 Microservices
Modular business logic services with independent databases
Angular 18 Frontend
Modern SPA with Material Design components
Spring Cloud Infrastructure
Service discovery, API gateway, and centralized configuration
JWT Security
Secure authentication and authorization across all services
Architecture
The system follows a microservices architecture pattern with the following components:Core Microservices
Authentication Service (jea-auth)
Handles user authentication, JWT token generation and validation, role-based access control
Catalog Service (jea-catalogo)
Manages product catalog, categories, pricing, and product inventory levels
Infrastructure Services
Registry Server
Eureka Server (Port 8090)Service discovery and registration for all microservices
Config Server
Spring Cloud Config (Port 7070)Centralized configuration management via Git repository
API Gateway
Spring Cloud Gateway (Port 8085)Single entry point with JWT authentication and CORS configuration
Technology Stack
Backend Technologies
- Spring Boot 2.5.4 - Microservices framework
- Spring Cloud 2020.0.3 - Distributed system patterns
- Spring Data JPA - Data persistence layer
- MySQL 8.0 - Relational database
- JWT (jjwt 0.9.1) - Token-based authentication
- OpenFeign - Declarative REST client
- Resilience4j - Circuit breaker pattern
- Eureka Client - Service registration
- Java 17 - Runtime environment
Frontend Technologies
- Angular 18.2 - Frontend framework
- Angular Material 18.2 - UI component library
- RxJS 7.8 - Reactive programming
- Chart.js 4.5 - Data visualization
- jsPDF 2.5 - PDF generation
- TypeScript 5.5 - Type-safe JavaScript
Key Features
Automated Business Logic
The system includes intelligent automation for common business operations:
- Automatic Series & Number Generation - Sales and purchase documents automatically generate unique series and sequential numbers
- Tax Calculation - IGV (Value Added Tax) automatically calculated on all transactions
- Inventory Management - Stock levels automatically updated on sales and purchases
- Timestamp Tracking - Automatic creation and update timestamps for all entities
Inter-Service Communication
The system uses Spring Cloud OpenFeign for synchronous service-to-service communication:Gateway Routing
All client requests flow through the API Gateway which provides routing, authentication, and CORS handling:Database Architecture
Each microservice maintains its own MySQL database following the database-per-service pattern:| Service | Database | Purpose |
|---|---|---|
| jea-auth | auth-jea | Users, roles, and access control |
| jea-catalogo | catalogo-ms | Products and categories |
| jea-cliente | jeacliente | Customer information |
| jea-venta | jeaventa | Sales transactions |
| jea-compra | jeacompra | Purchase orders |
| jea-pagos | jeapagos | Payment methods |
| jea-proveedor | jeaproveedor | Supplier information |
| jea-pedidos | jeapedidos | Customer orders |
Security Model
The system implements a comprehensive security model:JWT Authentication Flow
- Login - User authenticates via
/auth/loginendpoint - Token Generation - JWT token created with 1-hour expiration
- Token Validation - Gateway validates tokens before routing requests
- Service Access - Protected services receive validated requests
Role-Based Access Control
The authentication service manages users, roles, and access permissions through a flexible many-to-many relationship model.System Benefits
Scalability
Independent scaling of microservices based on load
Resilience
Circuit breakers and fallback mechanisms prevent cascade failures
Maintainability
Clear separation of concerns and modular architecture
Technology Freedom
Each service can adopt different technologies as needed
Next Steps
Quickstart Guide
Set up and run the complete system locally
Features Overview
Explore detailed capabilities of each service