WeCare is an online Life Coaching application that helps its users to sign up and log in to seek the guidance of famous Life Coaches. Users can search for a Life Coach based on specialty and can book an appointment within seven days. They can also see upcoming appointments and can reschedule or cancel the appointments. Similarly, Life Coaches can also sign up, login, and can see their upcoming schedule.
Register a user to the application as a user for the post request at /users. The JSON sent in the request body is described in the table.
A user ID should be generated and stored in the database when a user registers with the application.
Validations:
<> The name should have a minimum of 3 and a maximum of 50 characters.
<> The password should have a minimum of 5 and a maximum of 10 characters.
<> Age should be greater than 20 and less than 100 years.
<> Gender should be a single character: ‘F’ or ‘M’.
<> PhoneNo should have 10 digits.
<> City, State, and Country should have 3 to 20 characters.
<> If the user provides an email ID that is already used, it should not allow the user to register.
This service should enable a user to login into the application by using the post request at /users/login. The JSON sent in the request body is described in the table.
On successful login, it will return true.
If the user is not registered, then the below response has to be sent:
Get the user details using the userID for the get request at /users/userID.
This service should be able to register a user to the application as a coach for the post request at /coaches. The JSON sent in the request body.
A coach Id should be generated and stored in the database when a coach registers to the application.
Validations:
<> The name should have a minimum of 3 and a maximum of 50 characters.
<> The password should have a minimum of 5 and a maximum of 10 characters.
<> Age should be greater than 20 and less than 100 years.
<> Gender should be a single character: ‘F’ or ‘M’.
<> PhoneNo should have 10 digits.
<> Speciality should have 10 to 50 characters.
This service should enable the coach to login into the application by using the post request at /coaches/login. The JSON sent in the request body.
On successful login, it will return true.
This service should be able to get all available coaches for the get request at /coaches/all.
This service should enable the user to make an appointment for the post request at /users/booking/:userId/:coachId
If someone else has a booking on the same slot and date or if the user has another appointment on the same date and slot, then an error should be thrown:
The date of the appointment should be any of the upcoming 7 days.
This service should enable the user to reschedule an existing appointment for the put request at /booking/:bookingId.
This service should enable the user to cancel an existing appointment for the delete request at /booking/:bookingId.
This service should enable the coach to get all appointments corresponding to the coachId for the get at /coaches/booking/:coachId.
Software Requirement:
- MongoDB
- Postman
- Node JS
- Visual Studio Code
Steps to run a Node JS application in VS Code:
- Open Your Node.js Project.
- Install Dependencies using
npm i
- Run your Node.js Application using
node app.js
- Run the MongoDB server using
mongod
- We are using the Postman application to hit the API endpoints.