Skip to content

ev1illyn/forum-spring-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forum-spring-rest-api

A simple REST API with Spring Framework

[x] End-points, HTTP methods

[x] Spring Data JPA

[x] Bean Validation

[x] Cache

[x] API security

[x] Monitoring

[x] Profiles

[x] Tests

[x] Deploy (via Docker and Heroku)

Demo

Authorization

At first, you have to input your email and password to receive your token, so you can make some priviliged requests!! authorization

An example of a privileged request: authorization-example

In case you don't have a privileged access, you'll see the following message:

status-403-forbidden

Topics

The forum topics have pagination and cache settings forum-topics

List a specific topic

specific-topic

Insert topic

insert-topic

Update topic

update-topic

Remove topic

remove-topic

How to run the project (Docker)

Clone the project

$ git clone https://github.com/ev1illyn/forum-spring-rest-api.git

Make sure you have Maven installed and run the following command at the project directory:

/forum-spring-rest-api$ mvn -DskipTests=true clean package

Run the docker command to build a image from the Dockerfile inside the project:

/forum-spring-rest-api$ sudo docker build -t img-alura/forum .

Check if the "img-alura/forum" image was created:

/forum-spring-rest-api$ sudo docker images

Run the following docker command to start the project:

/forum-spring-rest-api$ sudo docker run -d -p 8080:8080 -e SPRING_PROFILES_ACTIVE=prod -e FORUM_DATABASE_URL=jdbc:h2:mem:alura-forum -e FORUM_DATABASE_USERNAME=sa -e FORUM_DATABASE_PASSWORD= -e FORUM_JWT_SECRET=123456 img-alura/forum

Access the following url:

http://localhost:8080/topicos

Reference Documentation

For further reference, please consider the following sections:

Guides

The following guides illustrate how to use some features concretely:

Releases

No releases published

Packages

No packages published