Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 3.11 KB

README.md

File metadata and controls

54 lines (35 loc) · 3.11 KB

Car Mart Backend

Welcome to Car Mart Backend! This project serves as the backend component of the Car Mart application, built on the MERN (MongoDB, Express.js, React, Node.js) stack. This README will guide you through the setup and usage of the backend part of the Car Mart project.

Technologies Used

  • Express.js with Typescript: The backend is built using Express.js, a minimalist web application framework for Node.js, along with Typescript for static typing and enhanced developer experience.
  • MongoDB (Mongoose): MongoDB is used as the database, with Mongoose serving as the ODM (Object Data Modeling) library for Node.js.
  • Multer: Multer is utilized for handling file uploads, allowing for the storage of images associated with cars or other entities.
  • Cors: Cors (Cross-Origin Resource Sharing) is implemented to enable secure communication between the frontend and backend servers.
  • Express Validator: Express Validator is employed for validating and sanitizing user input, enhancing the security and reliability of the application.
  • Swagger: Swagger is integrated to automatically generate API documentation, making it easier for developers to understand and utilize the backend API endpoints.

Features

  • CRUD Operations: Car Mart Backend offers CRUD (Create, Read, Update, Delete) functionalities for managing cars inventory, customers, and salesperson records.
  • Image Uploads: Multer facilitates the uploading and storage of images associated with cars or other entities in the database.
  • Data Validation: Express Validator ensures that incoming requests are validated and sanitized according to specified rules, enhancing data integrity and security.
  • API Documentation: Swagger automatically generates API documentation based on the defined routes and schemas, providing a comprehensive reference for developers.

Getting Started

To run the Car Mart Backend locally, follow these steps:

  1. Clone the Repository: Clone the Car Mart repository to your local machine using the following command:

    git clone https://github.com/saadshd/car-mart-backend.git
  2. Install Dependencies: Navigate into the cloned directory and install the required dependencies using npm or yarn:

    cd car-mart-backend
    npm install
  3. Set Up Environment Variables: Create a .env file in the root of the project and add the necessary environment variables, such as MongoDB connection URI.

  4. Start the Development Server: Once the dependencies are installed, start the development server using the following command:

    npm start
  5. Access the API Documentation: Open your web browser and navigate to http://localhost:PORT/api-docs to access the API documentation generated by Swagger.

Contributing

Contributions to Car Mart Backend are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.


Thank you for using Car Mart Backend! If you have any questions or need further assistance, feel free to reach out. Happy coding! 🚗🔧