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.
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
- User registration and authentication
- User profile management
- JWT token generation for secure API access
- Role-based access control
- Location CRUD operations
- Geospatial queries (nearby locations)
- Location details and properties management
- Location validation for other services
- Review CRUD operations
- Location rating system
- User-specific reviews
- Aggregate review metrics for locations
├── 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
- Docker and Docker Compose
- .NET 8 SDK (for local development)
- Git
-
Clone the repository:
git clone https://github.com/roflmyrlok/InteractiveMap cd InteractiveMap -
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
.envfile from.env.exampleif one doesn't exist - Start PostgreSQL, RabbitMQ, and all services in Docker containers
- Configure the database and apply migrations
After successful startup, you can access the services at:
-
User Service API: http://localhost:5280/swagger
-
Location Service API: http://localhost:5282/swagger
-
Review Service API: http://localhost:5284/swagger
-
RabbitMQ Management UI: http://localhost:15672 (guest/guest)
-
This depends on config and should be prompted after initialization
To stop all services:
cd ci-cd
docker compose downTo remove all data and start fresh:
cd ci-cd
docker compose down -vThe 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
LocationValidationRequestmessage to RabbitMQ - Location Service consumes the message, checks if the location exists
- Location Service publishes a
LocationValidationResponsemessage - 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