This project contains a web information management application to store, manage and present information about diseases of patients. It has report management system inside to manage diagnostic and pathologic reports. It includes a spring rest service and react web ui client.
- Java 17
- Maven 3.8 (probably higher than 3.0 versions will work)
- Docker Compose or Docker Desktop
- ( compose 2.24, desktop 4.27 have bug that
changes out of order
. If you are encountering with this error update the docker)
- ( compose 2.24, desktop 4.27 have bug that
- 3000, 3307, 8080 ports must be available. If it isn't change the host ports with available one inside
./docker-compose.yml
-
Clone the repo
git clone https://github.com/kerimsenturk5734/lab-report
-
Build the project with maven in root location
mvn clean install
-
Be sure that Docker Engine is running.
-
Run following code in root location. It will take a while installing dependencies, please be patient.
docker compose up
-
After installation, you can check if the container is running by running below command in new terminal;
docker ps
-
Open the browser and locate to
localhost:3000
(If you changed the default port, use updated port instead of 3000)
- Entity Models
- Report Folder Structure
You can access the API documentation at http://localhost:8080/swagger-ui/index.html
.
If you can't see the endpoints when you access the Swagger page, make sure that you typed /v3/api-docs
in the search bar and click explore button.
We have an authorization mechanism on api. So different user types can perform different actions. We have four user types called ADMIN
, PATIENT
, LAB_TECHNICIAN
and DOCTOR
. If you want to access all endpoints you must log in as an ADMIN
user.
Here there are some example users, you can use them to test api;
- User Type - UserId - Password
- ADMIN - 4561234 - A12345678b
- DOCTOR - 1234567 - A12345678b
- LAB_TECHNICIAN - 1234568 - A12345678b
- PATIENT - 98765432109 - A12345678b
- (Note that not every user can access all endpoints)
Follow the below instructions to login and test endpoints;
-
Select a user from above
-
Go to
v1/api/users/login
endpoint -
Enter the userId and password as sampled on swagger
-
Execute the endpoint
-
You will get a response as sampled below
-
Copy the key from response and paste to Authorize tab at top section of page
-
If you want to use the JWT token key as Auhorization header, add 'Bearer' at starting;
Authorization
:Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOi
-
Now you are ready to test endpoints.