Giter VIP home page Giter VIP logo

vshealth's Introduction

Doctor Appointment Booking Application

By Shivpreet Padhi

This repository has the code for the frontend and backend internship assignment by VSCodeHelp. It contains:

  1. Source Code
  2. Database Queries
  3. Dummy data to populate database

To run locally

Dependencies

  1. Node (^=v16.15.1)
  2. MongoDB
  3. XAMPP

If the above are correctly installed, this website should work on Windows, Mac, and Linux. The server uses https configuration, so you will need to get a ceritification. Since, it is a local build currently, this website can be used.

Steps to run the code

1. Clone the repository

git clone https://github.com/shivpreet16/vsHealth.git

Open the cloned repository in an editor of your choice.

Alternatively, you can also:

1.1. Download repository as a zip folder on your local machine

1.2. Unzip the folder

1.3. Open the folder in an editor of your choice

2. Set up the databases

For a good balance between performance and flexibility, I have used a polygot / hybrid architecture between SQL and NoSQL. Essentially, there are two types of databases at work:

  1. SQL: I have used SQL for transaction heavy features. This includes clinic data, time slots, and appointment data.

    For the SQL part, I used MySQL from XAMPP. The detailed schema and queries are present in server > db.md. However, on running the server, these will get created if they do not already exist.

    So, to run on local, follow the given steps:

    1. Install XAMPP

    2. Go to server > utils > connect.js

    3. Go ro XAMPP mySql shell and run the following commands:

mysql -u root -r
CREATE DATABASE VSCODEHELP;
  1. In the sqlConnect function, ensure that host and dialect are set correctly. If you use password, it can be set with the same set of parameters:

    { host: "localhost", dialect: "mysql", logging: false, password: "your-password-here", }

  2. NoSQL: I have used NoSQL for variable length data that will not change much and is required by simple retrieval and insertion queries. This includes all the doctor profile related data.

    The detailed schema can be seen in server > models > doctors.model.js

    To run on local, you must have MongoDB Compass installed. If you are on Windows, you will have to exclusively install MongoDB SH.

    After this, go to server > utils > connect.js and ensure that the .connect("localhost path") is correct in the mongoConnect() function.

3. Run the server

  1. Open terminal and navigate to the folder containing the cloned repo.

  2. Move to the server directory

cd server
  1. Install all packages
npm install
  1. Create .env file in the server directory. Add the following data
PORT=3000
EMAIL_ADDRESS="[email protected]"
EMAIL_PASSWORD="your-password"
BCRYPT_SALT_ROUNDS=10
JWT_SECRET="your-jwt-secret"

If using a gmail, get the app password. Follow these steps: 1. Go to google account settings. 2. 2FA > app passwords. 3. Paste the password you get from google and not the original password.

  1. Run the server
npm start

4. Populate the databases

Dummy data is available in server > utils > constants.js and there are APIs to populate the database. Follow the given steps:

  1. Add doctor details to mongoDB by making a get request to the following:
https://localhost:3000/doctor/putDoctors
  1. To get all the doctorIds from mongoDB, make a get request to the following:
https://localhost:3000/doctor/getDocId

copy the ids from the console/cmd 3. Paste the array of copied IDs in the constants server > utils > constants.js folder.

  1. To populate the clinics table, make a get request to the following:
https://localhost:3000/clinic/insertClinics
  1. To populate the slots table, make a get request to the following:
https://localhost:3000/doctor/insertSlot
https://localhost:3000/doctor/insertSlotAv

5. Run the client

  1. Open terminal and navigate to the folder containing the cloned repo.

  2. Move to the client directory

cd client
  1. Install all packages
npm install
  1. Run the front-end:
npm run dev

Screenshots of working project

image

image

image

image

image

image

image

image

image

image

vshealth's People

Contributors

shivpreet16 avatar

Watchers

 avatar

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.