Amisha328 / NodeJS-weCare

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

weCare Capstone Project on NodeJS

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.

User Registration:

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.

image

User Login:

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.

image

If the user is not registered, then the below response has to be sent:

image

Get User Details:

Get the user details using the userID for the get request at /users/userID.

image

Coach Registration:

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.

image

Coach Login:

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.

image

Get All Coaches:

This service should be able to get all available coaches for the get request at /coaches/all.

image

Make an appointment:

This service should enable the user to make an appointment for the post request at /users/booking/:userId/:coachId

image

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:

image

The date of the appointment should be any of the upcoming 7 days.

image

Reschedule an appointment:

This service should enable the user to reschedule an existing appointment for the put request at /booking/:bookingId.

image

Cancel an appointment:

This service should enable the user to cancel an existing appointment for the delete request at /booking/:bookingId.

image

Get appointments corresponding to the coach:

This service should enable the coach to get all appointments corresponding to the coachId for the get at /coaches/booking/:coachId.

image

Note:

Software Requirement:

  1. MongoDB
  2. Postman
  3. Node JS
  4. 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.

About


Languages

Language:JavaScript 100.0%