André Moleirinho · Projects

2020 · Creator & sole developer · Completed

Car Tracker

A Spring Boot REST API that turns a 17-character VIN into a full vehicle specification.

Fun fact: I built it before buying a second-hand car: I wanted the car's own VIN, not the seller's listing, to tell me whether the engine, year and specs were really what I was about to pay for.

Vehicles live in a small registry: create, list, re-VIN and delete them over REST, with seed data loaded from JSON at startup. Ask for a vehicle's VIN and the API calls the vindecoder.eu VIN Decoder API by Vincario - for the data points it holds, or for the full decode: make, model, model year, body, engine, dimensions and about 50 more fields.

Every provider call is signed: the URL carries the API key and a control sum - the first ten characters of a SHA-1 over the VIN, the operation and both keys - so the secret key never appears in a URL. MapStruct maps the provider's payload onto clean DTOs, including how many API credits the account has left.

Highlights

  1. Seven REST endpoints over a generic CrudRepository, backed by a thread-safe in-memory store with UUID ids.
  2. Seed vehicles loaded from JSON once the application is ready.
  3. SHA-1 control sums sign every VIN request; the API key rides in the path, the secret never does.
  4. A dedicated RestTemplate for the provider, with 3-second connect and read timeouts.
  5. MapStruct mappers with constructor injection, Lombok DTOs and a @Json meta-annotation for lenient, null-free JSON.
  6. Swagger UI and OpenAPI docs, with the code checked in SonarQube.

At a glance

Role
Creator & sole developer
Years
2020
Source
github.com/afmoleirinho96/car-tracker
REST endpoints
7
vehicle fields per decode
~50
signed provider calls
SHA-1

Stack

  • Java 8
  • Spring Boot
  • Spring Web
  • MapStruct
  • Lombok
  • Swagger
  • Gradle
  • vindecoder.eu API
  • SonarQube

Built with Java.