Skip to content

Springboot API that provides contexts and challenges in a collaborative database.

Notifications You must be signed in to change notification settings

a4s-ufpb/EducAPI

 
 

Repository files navigation

Educ API

Springboot API that provides contexts and challenges in a collaborative database.

GitHub Type Badge enter image description here GitHub tag (latest by date)

🛠 Tech Stack

To make this project run you will need to have the following items installed:

  • Docker and Docker Compose
  • Java 11 or OpenJDK 11
  • PostgreSQL 12.3 (it is recommended to use a Docker container)
  • Intellij or other IDE of your choice

This project also uses the following technologies:

  • Spring Boot - 2.2.7.RELEASE
  • JPA
  • Hibernate
  • H2 Database
  • Maven 4.0.0
  • Swagger 2.9.2
  • JUnit 4.12
  • JoCoCo Code Coverage
  • REST Assured

Note: Use Postman, Insomnia or another tool to test calls to API endpoints

🚀 Starting the project

You must open a terminal and clone this repository:

To clone this repository via HTTPS:

a4sufpb@a4sufpb:~$ git clone https://github.com/a4s-ufpb/EducAPI.git

⚙️ Configuring the project

Access the cloned repository through the IDE of your choice and change the spring.profiles.active variable in the EducAPI/src/main/resources/application.properties file to dev or test

You should be able to choose between dev, test and prod profiles on enviroment variables configurations of the API

Intellij:

Copy variables and values, paste to "Environment variables:" in configuration application(main) splitting by ";"

EDUCAPI_VERSION=1.0.5;PROFILE_ACTIVE=test;TOKEN_KEY=educapi-dev

VSCode:

1º Create a folder .vscode in the project's root directory, then create a file launch.json inside of it.

2º Open launch.json and add a field "env": below the last field line of "configurations":

NOTE: Format is <"variable": "value">

"env": { 
            "EDUCAPI_VERSION": "1.0.5",
            "PROFILE_ACTIVE": "dev",
            "TOKEN_KEY": "educapi-dev"}

You can also add or remove configs depending of the data base system of your choice.

PostgreSQL(dev):

EDUCAPI_VERSION=1.0.5
PROFILE_ACTIVE=dev
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=educapi
DB_URL=jdbc:postgresql://localhost:5432/${POSTGRES_DB}
TOKEN_KEY=educapi-dev

NOTE: Configure the environment variables above according to the PostgreSQL connection created on your machine.

NOTE: Remember to create a database with the name defined in the value of the POSTGRES_DB variable.

H2(test):

EDUCAPI_VERSION=1.0.5
PROFILE_ACTIVE=test
TOKEN_KEY=educapi-dev 

▶️ Running

If you are NOT going to run the project using Docker, download the dependencies needed to run the project by right-clicking on the EducAPI/pom.xml file.

To run the API locally on your machine, open a terminal at the root of the project and enter the following commands:

a4sufpb@a4sufpb:~$ export $(cat .env | xargs)
a4sufpb@a4sufpb:~$ ./mvnw spring-boot:run

Go to http://localhost:8080/to access the API.

If you are going to run the project USING Docker, just open a terminal at the root of the project and type:

a4sufpb@a4sufpb:~$ docker-compose up --build

To stop the project just close the terminal.

Go to http://localhost:8080/to access the API.

NOTE: Whenever you want to test any changes that werw made to the code, repeat the commands above to stop and start again.

Note: Pull requests should only be accepted if the project is able to build using Docker.

📕Documentation

The API in production at https://api.apps4society.dcx.ufpb.br/educapi/ and the documentation can be obtained at https://api.apps4society.dcx.ufpb.br/educapi/swagger-ui.html. In addition, you can acess the API documentation locally on your machine by accessing localhost:8080/swagger-ui.html.

To learn more about Spring boot, how to install and how to use it, access the documentation.

Also access the JUnit, JPA and Hibernate documentation.

📄 Licence

This project is licensed under the MIT License, see also LICENSE.md for more details.

👩‍💻👨‍💻 Contributors


Amanda Azevedo


Emerson Dantas


Francivaldo Napoleão


Marcos Ludgero


Robinson Mourão

Project coordinator


Ayla Dantas Rebouças


Carlos Hacks

🤝 How to contribute?

Please read CONTRIBUTING.md for more details regarding our content code and the process of submitting pull requests to us.

📫 Contact us

  • To learn more about the Apps4Society and SisAlfa project visit the websites Site Apps4Society Site Sisalfa
  • Follow the Apps4Society on Instagram Twitter URL
  • Contact us by email Gmail Badge Gmail Badge

About

Springboot API that provides contexts and challenges in a collaborative database.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Java 99.9%
  • Other 0.1%