Skip to content

pranavs2004/Def-Hacks-Patient

Repository files navigation

Def-Hacks-Patient

It is an app that builds a platform for both doctors and patients to create, edit and cancel appointments. In this special situation, we want to be able to help people to get medical service when we are keeping social distance.

Usage

The backend is built in Express.js, and the database is built in MongoDB. The frontend is built in React. To explore the backend, you can do the following:

To start the server:

git clone [email protected]:pranavs2004/Def-Hacks-Patient.git

Then go to the directory by typing this in the terminal:

cd Def-Hacks-Patient

Then you should see your terminal shows that you are in that directory.

Then you can run npm install to install all the packages and npm start to start the server. Then the server will be running.

API

Auth route

  1. post '/auth/login'

A login route will take email and password from the frontend like this:

{
    user: {
        "email": [email protected],
        "password": 123456,
        "identity": "doctor"/"patient"
    }
}

And if it is success, it will return a token to the front, so user can carry that going through the website. {"token": ...............................}

  1. post '/auth/register'

A register route will take data like this from the frontend: username, password, first name, last name, phone number

{
    user: {
        username:
        password:
        firstName:
        lastName:
        phoneNumber:
    }
}

And will get an user back.

Doctor Route

  1. GET '/doctors'

This route is used for getting all doctors.

  1. GET '/doctors/:id'

This route is used for get a certain doctor information.

  1. PUT '/doctors/:id'

This route is used for changing doctor information.

  1. GET '/doctors/:doctorId/appointments'

This route is used for getting all of the appointments that a doctor has.

  1. POST '/doctors/:doctorId/appointments'

This route is used for creating an appointment that a doctor has. i also need the patientId to get this done. So please pass a patientId to me, like:

{
    appointments: {

    }
}
  1. GET '/doctors/:doctorId/appointments/:appointmentId'

This route is used for reading an appointment that a doctor has.

Patient Route

  1. GET '/patients/:id'

This route is used for getting a certain patient's information.

  1. PUT '/patients/:id'

This route is used for changing a certain patient's information.

  1. GET '/:patientId/appointments'

This route is used for creating an appointment that a patient has.

  1. GET '/:patientId/appointments/:appointmentId'

This route is used for reading an appointment that a patient has.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •