Giter VIP home page Giter VIP logo

supertracker's Introduction

SuperTracker App ๐Ÿš€

The project was built as a test solution for further practical exploration of the capabilities of MassTransit in combination with RabbitMQ, as well as .NET8 Minimal API and FluentAssertions with xUnit.

The solution consists of two services SuperTracker.PixelApi and SuperTracker.Storage communicating with each other using MassTransit and RabbitMQ Transport underneath.

SuperTracker.PixelApi

.NET 8 Minimal API with just one endpoint, GET /track, which captures certain information from the request (Referrer & User-Agent headers + Visitor IP), publishes the corresponding notification in MassTransit containing this information, and returns a 'dummy' 1-pixel GIF image as a response.

SuperTracker.Storage

.NET 8 service responsible for consuming and processing notifications from the SuperTracker.PixelApi service, ensuring the thread-safe storage of the received information in a log file.

Run It ๐Ÿƒ

  1. Make sure you have RabbitMQ up and running.
  2. Replace the corresponding RabbitMQ settings in src/SuperTracker.PixelApi/appsettings.json and src/SuperTracker.Storage/appsettings.json.
  3. Run the Api service: dotnet run --project "src/SuperTracker.PixelApi"
  4. Run the Storage service: dotnet run --project "src/SuperTracker.Storage"
  5. Open requests/PixelTrack/PixelTrack.http and send requests to GET /track directly from VS Code (REST Client Extension is needed).

enter image description here

...Or with just a single command using docker-compose: docker-compose up

enter image description here

Test It ๐Ÿ“

Both services are covered by unit tests using xUnit. Other types of tests were omitted for simplicity. To run the tests, execute the following commands:

  • dotnet test "tests/SuperTracker.PixelApi.UnitTests"
  • dotnet test "tests/SuperTracker.Storage.UnitTests"

enter image description here

Docker It ๐Ÿญ

Both services contain Dockerfiles with build and runtime split into two stages. To build Docker images, execute the following commands:

  • docker build -t supertracker.storage -f "src/SuperTracker.Storage/Dockerfile" .
  • docker build -t supertracker.pixelapi -f "src/SuperTracker.PixelApi/Dockerfile" .

enter image description here

supertracker's People

Contributors

dkorolov1 avatar

Stargazers

Uladzislau Loputs avatar

Watchers

 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.