This repository hosts the server-side code for the Car Doctor website, providing APIs to manage services and bookings.
- Node.js
- Express.js
- MongoDB
-
GET /services
- Retrieves all available services.
-
GET /services/:id
- Retrieves details of a specific service by ID.
-
GET /bookings
- Retrieves all bookings.
- Optional Query Parameters:
email
: Filter bookings by user email.
-
POST /bookings
- Creates a new booking.
- Request Body:
{ "userId": "string", "serviceId": "string", "name": "string", "email": "string", "phone": "string", "bookingDate": "string", "status": "string" }
-
PATCH /bookings/:id
- Updates the status of a specific booking by ID.
- Request Body:
{ "status": "string" }
-
DELETE /bookings/:id
- Deletes a specific booking by ID.
-
Clone the repository:
git clone <repository_url>
-
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.env
file based on.env.example
and configure MongoDB URI.
- Create a
-
Run the server:
npm start
-
services
- Schema:
{ "title": "string", "description": "string", "price": "number", "img": "string" }
- Schema:
-
bookings
- Schema:
{ "userId": "string", "serviceId": "string", "name": "string", "email": "string", "phone": "string", "bookingDate": "string", "status": "string" }
- Schema:
-
Responsive Service Viewing:
- Users can view services on laptops, tablets, and mobile devices with a responsive design.
-
Service Booking:
- Users can book services by clicking the "Book" button.
-
User Information Submission:
- Users fill out necessary information when booking a service.
-
View Booked Services:
- Users can view all their booked services.
-
Manage Bookings:
- Users can delete or confirm their booked services.
-
Private Route for Bookings:
- Access to "My Bookings" is restricted to logged-in users (private route).
-
User Authentication:
- Users are required to register or log in to access the website and its features.
-
MongoDB Data Storage:
- All data (services, bookings) is stored in a MongoDB database.
-
CRUD Operations:
- Users can perform CRUD operations (Create, Read, Update, Delete) on services and bookings.
-
Query Parameter Support:
- Users can retrieve specific data based on query parameters (e.g., filtering bookings by email).
This server provides the backend support required for the Car Doctor website, enabling users to book services and manage their bookings efficiently.
Hi, I am Nadim Mahmud Nion. I have recently concluded my graduation from the department of Computer Science and Engineering (CSE) at the Daffodil International University (DIU). I have been learning MERN Stack Web Development since 2022. I am expertise in the following skills:
-
React
-
Express.js
-
Node.js
-
MongoDB
-
Vite
-
React Router
-
Firebase
-
Vercel
-
JavaScript
-
Advanced JavaScript
-
Daisy UI
-
Bootstrap
-
Tailwind
-
HTML5
-
CSS3
-
Media Query
I have built multiple projects using these skills. You are invited to my GitHub profile to know about my projects and don't forget to give a star to my projects.