This project is a Jakarta EE application developed with Spring Data JPA for data persistence, Lombok to reduce boilerplate code, and Spring MVC for creating RESTful APIs. It is configured to run with Java 21 on port 8083. Essentially, this project aims to integrate with payment gateways to generate invoices in an easier and more efficient way.
- Controller: Contains the API endpoints.
- Service: Implements the business logic of the application.
- Repository: Interface for database communication.
- Model: Contains the database entities.
- Java 21
- Maven 3.6+
- MySql Database
-
Clone the repository:
git clone https://github.com/GabrielRochaFC/MentoriaRasmoo-IntegraNotaFiscal.git
-
Navigate to the project directory:
cd IntegraNf
-
Compile the project using Maven:
mvn clean install
-
Run the application:
java -jar target/IntegraNf-0.0.1-SNAPSHOT.jar
Make sure to configure the database information in src/main/resources/application.properties
as needed:
server.port=${SERVER_PORT}
spring.datasource.url=${SPRING_DATASOURCE_URL}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD}
The application provides various endpoints, detailed below. The context path is /integranf
.
-
POST
/auth/login
: User authentication.- Request Body:
{"email": "user@example.com", "password": "password"}
- Response:
{"token": "jwt_token"}
- Request Body:
-
POST
/auth/register
: Register new users.- Request Body:
{"email": "user@example.com", "password": "password", ...}
- Response:
{"id": 1, "email": "user@example.com", ...}
- Request Body:
-
GET
/user
: Lists all paginated users.- Query Params:
page
,size
- Response:
[{"id": 1, "name": "John Doe", ...}, ...]
- Query Params:
-
PATCH
/user/{id}
: Updates user information.- Path Param:
id
(User ID) - Request Body:
{"name": "New Name", ...}
- Response:
{"id": 1, "name": "New Name", ...}
- Path Param:
- GET
/user-type
: Lists all user types.- Response:
[{"id": 1, "type": "Admin", ...}, ...]
- Response:
-
POST
/subscription-type
: Creates a new subscription type.- Request Body:
{"type": "Premium", "duration": 12, ...}
- Response:
{"id": 1, "type": "Premium", ...}
- Request Body:
-
GET
/subscription-type
: Lists all paginated subscription types.- Query Params:
page
,size
,enabled
- Response:
[{"id": 1, "type": "Premium", ...}, ...]
- Query Params:
- POST
/subscriptions/select
: Assigns a subscription to an authenticated user.- Request Body:
{"subscriptionTypeId": 1, ...}
- Response:
{"id": 1, "userId": 1, "subscriptionTypeId": 1, ...}
- Request Body:
-
POST
/gateway
: Creates a new gateway.- Request Body:
{"name": "Gateway1", ...}
- Response:
{"id": 1, "name": "Gateway1", ...}
- Request Body:
-
GET
/gateway
: Lists all gateways.- Response:
[{"id": 1, "name": "Gateway1", ...}, ...]
- Response:
-
POST
/gateway/integrations
: Registers a user integration with a gateway.- Request Body:
{"userId": 1, "gatewayId": 1, ...}
- Response:
{"id": 1, "userId": 1, "gatewayId": 1, ...}
- Request Body:
-
GET
/gateway/integrations
: Lists all user integrations with gateways, paginated.- Query Params:
page
,size
- Response:
[{"id": 1, "userId": 1, "gatewayId": 1, ...}, ...]
- Query Params:
This project was developed during the Mentoria Start by Rasmoo. Learn more at Rasmoo.
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature/new-feature
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/new-feature
). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- LinkedIn: Gabriel Rocha
Made with ❤️ by Gabriel Rocha