Skip to content

roflmyrlok/InteractiveMap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservices Application

A scalable microservices architecture built with .NET 8, Entity Framework Core, and PostgreSQL. The application consists of three core services (User, Location, and Review) that communicate with each other through RESTful APIs and message queuing.

Table of Contents

Architecture Overview

The application uses a microservices architecture with the following components:

  • User Service: Handles user registration, authentication, and management
  • Location Service: Manages location data and location-based queries
  • Review Service: Provides functionality for users to review locations
  • PostgreSQL: Persistent storage for all services
  • RabbitMQ: Message broker for inter-service communication

Each service follows a clean architecture pattern with the following layers:

  • Domain: Core business logic and entities
  • Application: Use cases and business rules
  • Infrastructure: Data access, external services
  • API: REST endpoints and controllers

Services

User Service

  • User registration and authentication
  • User profile management
  • JWT token generation for secure API access
  • Role-based access control

Location Service

  • Location CRUD operations
  • Geospatial queries (nearby locations)
  • Location details and properties management
  • Location validation for other services

Review Service

  • Review CRUD operations
  • Location rating system
  • User-specific reviews
  • Aggregate review metrics for locations

Project Structure

├── backend/
│   ├── UserService/
│   │   ├── UserService.API
│   │   ├── UserService.Application
│   │   ├── UserService.Domain
│   │   ├── UserService.Infrastructure
│   │   └── UserService.Tests
│   ├── LocationService/
│   │   ├── LocationService.API
│   │   ├── LocationService.Application
│   │   ├── LocationService.Domain
│   │   ├── LocationService.Infrastructure
│   │   └── LocationService.Tests
│   └── ReviewService/
│       ├── ReviewService.API
│       ├── ReviewService.Application
│       ├── ReviewService.Domain
│       ├── ReviewService.Infrastructure
│       └── ReviewService.Tests
├── ci-cd/
│   ├── docker-compose.yml
│   ├── .env.example
│   ├── run-local.sh
│   └── init-db.sh
└── README.md

Getting Started

Prerequisites

Running the Application localy

  1. Clone the repository:

    git clone https://github.com/roflmyrlok/InteractiveMap
    cd InteractiveMap
  2. Run the application using the provided script:

    cd ci-cd
    chmod +x run-local.sh
    chmod +x init-db.sh
    ./run-local.sh

This script will:

  • Create a .env file from .env.example if one doesn't exist
  • Start PostgreSQL, RabbitMQ, and all services in Docker containers
  • Configure the database and apply migrations

Accessing the Services

After successful startup, you can access the services at:

Stopping the Application

To stop all services:

cd ci-cd
docker compose down

To remove all data and start fresh:

cd ci-cd
docker compose down -v

Look API-Documentation.md for API specs

Note on RabbitMQ

The application uses RabbitMQ for asynchronous communication between services:

Location Validation:

  • When a user creates a review, the Review Service needs to validate that the location exists
  • Review Service publishes a LocationValidationRequest message to RabbitMQ
  • Location Service consumes the message, checks if the location exists
  • Location Service publishes a LocationValidationResponse message
  • Review Service consumes the response and proceeds accordingly
  • If Location Service / RabbitMQ / Review Service is not working some resources may not be created with server error in response, though other functionality should remain unafected

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published