To use the program, simply register, informing common data such as name, CPF (for the health professional, the CRM number for example), they will be able to see their own appointments, change their dates and times, change professionals or even cancel an appointment.
The packages were structured following the MVC (Model, View and Controller) Standard. i created and deployed a REST (REpresentational State Transfer) API using SpringBoot and Postgres, applying JPA (Java Persistence API) and Hibernate (an object/relational mapping tool for Java environments).
The REST layer - where i implemented business logic - and the service layer, has the power to access the data layer and the repositories. The services and repositories are the ones that communicate with the application's domain classe.
- To run the project properly, some development tools must be installed. Java JDK, Spring tools Suite and Maven must be installed and the environment variable defined.
- To install Java JDK
- Download JDK here
- Install the JDK exe File
- Check the Directory
C:\Program Files\Java\jdk-xxx
if exists folder jdk;
- To install Maven (it will compile the application)
- Download Maven here ;
- Unzip file;
- Create a folder named maven in
C:\
; - Press the Windows key on the keyboard and type: "edit system variables". Click on the option that appears.
- In the "Environment Variables" screen that will open, click the "New" button just below the part of the screen that says "environment Variables".
- In the variable name and value fields, fill in:
MAVEN_HOME
andC:\maven\bin
, respectively. Press "Confirm" button. - Check if it worked by opening a new prompt and typing
mvn -version
. If it worked, an error will appears.
- To install Eclipse
- Download Eclipse here
- Make a project copy to your machine:
first:
git clone git@git.senior.com.br:treinamento/go-dev-2023-spring.git
after cloning repository, enter the project folder and change for my branch in gitbash or cmd:git pull origin filipe-albuquerque
- Import the project into your Eclipse.
- File -> Import -> Maven -> Existing Maven Projects -> Next -> Browse -> Select Past of Project -> Finish
- A change to the application.properties file is required.
- It is necessary to define your bank address, username and password.
- The file will look like this:
spring.datasource.url=jdbc:postgresql://localhost:5432/clinic spring.datasource.username=postgres spring.datasource.password=root
To run the project, a database called
clinic
should be created. Spring is responsible for creating the tables.
- To create the database, open postgres. If you don't have it, install here.
- To create a schema.
- Create a schema
clinic
. if you type wrong spring will not recognize the database.
Postman was the software we choose to test the application requests. It can be accessed on the browser or be downloaded here..
here postman requests.
to import the postman requests, come:
import -> upload -> select the requestsClinic
file that is in the requestsClinic
folder in the project.
Unit tests performed using the Mockito java library, all CRUD following the unit test pattern.
Tests are located at:
(src / test / java).
can be used with the JUnit library.
Filipe Albuquerque |