The project is a MERN web application called BuyCars, which serves as a marketplace for second-hand cars. Users can buy and sell cars on the platform. The application includes features for user authentication, car listing, filtering, editing, and deleting. This is a Solo Project Built in 2 days.
- User Authentication: Users can sign up and log in to the application to access the full functionality.
- Car Listing: Dealers can add their second-hand cars to the platform by providing details such as car model, year, price, colors, mileage, power, and maximum speed.
- Filtering: Users can filter cars based on price, colors, and mileage to find the desired cars more efficiently.
- Car Editing and Deleting: Dealers have the ability to edit and delete their listed cars to keep the inventory up to date.
The application is built using the MERN stack (MongoDB, Express, React, Node.js), TypeScript, SCSS, Redux and follows a client-server architecture.
The frontend is developed using React and Redux for state management. It includes the following dependencies:
- react: JavaScript library for building user interfaces.
- react-dom: Entry point for working with the DOM in React.
- react-icons: Icon library for React.
- react-redux: Official React bindings for Redux.
- react-router-dom: Declarative routing for React applications.
- react-toastify: Toast notifications for React.
- redux: Predictable state container for JavaScript apps.
- redux-thunk: Thunk middleware for Redux.
- sass: CSS extension language.
- typescript: Typed superset of JavaScript.
- vite: Fast development server and build tool for modern web apps.
The backend is implemented using Node.js with Express.js as the web framework. It utilizes MongoDB as the database for storing car listings and user information. The backend dependencies include:
- bcrypt: Password hashing library.
- cors: Middleware for enabling CORS in Express apps.
- dotenv: Environment variable loader.
- express: Fast, unopinionated, minimalist web framework for Node.js.
- jsonwebtoken: JSON Web Token implementation.
- mongoose: MongoDB object modeling tool.
- nodemon: Utility for automatically restarting the server during development.
The following table lists the available API routes and their descriptions:
Route | Method | Description |
---|---|---|
user/signup/ | POST | Register user data in the database |
user/signin/ | POST | Authenticate user credentials and allow them to log in |
marketplace/ | GET | Retrieve all available cars for sale |
marketplace/ | POST | Post a new car for sale in the marketplace |
marketplace/:carId | PATCH | Update specific car details (only allowed for dealers) |
marketplace/:carId | DELETE | Delete specific car (only allowed for dealers) |
oemspec/ | GET | Retrieve the list of Original Equipment Manufacturers (OEMs) |
oemspec/ | POST | Add new Original Equipment Manufacturer's data to the database |