Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laurosilveira/sify-flix-api
An API REST built with Spring boot, spring security about movies and series of spaceships
https://github.com/laurosilveira/sify-flix-api
basic-authentication flyway openapi3 spring-aspects spring-boot spring-security
Last synced: 19 days ago
JSON representation
An API REST built with Spring boot, spring security about movies and series of spaceships
- Host: GitHub
- URL: https://github.com/laurosilveira/sify-flix-api
- Owner: LauroSilveira
- Created: 2024-02-21T16:14:56.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-06-24T07:48:00.000Z (5 months ago)
- Last Synced: 2024-10-06T02:01:53.030Z (about 1 month ago)
- Topics: basic-authentication, flyway, openapi3, spring-aspects, spring-boot, spring-security
- Language: Java
- Homepage:
- Size: 149 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sify-flix-api
## About this project
* [About](#about)
* [Architecture](#Architecture)
* [Technologies](#Technologies)
* [Swagger Documentation](#Swagger-documentation)
* [Security](#Security)
* [How to run](#how-to-run)
* [Run with Docker](#run-with-docker-compose)
* [Run with mvn spring-boot:run](#run-with-mvn-spring-boot)
* [how to run Test](#run-tests)
* [Contributors](#contributors)# About
This is a Rest API developed based on the requirements given for the selection process by the company W2M.
This API was built with Java 21, Spring Boot, H2 Database, Flyway Migration, Spring Doc OpenAPI, Docker and Docker-compose.# Architecture
The application is built following the **MVC** design pattern.
Each of the components will be described below:
* **View**: contains response from the Rest controller that will be shown in JSON format to the client.
* **Rest Controller**: responsible for receiving calls and directing them to the correct service.
* **Service**: a design pattern layer responsible for calling the service from the repository layer.
* **Repository**: this layer is responsible for connecting to the database and for persisting, retrieving, updating and deleting data.# Technologies
- Java 21
- Spring Boot 3.2.2
- Spring Security - Basic Authentication
- Spring OpenAPI
- H2 Database
- Flyway Migration
- Docker
- Docker-compose
- AssertJ, Mockito# Swagger Documentation
The documentation is generated by Spring Openapi. Once you have started the application the url: ```http://localhost:8080/swagger-ui.html```
![space-ship-rescontroller.png](data/space-ship-restcontroller.png)
# Security
This API is protected with Spring Security using basic authorization.
This API is configured to not save sessions.
Once you have accessed Swagger, simply authenticate with your username and password.
Notes: Basic authorization mode is **not recommended**, as it is not the most secure.
When starting the application, a user ```user: admin password:1234``` with the admin role will already be available.# How to Run
There two options to run this application, run by docker-compose or run as spring-boot.### Run with docker-compose
Make sure you have **Docker** installed and execute the command.```
docker-compose up
```
### Run with mvn spring-boot
```shell
mvn spring-boot:run
```# Run tests
This application has unity tests and integration tests, once it use Maven just run:
```
mvn test
```## Contributors
[@LauroSilveira](https://github.com/LauroSilveira)