The project was developed to apply concepts and experiences using a microservice architecture based on simplified investment business rules of B3 (Brazilian Investment Exchange).
The module is responsible for centralizing the configuration access (these configurations are public because the project is used just to study).
The module is responsible for the cloud server and service discovery.
Default Port: 8761
The module is responsible for managing the request using intelligent routing when a requisition from the client Gateway Zuul is send it to the correct microservice.
Default port: 8765
The module represents the investment broker when the client has access and can view the B3 tickets and the respective values.
The module that simulates the B3 Project, when the tickets are registered and controllers by the Brazilian investments.
The module is responsible for the user registers.
The security module is responsible for controlling access from all the systems according to authentication and authorization of the user's rulers.
- Spring Boot: Spring Boot makes it easy to create stand-alone, production-grade Spring Applications that you can "just run"
- Spring Cloud: providing both authentication and authorization
- Feign: for external server communications
- Netflix Zuul: Intelligent Routing
- Netflix Ribbon: Client-side IPC library
- Eureka: Cloud server and service discovery
- Hystrix: fault tolerance e timeout
- Spring Security: providing authentication and authorization security
- oauth2: oauth2 authentication bearer JWT token system
- JUnit: Unit Test
- Spock: A wonderful Groovy framework for behavior-driven Development-BDD test
- Lombok: Annotations helper library
- H2: A fast database embedded for tests
- Redis: A open source in-memory data structure store used as a database and cache
- Swagger: Swagger open source and pro tools have helped millions of API developers, teams, and organizations deliver great APIs.
- Docker: The most famous container engine used to execute the B3Invest project with their external dependencies
- Run Config Server
- Run Eureka Server
- Run gateway Zuul
- Run other projects
https://redislabs.com/get-started-with-redis/#Option-C Docker image available on docker-compose file
Coomand: docker-compose up -d
- The generated swagger HTML page is available at the following address
http://localhost:8080/swagger-ui/index.html
docker network create b3invest-network
mvnw clean package -DskipTests
docker build -t b3invest-configserver:v1 .
docker run -p 8888:8888 --name b3invest-configserver --network b3invest-network -e GITHUB_USER=rafacancian -e GITHUB_PASS=? b3invest-configserver:v1
mvnw clean package -DskipTests
docker build -t b3invest-eurekaserver:v1 .
docker run -p 8761:8761 --name b3invest-eurekaserver --network b3invest-network b3invest-eurekaserver:v1
mvnw clean package -DskipTests
docker build -t b3invest-gatewayzuul:v1 .
docker run -p 8765:8765 --name b3invest-gatewayzuul --network b3invest-network b3invest-gatewayzuul:v1
docker logs -f <container-id>
docker run -p <external-port>:<internal-port> --name <container-name> --network <network-name> <image-name:tag>
Script used to test CORS
fetch("http://localhost:8765/b3invest-broker/ticket", {
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9,pt-BR;q=0.8,pt;q=0.7",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site"
},
"referrer": "http://localhost:3000",
"referrerPolicy": "no-referrer-when-downgrade",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "omit"
});
- ✔️
Fix gateway communication with oauth to generate JWT Token - ✔️
B3Invest-Manager- ✔️
Swagger - ✔️
Hateoas - ✔️
Pagination - ✔️
Redis
- ✔️
- ✔️
B3Invest-Broker- ✔️
Swagger - ✔️
Hateoas - ✔️
Pagination
- ✔️
- ☑️ B3Invest-User
- ✔️
Swagger - ☑️ Unit Tests
- ✔️
- ✔️
Docker Projects- ✔️
ConfigServer - ✔️
GatewayZuul - ✔️
EurekaServer - ✔️
Oauth - ✔️
User - ✔️
Manager - ✔️
Broker - ✔️
Redis
- ✔️