SGIVU Features
SGIVU provides a comprehensive suite of features designed for modern vehicle inventory management. This page covers all major capabilities across authentication, business domains, machine learning, and platform services.Authentication & Authorization
OAuth 2.1 / OpenID Connect
Modern Authentication
Full OAuth 2.1 and OpenID Connect implementation with industry best practices
JWT Tokens
Signed JWT access tokens with RS256 algorithm using JKS keystore
PKCE Flow
Authorization Code with PKCE for secure single-page applications
Refresh Tokens
Automatic token refresh for seamless user experience
- Token Issuance: Access tokens (JWT) and refresh tokens
- OIDC Discovery: Standard
.well-known/openid-configurationendpoint - JWKS Endpoint: Public keys at
/oauth2/jwksfor token verification - Custom Claims: Includes
rolesAndPermissions,username,isAdmin - Session Management: Spring Session JDBC for persistent OAuth2 sessions
- Multiple Clients: Support for web apps, mobile apps, and testing tools
Backend for Frontend (BFF) Pattern
The API Gateway implements the BFF pattern, managing OAuth2 tokens server-side for enhanced security.
Automatic Token Relay
Gateway automatically includes Bearer tokens when proxying to backend services
Granular Permission System
Permission Model: SGIVU uses fine-grained permissions mapped to JWT claims:- Roles aggregate multiple permissions
- Users can have multiple roles
- Permissions checked via
@PreAuthorizeannotations - JWT includes
rolesAndPermissionsarray for efficient validation
Service-to-Service Authentication
Internal Service Key: For service-to-service communication without user context:User Management
User Administration
CRUD Operations
Complete user lifecycle management with validation
Password Security
Custom password strength validation with complexity requirements
User Search
Multi-criteria search with pagination and sorting
Status Management
Enable/disable users without deletion
- User Creation: Username, email, password with strength validation
- Profile Management: Link users to person entities for detailed profiles
- Role Assignment: Assign multiple roles per user
- Status Control: Active/inactive status for access control
- Audit Trail: Creation and modification timestamps
- Username Validation: Prevent special characters with custom validator
- Minimum length (configurable)
- Uppercase and lowercase letters
- Numbers and special characters
- No common passwords
- Validated at creation and update
Person Management
Person Entity:- Full name, document ID, contact information
- Address management with geographical data
- Date of birth and demographic info
- Photo URL support
- Linked to user accounts
Role & Permission Management
Role Features:- Create custom roles with descriptions
- Assign multiple permissions to roles
- View role hierarchy
- Audit role assignments
- Predefined permission catalog
- Read-only permissions list (cannot be created/deleted)
- Permission grouping by domain
- Direct permission-to-role mapping
- ADMIN: Full system access with all permissions
- USER: Standard user with limited permissions
- Custom roles can be created as needed
Vehicle Management
Vehicle Catalog
Vehicle Types
Support for cars, motorcycles, and custom vehicle types
Comprehensive Data
Make, model, year, VIN, mileage, pricing, and more
Status Tracking
Available, sold, reserved, maintenance statuses
Image Management
Multiple images per vehicle with S3 integration
Advanced Search & Filtering
Search Criteria:- Make, model, year range
- Price range (min/max)
- Mileage range
- Status (available, unavailable, sold)
- Vehicle type
- Fuel type and transmission
- Color
- Full-text search in description
- Configurable page size
- Sort by any field (price, year, mileage, createdAt)
- Total count and page metadata
- Cursor-based pagination support
Image Management with S3
Presigned URL Upload Flow:
Image Features:
- Supported Formats: JPEG, PNG, WebP
- Primary Image: First image or manually designated
- Automatic Ordering: When primary deleted, next image promoted
- CORS Configuration: S3 bucket configured for allowed origins
- Metadata Storage: Image info stored in PostgreSQL
- Presigned Downloads: Secure time-limited download URLs
Direct S3 upload reduces backend load and improves upload performance. Backend validates and tracks metadata after upload.
Client Management
Person & Company Clients
Individual Clients
Manage person clients with personal details and contact info
Corporate Clients
Handle company clients with business registration and representatives
Client Search & Analytics
Search Features:- Search by name, document ID, tax ID
- Filter by client type (person/company)
- Location-based filtering
- Email and phone lookup
- Date range filters
- Pagination and sorting
Address Management
Address Features:- Complete address fields (street, city, state, postal code, country)
- Geocoding support (latitude/longitude)
- Multiple addresses per client
- Primary address designation
- Address validation
- International address formats
Purchase & Sales Management
Contract Lifecycle
Contract Types:
- PURCHASE: Acquiring vehicles for inventory
- SALE: Selling vehicles to clients
Advanced Contract Search
Search Criteria:Report Generation
Report Formats:Professional contract documents using OpenPDF
Excel
Detailed spreadsheets with Apache POI
CSV
Data exports for analysis and import
- Contract details and terms
- Client information
- Vehicle specifications
- Payment schedule
- Signatures and timestamps
- Company branding and logos
Machine Learning
Demand Forecasting
SGIVU’s ML service provides predictive analytics for inventory management and sales forecasting.
- Demand prediction by vehicle segment
- Price optimization recommendations
- Inventory turnover forecasting
- Seasonal trend analysis
- Historical pattern recognition
Prediction with Historical Context
Model Training & Retraining
Training Features:- Scheduled automatic retraining
- Manual retraining with date ranges
- Feature engineering pipelines
- Model versioning with joblib
- Training metrics logging
Model Management
Model Metadata:- Artifacts stored with
joblibserialization - Optional PostgreSQL storage for versions
- Feature snapshots for reproducibility
- Prediction logging for monitoring
Platform Services
Centralized Configuration
Git-Based Config
Production configuration from Git repository for version control
Native Mode
Development configuration from local filesystem
- Per-service configuration:
sgivu-{service}.yml - Profile-based:
sgivu-{service}-{profile}.yml - Global defaults:
application.yml - Dynamic refresh: Configuration updates without restart (where supported)
- Label support: Branch/tag-based configuration
Service Discovery with Eureka
Discovery Features:- Automatic service registration
- Health check monitoring
- Load balancing support
- Service metadata
- Instance deregistration on shutdown
- Multi-zone support
http://localhost:8761 shows:
- All registered service instances
- Instance health status
- Service metadata
- Registration timestamps
- Renewal statistics
Circuit Breaking & Resilience
Resilience4j Integration:Circuit Breaker
Prevent cascading failures with automatic circuit breaking
Fallback Routes
Graceful degradation with fallback responses
- CLOSED: Normal operation, requests flow through
- OPEN: Too many failures, requests rejected immediately
- HALF_OPEN: Testing if service recovered
Distributed Tracing
Zipkin Integration:- Trace ID propagation across services
- Span creation for each service call
- Timing and latency tracking
- Error tracing
- Dependency visualization
- Trace timeline visualization
- Service dependency graph
- Latency distribution
- Error rate tracking
- Search by trace ID, service, or time range
Health Checks & Monitoring
Spring Boot Actuator: All Java services expose health endpoints:- Database connectivity
- External API availability
- S3 bucket access
- Redis connection
- Eureka registration status
Frontend Features
Angular 21 SPA
Responsive Design
Bootstrap 5 responsive layout for desktop and mobile
Interactive Charts
Chart.js integration for data visualization
Reactive Forms
Angular reactive forms with validation
Lazy Loading
Module lazy loading for performance
- Dashboard: Overview with key metrics and charts
- Vehicle Management: Search, create, edit vehicles with image upload
- Client Management: Person and company client forms
- Contract Management: Create and view purchase/sale contracts
- User Management: Admin interface for users and roles
- Authentication: OAuth2/OIDC integration via Gateway
- Session Management: Automatic token refresh
- Error Handling: Global error interceptor
- Loading States: Skeleton screens and spinners
- Bootstrap 5 styling
- Bootstrap Icons
- Custom form validators
- Reusable components (tables, modals, cards)
- Pagination components
- File upload with progress
Database Features
Flyway Migrations
Version-Controlled Schema:- Automatic execution on startup
- Version tracking in
flyway_schema_historytable - Rollback support (via scripts)
- Repeatable migrations for seed data
- Checksum validation
Database Per Service
Isolation: Each microservice has its own database:- Data Isolation: Service owns its data schema
- Independent Scaling: Scale databases independently
- Technology Freedom: Different services can use different DB technologies
- Fault Isolation: Database failure affects only one service
PostgreSQL Features
- Indexes: Optimized queries with strategic indexes
- Constraints: Foreign keys, unique constraints, check constraints
- JSON Support: JSONB columns for flexible data
- Full-Text Search: Text search capabilities
- Audit Columns:
created_at,updated_attimestamps
Docker & Deployment
Containerization
All services are containerized with multi-stage Docker builds for optimal image size.
- Multi-stage builds (build → runtime)
- Minimal base images (Alpine, Distroless)
- Non-root users for security
- Health checks in Dockerfile
- Build scripts for automation
Docker Compose
Development Stack:- All microservices
- PostgreSQL (with init scripts)
- Redis
- Zipkin (optional)
- Nginx (optional)
Build & Push Automation
Orchestrated Build:- Builds all service Docker images
- Tags with versions
- Pushes to Docker registry
- Updates Docker Compose files
Next Steps
API Reference
Explore detailed API documentation
Deployment Guide
Learn how to deploy to production
Getting Started
Set up your development environment