A doctor appointment app
- Introduction
- Features
- Technologies
- Installation
- Environment Variables
- Run server and client
- API Endpoints
- Screenshots
- License
This is a doctor appointment app that allows users to book an appointment with a doctor. It also allows doctors to manage their appointments. It is built with Nodejs, Express, MongoDB and React. It is a monolithic application. The frontend is built with React and the backend is built with Nodejs and Express. The database used is MongoDB.
-
Users
- Users can sign up.
- Users can sign in.
- Users can book an appointment with a doctor.
- Users can view their appointments.
- Users can apply for a doctor position.
-
Doctors
- Doctors can sign in.
- Doctors can view their appointments.
- Doctors can also book an appointment with another doctor.
- Doctors can view their appointments.
- Doctors can view their patients.
- Doctors can view their profile.
- Doctors can generate a pdf of their appointments.
-
Admin
- Admin can sign in.
- Admin can view all appointments.
- Admin can view all users.
- Admin can view all doctors.
- Admin can accept/recect doctors account request.
- Admin can view and add/edit all departments.
- Nodejs
- MongoDB account
- Cloudinary account
git clone https://github.com/b-l-i-n-d/docapp.git
cd docapp
Client
cd client
npm install
Server
cd server
npm install
Create a .env file in the server directory and add the environment variables from environment variables section
cd server
npm run seed
Follow the steps in Run server and client section
Create a .env file in the client directory and add the following
#Theme
VITE_THEME_LIGHT='light'
VITE_THEME_DARK='dark'
#API URL
VITE_API_URL='<API URL><BACKEND URL PREFIX>' // e.g https://docapp-api.onrender.com/api/v1
#PAGE SIZE
VITE_PAGE_SIZE=10
VITE_NOTIFICATION_PAGE_SIZE=4
Create a .env file in the server directory and add the following
#DB
MONGODB_URI='<MONGODB URI>'
PORT=<PORT>
#CLIENT URL
CLIENT_URL='<CLIENT URL>'
#BACKEND URL PREFIX
BACKEND_URL_PREFIX='/api/v1'
#JWT
JWT_ACCESS_SECRET='<JWT ACCESS SECRET>'
JWT_REFRESH_SECRET='<JWT REFRESH SECRET>'
ACCESS_EXP='<ACCESS TOKEN EXPIRY>' // in seconds
REFRESH_EXP='<REFRESH TOKEN EXPIRY>' // in seconds
#cookies
COOKIE_ACCESS_NAME='<ACCESS TOKEN COOKIE NAME>' // e.g. access_token
COOKIE_REFRESH_NAME='<REFRESH TOKEN COOKIE NAME>' // e.g. refresh_token
#cloudinary
CLOUDINARY_CLOUD_NAME='<CLOUDINARY CLOUD NAME>'
CLOUDINARY_API_KEY='<CLOUDINARY API KEY>'
CLOUDINARY_API_SECRET='<CLOUDINARY API SECRET>'
#NodeMailer
APP_EMAIL='<APP EMAIL>' // used gmail as service you can use free ethereal email as smtp service
APP_PASSWORD='<APP PASSWORD>'
cd server
npm run start
or
cd server
yarn start
cd client
npm run dev
or
cd client
yarn dev
Route | Method | Description |
---|---|---|
/api/v1/users |
GET | All users |
/api/v1/users/signup |
POST | Sign up |
/api/v1/users/login |
POST | Log in |
/api/v1/users/logout |
GET | Log out |
/api/v1/users/verifyToken |
GET | Verify auth tokens |
/api/v1/users/requestPasswordReset |
POST | Request for password reset |
/api/v1/users/resetPassword |
PATCH | Reset password |
/api/v1/users/notifications |
GET | All notifications |
/api/v1/users/notifications/:id |
Patch | Edit Single notification |
/api/v1/users/notifications/:id |
Delete | Delete Single notification |
Route | Method | Description |
---|---|---|
/api/v1/doctors |
GET | All doctors |
/api/v1/doctors |
POST | Create new doctor |
/api/v1/doctors/approved |
GET | Approved doctor |
/api/v1/doctors/me |
GET | Logged user doctor info |
/api/v1/doctors/:id |
GET | Get doctor by doctor id |
/api/v1/doctors/:id |
PATCH | Edit doctor |
/api/v1/doctors/:id/update-status |
PATCH | Update doctor status by id (approve or reject) - only for admin |
Route | Method | Description |
---|---|---|
/api/v1/appointments |
GET | All appointments |
/api/v1/appointments |
POST | Create new appointment |
/api/v1/appointments/me |
GET | Logged user appointments |
Route | Method | Description |
---|---|---|
/api/v1/departments |
GET | All departments |
/api/v1/departments |
POST | Create new dept |
/api/v1/departments/:id |
GET | Get dept by id |
/api/v1/departments/:id |
PATCH | Edit dept by id |
/api/v1/departments/:id |
DELETE | Delete dept by id |
Route | Method | Description |
---|---|---|
/api/v1/districts |
GET | All districts |
/api/v1/districts/:id |
GET | Get district by id |
/api/v1/districts/:id |
PATCH | Edit district by id |
Route | Method | Description |
---|---|---|
/api/v1/workplaces |
GET | All workplaces |