Skip to content

Latest commit

 

History

History
529 lines (348 loc) · 10.9 KB

README-en.md

File metadata and controls

529 lines (348 loc) · 10.9 KB

Estribado Broker

Não fala inglês? Clique aqui para ver está página em português

Turning starry-eyed investors into masters of the financial market

Table of Contents

Description

A Mandacaru Broker API é uma aplicação Spring Boot que fornece operações CRUD (Create, Read, Update, Delete) para gerenciar informações sobre ações (stocks).

What is a Home Broker?

A Home Broker is an online platform that allows investors to buy and sell financial assets, such as stocks, options, government bonds, among others, directly over the internet. Through it, investors can access real-time market information, analyze charts, execute buy and sell orders, monitor their investment portfolios, among other features, all online.

If you want to learn more about Home Broker and how it works, visit the B3 (Brazilian stock exchange) : How to operate with Homebroker

Developers

The project was developed in collaboration by the following developers:


Ingrid Lima

Wesley Maciel

João Paulo

Moisés Oliveira

Resources

System login

Logs into the system.

Endpoint:

POST /auth/login

Responses:

200: Successful login
400: Invalid credentials
401: User not registered

System registration

Registers in the system.

Endpoint:

POST /auth/register

Responses:

200: Successful registration
409: User already registered

Delete system registration

Deletes the registration in the system.

Endpoint:

DELETE /auth/{id}

Responses:

200: Successful deletion

Get all Exchange Traded Funds

Returns all available Exchange Traded Funds.

Endpoint:

GET /etf

Get a specific Exchange Traded Fund

Returns details of a specific Exchange Traded Fund based on the provided ID.

Endpoint:

GET /etf/{id}

Register an Exchange Traded Fund

Registers a new Exchange Traded Fund based on the provided data.

Endpoint:

POST /etf/register

Update an Exchange Traded Fund

Updates details of a specific Exchange Traded Fund based on the provided ID.

Endpoint:

PUT /etf/{id}

Delete an Exchange Traded Fund

Deletes a specific Exchange Traded Fund based on the provided ID.

Endpoint:

DELETE /etf/{id}

List all investments

Returns a list of all available types of investments.

Endpoint:

GET /assets

Register a new investment

Creates a new investment based on the provided data.

Endpoint:

POST /assets/register

Responses:

200: Successful registration

Delete an investment

Deletes a specific investment based on the provided ID.

Endpoint:

DELETE /assets/{id}

Responses:

200: Successful deletion

List all real estate funds

Retrieve all registered real estate funds.

Endpoint:

GET /ref

Get a specific real estate fund

Retrieve details of a specific real estate fund based on ID.

Endpoint:

GET /ref/{id}

Register a new real estate fund

Register a new real estate fund based on the provided data.

Endpoint:

POST /ref/register

Update a specific real estate fund

Update details of a specific real estate fund based on ID.

Endpoint:

PUT /ref/{id}

Delete a specific real estate fund

Delete a specific real estate fund based on ID.

Endpoint:

DELETE /ref/{id}

Responses:

200: Successful deletion

Get all registers

Returns an array of objects with all records in the table.

Endpoint:

GET /stocks

Get register

Returns the specified record object.

Endpoint:

GET /stocks/{id}

Create register

Returns the object with the sent data.

Endpoint:

POST /stocks

Request Body:

{
  "symbol": "BBAS3",
  "companyName": "Banco do Brasil SA",
  "price": 56.97
}

Update register

Returns the object with the sent data

Endpoint:

PUT /stocks/{id}

Request Body:

{
  "symbol": "BBAS3",
  "companyName": "Banco do Brasil SA",
  "price": 56.97
}

Delete register

No return.

Endpoint:

DELETE /stocks/{id}

List all assets

Get all assets.

Endpoint:

GET /treasury

Get a specific asset

Get details of a specific asset based on the ID.

Endpoint:

GET /treasury/{id}

Register an asset

Register a new asset based on the provided data.

Endpoint:

POST /treasury/register

Update an asset

Update details of a specific asset based on the ID.

Endpoint:

PUT /treasury

Delete an asset

Delete a specific asset based on the ID.

Endpoint:

DELETE /treasury/{id}

User system login

Logs in a user based on the provided information.

Endpoint:

POST /user/login

Responses:

200: Successful login
400: User not registered
401: Invalid credentials

User System Registration

Registers a new user based on the provided information.

Endpoint:

POST /user/register

Responses:

200: Successful registration
409: Username already in use

Update user in the system

Updates the information of a specific user based on the provided ID.

Endpoint:

PUT /user/{id}

Responses:

200: Successful update
404: User not found

Delete user in the system

Deletes a specific user based on the provided ID.

Endpoint:

DELETE /user/{id}

Responses:

200: Successful deletion
404: User not found

Postman Collection

The following collection includes all configured routes, along with their corresponding API tests already implemented.

Download link

Swagger

Swagger is an open-source tool that enables clear and interactive documentation of APIs. This interface simplifies understanding and integration with the Mandacaru Broker API.

http://localhost:8080/swagger-ui/index.html#/

Testing

This repository has undergone static analysis using Checkstyle, SonarQube, and SonarLint tools. Additionally, it has unit test cases organized by classes, as well as an integration test that verifies the CRUD operations of the API.

Step-by-Step Environment Setup

  1. Clone the repository: git clone /~https://github.com/I-Lima/Mandacaru-Broker-API.git

  2. Import the project into your preferred IDE.

  3. To run the database in Docker, use the following command:

    docker-compose up -d
  4. Run the Spring Boot application.

  5. Access the API at http://localhost:8080.

Requirements

  • Java 11 or higher
  • Maven
  • Banco de dados
  • Docker

Technologies Used

  • Spring Boot
  • Spring Data JPA
  • Maven
  • JUnit
  • Mockito
  • JaCoCo
  • Checkstyle
  • SonarQube
  • SonarLint
  • PostgresSQL
  • Docker
  • Docker Compose

Contributions

Contributions are welcome!

License

This project is licensed under the MIT License.