API built with C# .NET Core that simulates swipe-and-match behavior of a dating app — designed to demonstrate Redis caching and message-based integration using RabbitMQ via MassTransit.
Note: This project originates from my old GitHub account.
A new and improved version of this API is being actively rebuilt (work in progress) in a separate repository:
👉 New Repository (WIP): dating-app (https://github.com/juan-canseco-dev/dating-app)
When the API receives a request to create a swipe:
- The handler checks whether existing swipe data is available in Redis cache.
- If not found, the swipe is stored in the SQL database.
- The newly created swipe is then cached.
- An event containing the swipe information is published to RabbitMQ.
- Other services process this event asynchronously (e.g., match detection).
This flow simulates how modern dating apps handle high-volume swipe operations efficiently.
The Matching API project hase the following features:
- Create Swipe
- Get Swipe By Id
- Get Right Swipes received By User
- Get All Swipes delivered by User
- Get All Swipes Received by User
- Get Match by Id
- Get Match by Users
- Get Matches by User
Each feature has its own unit and integration tests.
In order to execute this project, you will need to open the terminal and locate the project root folder, once the above is done you will need to execute the following commands:
// First | Build the project images
docker-compose build
// Second | Up the project
docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d
// Third | Shutdown the project
docker-compose -f docker-compose.yml -f docker-compose.override.yml up -dApi Link: http://localhost:8000/swagger/index.html
In case you don’t have docker installed in your pc, you will need to install RabbitMq, Redis, MSSQL; Once installed in the appsettings.Development.json of the Matching.Api project you will need to change the following properties:
{
"ConnectionStrings": {
"MatchingApplication": "YOUR SQL SERVER DATABASE CONNECTION STRING"
},
"EventBusSettings": {
"HostAddress": "YOUR RABBITMQ HOST ADDRESS"
},
"CacheSettings": {
"ConnectionString": "YOUR REDIS HOST ADDRESS"
}
}Once you’re finished of setting up the environment run the app as you usually would with your preferred Ide.
- Add Reccommendation Service
- Add Identity Server
- Add Api Gateway
- Add Observability
- Create a front-end
(Future development continues in the new repository — currently WIP.)
- Carter
- FluentValidation
- MediatR
- EF Core
- Dapper
- StackExchangeRedis
- MassTransit
- Testcontainers
- xUnit.Net
Inspired by
- Minimal API Vertical Slice Architecture by Issac Ojeda
- aspnetrun/run-aspnetcore-microservices by Mehmet Ozkaya
- Design Dating Platform - Tinder by Tech Takshila
- CQRS and MediatR in ASP.NET Core by CodeMaze
- CQRS Validation Pipeline with MediatR and FluentValidation by CodeMaze
- ASP.NET Core Integration Tests with Test Containers & Postgres by Matthias Güntert
- Integration Test In Asp.Net Core 6 Using SqlServer Image and TestContainers by Hamid Mosalla
