https://github.com/bhattjayd/jaybhatt_nodejstask
https://github.com/bhattjayd/jaybhatt_nodejstask
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bhattjayd/jaybhatt_nodejstask
- Owner: BhattJayD
- Created: 2021-04-27T15:04:17.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-10T14:39:06.000Z (over 4 years ago)
- Last Synced: 2025-05-29T17:27:12.159Z (4 months ago)
- Language: JavaScript
- Size: 9.06 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JayBhatt_NodejsTask
## psychiatrists & patients portal
We have a platform where psychiatrists can register their patients through a mobile/ web portal.Each psychiatrist belongs to a hospital.## framework used in this portal
@hapi/joi: This module is used for backend validation of regristration
dotenv: This module used for storing Database credential
express: this is a web framework used to create an HTTP server and endpoints
multer: this module use for storing image
mysql: this mysql module use to access and perform CRUD operations on mysql database## How to run tests and deploy the project
download repository and run
``` npm install ```
###### to start
```` node server```
## perdorm CRUD
###### register Patient
in postman **http://localhost:3000/api/register** fire this url in **POST** method
and pass data in **form-data**
data of Patient will be
```
Id
Name
Address
PhoneNumber
Password
P_ID
image
```
##### update Patient
in postman **http://localhost:3000/api/update** fire this url in **POST** method
and pass data in JSON form
updation of Patient will be
```
{
"ID":526,
"Name":"dajkfhskjdfgasd",
"Address":"aaaaaaaaa",
"Email":"aaaaaaaaa",
"PhoneNumber":123456789555,
"Password":"passwdffgg",
"P_ID":1
}
```
##### Fetching all the patients in an order for a single psychiatrist (without photos).
in postman **http://localhost:3000/Paychiatrist/show** fire this url in **POST** method
and pass data in JSON form
JSON body will be
```
{
"P_ID":50
}
```
this will show all the Patient of psychiatrist##### Fetch the count of how many patients are registered for each psychiatrist in a hospital.This should return, hospital name, psychiatrist name, patients count.
in postman **http://localhost:3000/api/count** fire this url in **GET** method
this will fetch hospital name, psychiatrist name, patients count of psychiatrist