Skip to content

RadW2020/fleetomatic

Repository files navigation

Fleetomatic

A NestJS-based fleet management system that helps organizations track and manage their vehicle fleet. The system provides comprehensive vehicle tracking, maintenance scheduling, and incident reporting capabilities.

Features

  • Vehicle management and tracking
  • Maintenance scheduling and history
  • Incident reporting and tracking
  • RESTful API with Swagger documentation
  • PostgreSQL database integration
  • Docker containerization
  • Comprehensive test coverage (Unit, E2E, and Postman tests)

Tech Stack

  • NestJS (Node.js framework)
  • TypeScript
  • PostgreSQL
  • TypeORM
  • Docker
  • Swagger/OpenAPI
  • Jest (Testing)

Prerequisites

  • Node.js (v14 or higher)
  • Docker and Docker Compose
  • PostgreSQL (if running locally)

Getting Started

Development Setup

  1. Clone the repository
  2. Create a .env file with the following configuration:
POSTGRES_HOST=postgres
POSTGRES_USER=le_user
POSTGRES_PASSWORD=le_pwd
POSTGRES_DB=le_db
PG_DATA=/var/lib/postgresql/data
NODE_ENV=development
  1. Start the development environment:
sudo docker-compose build && docker-compose up

The application will be available at http://localhost:3000

Testing

Unit Tests

npm run test

Coverage Tests

npm run test:cov

End-to-End Tests

sudo docker-compose -f docker-compose-e2e.yml build && docker-compose -f docker-compose-e2e.yml up

API Tests (Postman)

  1. Install Newman:
npm install -g newman
  1. Run the Postman collection:
newman run -e ./test/postman/FLEET_DEV.postman_environment.json ./test/postman/fleetomatic.postman_collection.json

Documentation

API Documentation

Swagger documentation is available at /doc endpoint when the application is running.

Code Documentation

Generate code documentation using Compodoc:

npx @compodoc/compodoc -p tsconfig.json -s

Project Structure

src/
├── vehiculos/           # Vehicle management module
│   ├── novedades/      # Incident reporting module
│   ├── vehiculo.entity.ts
│   ├── vehiculo.dto.ts
│   └── ...
├── app.module.ts       # Main application module
├── main.ts            # Application entry point
└── ...

License

UNLICENSED - All rights reserved

Author

Raúl Jiménez [email protected]

sudo docker-compose build && docker-compose up

Necesita el archivo .env configurado con la conexión a la base de datos:

POSTGRES_HOST=postgres
POSTGRES_USER=le_user
POSTGRES_PASSWORD=le_pwd
POSTGRES_DB=le_db
PG_DATA=/var/lib/postgresql/data
NODE_ENV=development

Unit Tests

npm run test

Coverage Tests

npm run test:cov

e2e Tests

sudo docker-compose -f docker-compose-e2e.yml build && docker-compose -f docker-compose-e2e.yml up

Postman Tests

npm install -g newman
newman run -e ./test/postman/FLEET_DEV.postman_environment.json ./test/postman/fleetomatic.postman_collection.json
newman

API Documentation

Swagger is available in /doc

Code Documentation

Compodocs can be generated with this command:

npx @compodoc/compodoc -p tsconfig.json -s

About

Technical Interview Home Assignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published