Skip to content

SentinelTrack é um sistema de gestão de frotas que rastreia motos em tempo real, gera relatórios e controla acesso por perfis para melhorar eficiência e uso da frota.

License

Notifications You must be signed in to change notification settings

SouzaEu/SentinelTrack

Repository files navigation

SentinelTrack - Fleet Management System

Java Spring Boot License Build Status codecov

Enterprise-grade fleet management platform built with Spring Boot, designed for scalability, security, and operational efficiency.

Table of Contents

Overview

SentinelTrack is a comprehensive fleet management solution designed to address real-world challenges in large-scale motorcycle rental operations. The system provides real-time tracking, intelligent reporting, and role-based access control to optimize fleet utilization and operational efficiency.

Key Challenges Addressed

Operational Scale

  • Management of 150,000+ vehicles
  • Distribution across 500+ parking facilities
  • Support for 200,000+ active operators
  • Year-over-year growth of 300%

Efficiency Improvements

  • Reduces vehicle search time by 80% (from 15-20 minutes to under 30 seconds)
  • Increases fleet utilization from 60% to 85%
  • Decreases maintenance costs by 40% through predictive strategies
  • Delivers annual operational savings of R$ 1.2M+

Features

Core Functionality

Fleet Management

  • Real-time vehicle tracking and status monitoring
  • Instant license plate search capabilities
  • Comprehensive CRUD operations for motorcycles and parking facilities
  • Advanced filtering and search mechanisms

Analytics & Reporting

  • Real-time operational dashboards
  • Fleet utilization metrics
  • Maintenance scheduling and tracking
  • Performance KPIs and trend analysis

Security & Access Control

  • Spring Security integration with role-based authorization
  • Three-tier access model (Admin, Manager, Operator)
  • JWT-based API authentication
  • Session management with automatic logout

API Integration

  • RESTful APIs with comprehensive documentation (Swagger/OpenAPI)
  • Mobile-optimized endpoints
  • Health check and monitoring capabilities
  • CORS configuration for cross-origin requests

Technology Stack

Backend

  • Java 17 - LTS version with modern language features
  • Spring Boot 3.4.5 - Production-ready application framework
  • Spring Data JPA - Data persistence layer
  • Spring Security - Authentication and authorization
  • Flyway - Database migration management
  • Thymeleaf - Server-side template engine

Database

  • H2 - In-memory database for development
  • Oracle - Production-grade database

DevOps & Tools

  • Gradle - Build automation and dependency management
  • Docker - Containerization
  • GitHub Actions - CI/CD pipeline
  • Swagger - API documentation

Testing

  • JUnit 5 - Unit testing framework
  • Mockito - Mocking framework
  • AssertJ - Fluent assertions

Architecture

SentinelTrack follows a layered architecture pattern with clear separation of concerns:

┌─────────────────────────────────────┐
│     Presentation Layer              │
│  (Controllers, Views, DTOs)         │
└─────────────────────────────────────┘
              ↓
┌─────────────────────────────────────┐
│     Application Layer               │
│  (Services, Business Logic)         │
└─────────────────────────────────────┘
              ↓
┌─────────────────────────────────────┐
│        Domain Layer                 │
│  (Entities, Repositories)           │
└─────────────────────────────────────┘
              ↓
┌─────────────────────────────────────┐
│    Infrastructure Layer             │
│  (Database, Security, Config)       │
└─────────────────────────────────────┘

Design Patterns

  • Repository Pattern - Data access abstraction
  • Service Layer Pattern - Business logic encapsulation
  • DTO Pattern - Data transfer optimization
  • Dependency Injection - Loose coupling and testability
  • Builder Pattern - Complex object construction

SOLID Principles

  • Single Responsibility - Each class has one well-defined purpose
  • Open/Closed - Open for extension, closed for modification
  • Liskov Substitution - Subtypes must be substitutable for base types
  • Interface Segregation - Client-specific interfaces
  • Dependency Inversion - Depend on abstractions, not concretions

For detailed architecture documentation, see ARCHITECTURE.md.

Getting Started

Prerequisites

  • Java 17 or higher
  • Git
  • Modern web browser

Local Development

# Clone the repository
git clone https://github.com/SouzaEu/SentinelTrack.git
cd SentinelTrack

# Run with development profile (H2 in-memory database)
./gradlew bootRun --args='--spring.profiles.active=dev'

# Access the application
# http://localhost:8080

Test Credentials

Username Password Role Permissions
admin admin123 ADMIN Full system access
gerente admin123 MANAGER Fleet and facility management
operador admin123 OPERATOR Vehicle operations

Database Access

  • Development: H2 Console at /h2-console
    • JDBC URL: jdbc:h2:mem:testdb
    • Username: sa
    • Password: (leave empty)

Building for Production

# Build JAR file
./gradlew clean build

# Run tests
./gradlew test

# Generate coverage report
./gradlew jacocoTestReport

API Documentation

REST Endpoints

Authentication

POST /api/mobile/auth/login - JWT authentication

Fleet Management

GET    /api/mobile/motos           - List motorcycles
GET    /api/mobile/motos/{id}      - Get motorcycle details
POST   /api/mobile/motos           - Create motorcycle
PUT    /api/mobile/motos/{id}      - Update motorcycle
DELETE /api/mobile/motos/{id}      - Delete motorcycle
GET    /api/mobile/motos/buscar/{placa} - Search by license plate

Facilities

GET    /api/mobile/patios          - List parking facilities
GET    /api/mobile/patios/{id}     - Get facility details

Analytics

GET    /api/mobile/dashboard       - Dashboard statistics
POST   /api/mobile/relatorios/uso  - Usage reports

System

GET    /api/mobile/health          - Health check endpoint

Swagger Documentation

Interactive API documentation available at:

  • Local: http://localhost:8080/swagger-ui/index.html
  • Production: https://sentineltrack-api.onrender.com/swagger-ui/index.html

Deployment

Docker

# Build image
docker build -t sentineltrack:latest .

# Run container
docker run -p 8080:8080 sentineltrack:latest

Docker Compose

# Start services
docker-compose up -d

# Stop services
docker-compose down

Cloud Platforms

Render

  1. Connect GitHub repository
  2. Set build command: ./build.sh
  3. Set start command: ./start.sh
  4. Configure environment variables
  5. Deploy

Railway

# Install Railway CLI
npm install -g @railway/cli

# Login
railway login

# Deploy
railway up

Environment Variables

# Application profile
SPRING_PROFILES_ACTIVE=prod

# Database configuration
DATABASE_URL=jdbc:oracle:thin:@//host:port/service
DB_USERNAME=your_username
DB_PASSWORD=your_password

# Security
JWT_SECRET=your-secret-key-minimum-256-bits

# Server port (for cloud platforms)
PORT=8080

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details on:

  • Code of conduct
  • Development workflow
  • Coding standards
  • Pull request process
  • Testing requirements

Project Structure

SentinelTrack/
├── src/
│   ├── main/
│   │   ├── java/
│   │   │   └── fiap/com/br/SentinelTrack/
│   │   │       ├── Api/          # REST controllers
│   │   │       ├── Application/  # Services, DTOs, Mappers
│   │   │       ├── Domain/       # Entities, Repositories
│   │   │       └── Infrastructure/ # Configuration
│   │   └── resources/
│   │       ├── db/migration/     # Flyway migrations
│   │       ├── templates/        # Thymeleaf views
│   │       └── application.yml   # Configuration
│   └── test/                     # Test suite
├── docs/                         # Documentation
├── .github/
│   └── workflows/                # CI/CD pipelines
├── build.gradle                  # Build configuration
└── README.md                     # This file

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact


Built with Spring Boot | Designed for Enterprise Scale | Open Source

About

SentinelTrack é um sistema de gestão de frotas que rastreia motos em tempo real, gera relatórios e controla acesso por perfis para melhorar eficiência e uso da frota.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •