An Organization & Vehicle Management API's
It is a RESTful API service designed to manage organizational hierarchies and vehicle information. The system allows users to create, update, and retrieve details of organizations and vehicles, with specific functionality to handle organizational policies such as fuel reimbursement and speed limits, including policy inheritance across a hierarchical structure of organizations.
The project is built using Node.js and Express.js and includes several key features such as:
- VIN (Vehicle Identification Number) Decoding: An endpoint to decode VINs using an external API.
- Organization Management: Endpoints to create, update, and retrieve organizations with hierarchical policy inheritance.
- Rate Limiting: To prevent abuse by limiting the number of requests from an IP address.
- Caching: In-memory caching to improve performance by storing responses temporarily.
- Swagger UI: Integrated for API documentation and testing.
- Backend: Node.js, Express.js
- API Documentation: Swagger UI
- Data Caching: Memory-cache
- Rate Limiting: Express-rate-limit
- HTTP Client: Axios
- VIN Decoding: An endpoint to decode vehicle information from a VIN.
- Organization Hierarchy: Manage organizations with support for hierarchical policies that propagate to child organizations.
- API Documentation: Interactive API documentation using Swagger UI.
- Performance Enhancements: Includes rate limiting and caching for enhanced performance and security.
- URL:
/ - Method:
GET - Description: A simple endpoint to check if the server is running. It returns a message indicating that the server is up and running.
- URL:
/api-docs - Method:
GET - Description: Provides a UI for interacting with and testing the API endpoints. This is auto-generated using a
swagger.yamlfile.
- URL:
/vehicles/decode/:vin - Method:
GET - Description: Decodes a Vehicle Identification Number (VIN) using the external NHTSA (National Highway Traffic Safety Administration) API. The VIN must be a 17-character string.
- URL:
/vehicles - Method:
POST - Description: Adds a vehicle to the system using its VIN and associated organization ID.
- URL:
/vehicles/:vin - Method:
GET - Description: Retrieves details of a vehicle by its VIN.
- URL:
/orgs - Method:
POST - Description: Creates a new organization with details like name, account, website, and policies.
- URL:
/orgs/:id - Method:
PATCH - Description: Updates the details of an existing organization, including account, website, and policies. It also supports hierarchical policy updates, propagating changes to child organizations.
- URL:
/orgs - Method:
GET - Description: Retrieves a list of all organizations, including their details and hierarchical relationships.
