More Torque (MT) is a comprehensive backend system designed to manage vehicles and organizations for a conference booking application. The project involves handling vehicle information, organizational hierarchies, and policy inheritance. It features VIN decoding, rate limiting, caching, and secure API access. This project was developed using Node.js with ExpressJS and MongoDB.
- VIN Decoding: Extracts and provides manufacturer, model, and year information from VINs using the NHTSA API.
- Vehicle Management: Allows CRUD operations for vehicles, including VIN validation and integration with organizational data.
- Organization Management: Supports hierarchical organizational structures with parent-child relationships and policy inheritance.
- Policy Inheritance: Automatically propagates fuel reimbursement and speed limit policies across organizational levels.
- Rate Limiting: Implements rate limiting to prevent abuse and ensure fair use of the API.
- Caching: Uses caching to optimize performance and reduce redundant API calls.
- Authentication: Ensures secure API access by verifying authorized users.
-
Clone the Repository:
git clone https://github.com/amritBskt/TorqueTrack.git cd more-torque
-
Install Dependencies
npm install
-
Configuration
- Set up environment variables in a .env file (if needed).
- Ensure MongoDB is running locally or configure the connection string in your environment.
-
Run the Application
npm start
-
Run Tests
npm test
Vehicles
-
POST /vehicles
- Adds a new vehicle to the system.
- Request body: { vin: "xxxxxxxx", org: "yyyyyy" }
- Decodes VIN, checks organization, and stores vehicle details.
-
GET /vehicles/decode/
- Decodes VIN and retrieves vehicle information.
- Returns cached data if available.
Organizations
-
POST /orgs
- Creates a new organization.
- Request body: { name, account, website, fuelReimbursementPolicy, speedLimitPolicy }
- Assigns the new organization a random parent from existing organizations, or null if none exist.
-
PATCH /orgs
- Updates organization details and policies.
- Request body: { id, account, website, fuelReimbursementPolicy, speedLimitPolicy }
- Propagates policy changes to child organizations.
-
GET /orgs
- Retrieves all organizations with parent details if available.
This project is licensed under the MIT License.