Fullstack Application Written Assignment
The technology stack for the project is listed below
Unit Tests are present in testing
branch
API Reference for User
Post /signin
Validates email and password of user and returns access and refresh tokens
Body | Type | Description |
---|---|---|
email |
string |
Required. User Email |
password |
string |
Required. User Password |
GET /signup
Creates new user
Body | Type | Description |
---|---|---|
name |
string |
Required. Name of User |
email |
string |
Required. Email of User |
password |
string |
Required. Password of User |
confirmPassword |
string |
Required. Confirm Password of User |
Delete /signout
Clears refresh token from database and browser cookie
Header | Type | Description |
---|---|---|
authorization |
string |
Required. Bearer Token of User (Access Token) |
Post /refresh
Generates new Access Token
Header | Type | Description |
---|---|---|
authorization |
string |
Required. Bearer Token of User (Refresh Token) |
API Reference for Practitioner
Get /practitioner?page=1&limit=10
Gets all Practitioners with pagination
Header | Type | Description |
---|---|---|
authorization |
string |
Required. Access Token of User |
query | Type | Description |
---|---|---|
limit |
number |
Optional. Limit for Data in One Page |
page |
number |
Optional. Page Number |
Get /practitioner/{practitioner_id}
Gets all Practitioners with pagination
Header | Type | Description |
---|---|---|
authorization |
string |
Required. Access Token of User |
Parameters | Type | Description |
---|---|---|
practitioner_id |
number |
Required. Practitioner Id |
Post /practitioner
Creates New Practitioner
Header | Type | Description |
---|---|---|
authorization |
string |
Required. Access Token of User |
Body | Type | Description |
---|---|---|
fullname |
string |
Required. Name of Practitioner |
email |
string |
Required. Email of Practitioner |
contact |
string |
Required. Contact of Practitioner |
dob |
DateTime |
Required. Date of Birth of Practitioner |
address |
string |
Required. Address of Practitioner |
image |
File |
Required. Display Picture of Practitioner |
icuSpecialist |
boolean |
Optional. Yes if Practitioner is ICU Specialist |
startTime |
DateTime |
Required. Start time for Practitioner |
endTime |
DateTime |
Required. End time for Practitioner |
WorkingDays |
Array |
Required. Array of Working Day of Practitioner (id and name) |
Specializations |
Array |
Required. Array of Specialization of Practitioner (id and name) |
Put /practitioner/{practitioner_id}
Updates Existing Practitioner
Header | Type | Description |
---|---|---|
authorization |
string |
Required. Access Token of User |
Parameters | Type | Description |
---|---|---|
practitioner_id |
number |
Required. Practitioner Id |
Body | Type | Description |
---|---|---|
fullname |
string |
Required. Name of Practitioner |
email |
string |
Required. Email of Practitioner |
contact |
string |
Required. Contact of Practitioner |
dob |
DateTime |
Required. Date of Birth of Practitioner |
address |
string |
Required. Address of Practitioner |
image |
File |
Required. Display Picture of Practitioner |
icuSpecialist |
boolean |
Optional. True or False for depending on Practitioner |
startTime |
DateTime |
Required. Start time for Practitioner |
endTime |
DateTime |
Required. End time for Practitioner |
WorkingDays |
Array |
Required. Array of Working Day of Practitioner (id and name) |
Specializations |
Array |
Required. Array of Specialization of Practitioner (id and name) |
Delete /patient/{practitioner_id}
Deletes Existing Practitioner
Header | Type | Description |
---|---|---|
authorization |
string |
Required. Access Token of User |
Parameters | Type | Description |
---|---|---|
practitioner_id |
number |
Required. Practitioner Id |
- Clone the repository
mkdir assignment-project
cd assignment-project
git clone https://github.com/suparthghimire/lf-practitioner-management-system.git
-
Setup Environment Variables based on .env.example of server and client
-
Setuyp Database
-
Seed Data
yarn prisma db seed
docker compose up --build --detach
If ports aren't mapped correctly, change mapping in docker-compose.yml file
Default Server Port = 7000
Default Client Port = 7002
cd server
- Install Dependencies
yarn
-
Setup Environment Variables based on .env.example
-
Initialize Prisma
yarn prisma init
- Run Migration
yarn prisma migrate dev --name InitialMigration
- Generate Prisma Client (Optional)
yarn prisma generate
- Seed Data
yarn prisma db seed
cd client
- Install Dependencies
yarn
- Start the Development server
Client
cd client
yarn dev
Server
cd server
yarn dev
Client
cd client
- Build the project
yarn build
- Start
yarn start
Server
cd server
- Build the project
yarn build
- Start
yarn start
- Run Tests Without Logs
yarn test
- Run Tests With Logs
yarn test:log
- Run Tests with Coverage
yarn test:coverage