Welcome to the Car Manager API! This project aims to provide a comprehensive solution for managing cars, dealerships, and deals through a RESTful API. This document outlines the project's features, database schema, installation instructions, API documentation, and more.
- Database Schema
- Requirements
- Installation
- API Documentation
- Authentication
- Error Handling
- Data Population
- Technologies Used
- Contributing
- License
The database schema is defined using a visual diagram and can be found at this link. It represents the relationships between cars, dealerships, users, and deals in the system.
The Car Manager API strives to fulfill the following requirements:
- Implement authentication for admins, users, and dealerships using JSON Web Tokens (JWT).
- Enable JWT invalidation for logout and password change functionality.
- Provide REST endpoints for users and dealerships to manage cars, dealerships, and deals.
- Utilize geographical data for user location-based operations (using maps API).
- Support multipart/form-data for POST requests.
- Implement asynchronous error handling using promises for all API endpoints.
- Utilize ES6 features and coding standards.
- Generate dummy data using the Faker.js library.
- Provide basic API documentation for developers.
- Clone this repository.
- Install the required dependencies using
npm install
. - Configure environment variables for database connection and JWT secret.
- Run the server using
npm start
.
For detailed API documentation, refer to the API Documentation file.(Under Development)
Authentication is implemented using JSON Web Tokens (JWT). Users, dealerships, and admins will receive a JWT upon successful login, which will be included in the headers of subsequent requests for authentication.
Asynchronous error handling is consistently applied to all API endpoints. Detailed error messages and appropriate HTTP status codes are provided to facilitate graceful error handling on the client side.
- Node.js
- Express.js
- MongoDB Atlas
- Jest
- JWT for authentication
- Faker.js for generating dummy data
Contributions are welcome! Please follow the guidelines outlined in the Contributing Guidelines to contribute to the project.(Under Development)
This project is licensed under the MIT License.
To populate the database with dummy data, run the following command:
npm run populate-data