This project is a full-stack web application that allows users to manage their car listings. Each user can add, view, edit, and delete their own cars, with support for image uploads and a global search feature to filter cars by title, description
- Users can sign up and log in with JSON Web Token (JWT) authentication for secure access.
- Users can create, view, update, and delete their car listings.
- Each car entry includes a title, description, up to 10 images, and tags like car type, company, and dealer.
- Each car entry can hold up to 10 images to showcase different angles and details of the car.
- A keyword search allows users to search through all cars based on title, description, or tags, providing easy access to relevant results.
- Backend: Node.js, Express.js, MongoDB, Mongoose
- Frontend: React.js
- Deployment: Vercel
- Authentication: JSON Web Token (JWT)
- Styling: Tailwind CSS (optional for styling purposes)
- Node.js (v14 or higher)
- MongoDB (local instance or a cloud database like MongoDB Atlas)
- Vercel account (optional for deployment)
-
Clone the repository:
git clone https://github.com/your-username/car-management-app.git cd car-management-app
-
Install dependencies: Run this command in both
backend
andfrontend
directories.npm install
-
Set up environment variables:
In the
backend
directory, create a.env
file with the following values:PORT=5000 MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret CLOUDINARY_NAME=your_cloudinary_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
In the
frontend
directory, create a.env
file with:REACT_APP_API_BASE_URL=http://localhost:5000
-
Run the application:
-
Backend:
cd backend npm start
The backend server should be running on
http://localhost:6001
. -
Frontend:
cd frontend npm start
The frontend client should be accessible at
http://localhost:3001
.
-
- POST
/signup
: Creates a new user account. - POST
/login
: Authenticates a user and issues a JWT.
- POST
/api/cars
: Add a new car (requires authentication). - GET
/api/cars
: Retrieve all cars for the authenticated user. - GET
/api/cars/:id
: Retrieve details of a specific car. - PUT
/api/cars/:id
: Update car details. - DELETE
/api/cars/:id
: Delete a car.
This project is licensed under the MIT License.