Project developed for apply concepts and experiences using microservice architecture based on simplified investment business rules of B3 (Brazilian Investment exchange)
B3Invest Config Server
Module responsible to centralize the configuration access (this configurations are public because the project is used just to study)
B3Invest Eureka Server
Module responsible to cloud server and service discover
Default Port: 8761
B3Invest Gateway Zuul
Module responsible to manager the request using intelligent routing. When arrive a requisition from the client the gateway zuul will send to correct microservice
Default port: 8765
B3Invest Broker
Module represents the investment broker when the client has access and can view the B3 tickets and the respective values
B3Invest Manager
Module that simulate the B3 Project, when the tickets are registers and controllers by the Brazilian investments
B3Invest User
Module responsible from the user registers
B3Invest Oauth
Security module responsible to control the access from all the systems according to authentication and authorizations users rulers
- Spring Boot: Spring Boot makes it easy to create stand-alone, production-grade Spring based 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 Behaviour Driven Development-BDD test
- Lombok: Annotations helper library
- H2: A very 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 others 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 in 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
- ✔️