GithubHelp home page GithubHelp logo

vitorsalgado / netsocks Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 120 KB

License: MIT License

Makefile 2.06% Java 89.85% JavaScript 0.48% Scala 7.60%
java api-testing docker docker-compose code-challenge

netsocks's Introduction

NetSocks

Build Status

Technical test for hiring process.
These projects where developed using different languages and platforms. Except for the Campaign Update Receiver, which uses Node.js, all projects uses Gradle as the build system.

Content

Requirements

  • Java 8;
  • Docker ( a version which already contains multi stage available );
  • Docker Compose;
  • Make.

Tech

  • Java 8;
  • Scala ( load and e2e tests );
  • Swagger documentation;
  • Mongodb as the database solution;
  • Redis;
  • Spring Boot;
  • RxJava;
  • Hystrix;
  • Log4j for logging;
  • WireMock for API stubbing test;
  • Gatling for load tests;
  • Rest Assured for API e2e tests;
  • Node.js for simple Redis channel subscriber;
  • Gradle.

Running

There's a makefile on project root which contains all commands to start, test and clean all projects. It's the easiest way to do all tasks To start all APIs with Mongodb and Redis instances, simple type on a console:

make

To clear all, run: make down

Refer to Projects section below for more details about each project.

Projects

Campaign API

The campaigns API was develop with Java and uses a simple N-tier design as it does not contains complex business rules.
There's no structure for Teams. Each campaign only contains a field, favoriteTeamId, which is a simple identifier.
Every time a campaign already registered changes, the API publishes it to a Redis channel. Hystrix is used to control failures on channel publish;
To run the API, navigate to repository root and type on a console:

make campaign-api
or
make campaign-api-docker

Default location: http://localhost:8080
Swagger: http://localhost:8080/swagger-ui.html


Associate Fan API

The stack is the same as the other api, but it is design in a reactive way with RxJava.
I wanted to test this implementation approach with RxJava in a Rest API.
To run the API, navigate to repository root and type on a console:

make fan-api
or
make fan-api-docker

Default location: http://localhost:8081
Swagger: http://localhost:8081/swagger-ui.html


Stream

To run the stream test, go to repository root and type on a console:

make stream input=YOUR_INPUT_HERE
or
make stream-docker input=YOUR_INPUT_HERE

Load Tests

The load tests uses Gatling and are written in Scala.
They attempt to simulate more than 100 users using the APIs.
To run the tests, first you need to start all APIs:

# start apis first!
make

# to run campaign load tests
make load-tests-campaign

# to run support fan load tests
make load-tests-fan

Unit Tests

To run all unit tests of all projects with docker compose:

make test

E2E Tests

make e2es

netsocks's People

Contributors

cs-vitorsalgado avatar vitorsalgado avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

micropatel

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.