Giter Club home page Giter Club logo

spring-cloud-demo's Introduction

Spring Docker Expo Mish Mash

This is my play around repo to test ideas out for my RL stuff and to provide references for my StackOverflow questions and answers . Don't expect anything to work here as it's pretty random and chaotic with ideas switching left and right over time.

This complements my other project docker-swarm-aws-terraform-module

Components

  • gateway the gateway

  • jwks-provider generates JWKS and puts them into Redis. There is only a single instance of this. This is implemented as a typical Spring Boot web application rather than WebFlux to make the implementation simpler at the expense of performance which is not needed as it is just a background process providing data.

  • sample-service this is a sample service endpoint that exposes HTTP, SSE, and WebSocket endpoints. This is exposed via discovery.

  • grpc-service this is a sample service endpoint that is GRPC directly. This is exposed via discovery.

  • acme this uses acme4j to provide the LetsEncrypt certificates into Redis. It also handles the token endpoint and gateway routes to this directly, it is not exposed via discovery. LATER

  • redirect this is a service that redirects GET requests to a different URL. Primarily used to redirect from HTTP to HTTPS

  • expo-app is a React Native app that would be used to communicate with the gateway and perform authentication. I would rather have nativescript but this was easier to deal with for now due to Expo Go.

  • react-app is a React app that would be used to communicate with the gateway and perform authentication. This was chose in place of my prefered platform which is VueJS in order to handle a bit more code reuse for now. I may add vue-app later. I also chose CRA rather than next.js for the time being to allow me to work fully off the browser for now.

Opening in IntelliJ

./gradlew openidea

Auth testing

curl --header 'Content-Type: application/json' --data-raw '{"authenticated": false, "username":"bad"}' http://localhost:28082/auth
curl --header 'Content-Type: application/json' --data-raw '{"authenticated": true, "username":"good"}' http://localhost:28082/auth
curl http://localhost:28082/whoami
curl --header 'Authorization: Bearer BEARER' http://localhost:28082/whoami

Coding conventions

  • Mono variables and parameters are suffixed with Mono
  • Flux variables and parameters are suffixed with Flux
  • functions that provide Mono or Flux start with provide and it neither ends with Mono nor Flux.
  • functions that are used in map or flatMap have the pattern mapXXXtoYYY

Load testing

The following command should run successfully with no errors.

artillery run -q --output report.json --environment localhost-direct-heavy-load gateway/src/test/artillery/happy-path.yml ; artillery report report.json && start report.json.html
artillery run -q --output report.json --environment localhost-direct-heavy-load gateway/src/test/artillery/happy-path-no-grpc.yml ; artillery report report.json && start report.json.html
artillery run gateway/src/test/artillery/functional-test.yml
artillery run -q --output report.json --environment localhost-direct-heavy-load gateway/src/test/artillery/functional-test.yml && artillery report report.json && start report.json.html
artillery run gateway/src/test/artillery/functional-test.yml
artillery run -q --output report.json --environment api-heavy-load gateway/src/test/artillery/functional-test.yml && artillery report report.json && start report.json.html
artillery run --environment localhost-traefik-ludicrous-load gateway/src/test/artillery/functional-test.yml
echo BASE_URL=https://api.trajano.net > .env
rm -rf node_modules/ */node_modules/ yarn.lock */yarn.lock

spring-cloud-demo's People

Contributors

trajano avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.