Git Product home page Git Product logo

adidas-coding-challenge's Introduction

Adidas Coding Challenge

Application Architecture

Consumer Consents Architecture

  • The AWS Global Accelerator will be responsible to expose the Application Load Balancers to the internet. Its use has the following benefits:

    1. The user traffic is directed to the nearest application endpoint to the client, thus reducing internet latency and jitter;
    2. Improves application availability by continuously monitoring the health of application endpoints and routing traffic to the closest healthy endpoints;
    3. Eliminates the complexity of managing specific IP addresses for different AWS Regions.
  • The three Kubernetes clusters control planes are visible to the internet. This allows running commands against these clusters through the kubectl tool.

  • Each Kubernetes cluster will get the container images from an Amazon Container Registry (ECR) located in the same region.

  • For the database, there will be a primary DB Instance that synchronously replicates the data to a standby instance in a different Availability Zone (AZ). Each AZ runs on its own physically distinct, independent infrastructure, and is engineered to be highly reliable.

Application usual flow

Sequence Diagram

How to build

  1. Make sure you have JDK 11+ and Maven installed.

  2. Go to the Implementation/ConsumerConsentsApp/src/main/resources/ directory and locate the file according to the profile you want to build (e.g. application-dev.yaml) and setup the following properties:

    1. app.gdpr-controller-established-in-the-eu: set to true if the underlying company is established in the EU (according to GDPR) or false otherwise. This information will be important to decide if users must be required to give consent to process your personal data.
    2. spring.security.user: set the initial user name and password for the system administrator. It is highly recommended to change this password as soon as the application is running (P.S.: this feature is not yet implemented).
  3. Open your command shell and navigate to the Implementation/ConsumerConsentsApp directory.

  4. Run the following command:

    mvn clean package
  5. That is it. Your package will be located at /ConsumerConsentsApp/target/consumer-consents-app.jar.

Running the application locally

  1. Setup the database access information changing the following environment variables:

    1. CONSUMER_CONSENTS_APP_DB_URL: the database url (e.g. jdbc:postgresql://postgresql.cwrl1ifz9wlk.us-east-1.rds.amazonaws.com/consumer_consents)
    2. CONSUMER_CONSENTS_APP_DB_USER_NAME: the database user name
    3. CONSUMER_CONSENTS_APP_DB_PASSWORD: the database password

    Please note that currently the application is only compatible with PostgreSQL.

  2. Open your command shell and navigate to the /ConsumerConsentsApp/target/ directory.

  3. Run the following command, choosing the desired profile:

    java -jar -Dspring.profiles.active=dev consumer-consents-app.jar
  4. After that you can open the URL http://localhost:8080/api/swagger-ui.html and start using the application API. Observe that most APIs needs authentication to work.

New version deployment

  1. Build the application following the steps on the How to build section;

  2. Build a container image with a new version tag and send it to the Amazon Container Registry (ECR) of each cluster region;

  3. Provision possible infrastructure changes by deploying the /Implementation/ConsumerConsentsInfrastructure.yaml CloudFormation file;

  4. Make a new kubernetes deployment in each region referencing this new container image using the kubectl tool.

Frameworks / Libraries used

Artifact Name Description
spring-boot-starter-security Spring Security Used for Authentication, authorization and cryptography.
spring-boot-starter-data-jpa Spring Data JPA Database access. Eases development of applications that need to access JPA data sources.
spring-boot-starter-actuator Spring Boot Actuator Brings production-ready features for monitoring application health. Through the HEALTHCHECK instruction, Docker can use the Actuator information to test a container to check that it is still working. This will enable the implementation of an autoscalng platform.
postgresql PostgreSQL Driver Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database.
geoip2 MaxMind GeoIP2 Gets the location of a user based on your IP address. The main advantage of this library is that it does not require internet access to get geographic location data.
springfox-swagger2 SpringFox Automated JSON API documentation for API's built with Spring.
springfox-swagger-ui SpringFox Swagger UI Swagger UI allows to visualize and interact with the API’s resources without having any of the implementation logic in place.

adidas-coding-challenge's People

Contributors

rosberglinhares avatar

Stargazers

 avatar

Watchers

 avatar

adidas-coding-challenge's Issues

Please Help Me on 1 thing

Hello Sir

I have seen the git repository for the adidas challenge of your and I got very much interest how you implemented the things there
You really have done a perfect deployment

Sir My concern is that I also want to learn end2end how you deploy the application using the AKS cluster as per the picture could you please provide me the steps you followed how you have done the things like How you deployed the application to the K8 cluster how you fetching the images into k8 cluster and How you connecting the application to the RDS database

Any help would be very much apricated

Thank
You );

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.