This repository contains a monolithic StackOverflow-like application built with .NET Core. The project implements Domain-Driven Design (DDD) and Command Query Responsibility Segregation (CQRS) principles, leveraging MediatR for request/response handling and ProblemDetails for standardized error responses.
- User registration and authentication
- Posting questions and answers
- Voting on questions and answers
- Commenting on questions and answers
- Tagging questions with relevant tags
- Search functionality for questions
The architecture of this StackOverflow clone is designed for scalability, maintainability, and testability. It includes the following components:
- Contains the core business logic and domain entities.
- Implements DDD principles to model the business domain.
- Implements CQRS principles by segregating commands (writes) and queries (reads).
- Uses MediatR to handle commands and queries.
- Handles data persistence and external service integrations.
- Configures the database context and repositories.
- Exposes APIs for interaction with the application.
- Uses ProblemDetails for standardized error responses.
- .NET Core: The primary framework for building the application.
- DDD (Domain-Driven Design): Provides a structured approach to designing the system by modeling the business domain.
- CQRS (Command Query Responsibility Segregation): Segregates read and write operations to optimize performance and scalability.
- MediatR: Implements the mediator pattern for handling requests and notifications within the services.
- ProblemDetails: Provides a standardized way to handle and return error responses.
To get started with the StackOverflow clone, follow these steps:
Ensure you have the following installed on your machine:
- .NET Core SDK
- SQL Server or any other supported database
-
Clone the repository:
git clone https://github.com/MustafaTark/QuestionsCommunity.git
-
Navigate to the project directory:
cd stackoverflow-clone
-
Update the database connection string in
appsettings.json
:"ConnectionStrings": { "DefaultConnection": "Server=your_server;Database=your_database;User Id=your_user;Password=your_password;" }
-
Apply database migrations:
dotnet ef database update
-
Build and run the application:
dotnet run
Once the application is up and running, you can access it via http://localhost:5000
(or the port configured in your setup).