Giter Club home page Giter Club logo

hospital-api's Introduction

Hospital API

It is an API which is used during covid19 situation where Dr. can regiter your self. Through this API,Dr. can register patient and create report about patient.And Dr. can see report by patient id(no need to authenticate) and through the status also(authentication need).

Table Of Content

Features

  • sign up with email and password
  • register patient
  • create report
  • get report

Technology Used

Technology Version
bcryptjs 2.4.3
dotenv 8.2.0
express 4.17.1
jsonwebtoken 8.5.1
mongoose 5.10.3
nodemon 2.0.4
passport 0.4.1
passport-jwt 4.0.0
validator 13.1.1

Folder structure

hospital_api
├─ assets
│  └─ img
│     ├─ Register.png
│     ├─ createReport.png
│     ├─ getReports.png
│     ├─ login.png
│     ├─ patientRegister.png
│     └─ reports.png
├─ config
│  ├─ AppError.js
│  ├─ catchAsync.js
│  ├─ mongoose.js
│  └─ passport-jwt-strategy.js
├─ controllers
│  ├─ authController.js
│  ├─ errorController.js
│  ├─ patientController.js
│  └─ reportController.js
├─ models
│  ├─ patient.js
│  ├─ report.js
│  └─ user.js
├─ routes
│  ├─ doctors.js
│  ├─ index.js
│  ├─ patients.js
│  └─ reports.js
├─ .gitignore
├─ app.js
├─ config.env
├─ package-lock.json
├─ package.json
├─ readme.md
└─ server.js

Quick Start

Clone the repository with the below command:

   git clone https://github.com/ayushkumar731/hospital_api.git

Into the project directory

    cd hospital_api

Install npn dependencies

    npm install

Set your all id's password ,secret key etc. in config.env file'

    DATABASE_URL=Your Atlas MongoDB link or you can use local database
    DATABASE_PASSWORD=If You are using Atlas then provide your database password

    JWT_SECRET_KEY=Provide random 32bit string
    JWT_EXPIRES_IN=set the day as you want(eg. 30d)

Start project by using command below

    npm start

The Server now be running at http://localhost:80/

To run in the Postman with the following routes :-

  • POST -> /doctors/register (to register the doctor)

  • POST -> /doctors/login (to Authenticate)

  • POST -> /patients/register (to register the patient with mobile number "If patient all ready register then you get the reports of patient", 'Authentication need')

  • POST -> /patients/:id/create_report (to create a report with status either :'Negative','Travelled-Quarantine','Symptoms-Quarantine','Positive-Admit'. imp!-"Dr. should be authenticate" )

  • GET -> /patients/:id/all_reports (to check the report of pateint old to new ,'no need to Authenticate,patient can also check your status with their relative ID')

  • GET -> /reports/:status (To check the patient list with the status .Set status as a 'params'..'Aunthentication need')

Demo

To register the Doctor

Register

To Authenticate

login

To Register the patient

login

Create Report for patient

login

Get Reports by Patient ID

login

Get Reports by Status

login

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.