This repository contains a multi-layered ASP.NET Core blog application with API and web UI components. The solution follows a modular architecture with separation of concerns across different projects.
The main API project for the blog application.
Business logic layer containing service implementations and validation rules.
Core abstractions and cross-cutting concerns.
Data access implementations with Entity Framework.
Domain entities and models.
JWT authentication API project.
ASP.NET Core MVC web application.
-
Clone the repository
git clone https://github.com/doganenes/DotnetCoreBlog cd DotnetCoreBlog
-
Restore NuGet packages
dotnet restore
-
Update connection strings
- Configure database connection strings in
appsettings.json
files - Update JWT settings in authentication projects
- Configure database connection strings in
-
Run database migrations
dotnet ef database update
-
Build and run
# For API dotnet run --project CoreBlog.API # For Web UI dotnet run --project CoreBlog.UI # For JWT API dotnet run --project CoreBlog.JwtAPI
The project follows a layered architecture pattern:
- Presentation Layer:
CoreBlog.UI
andCoreBlog.API
- Business Layer:
CoreBlog.BusinessLayer
- Data Access Layer:
CoreBlog.DataAccessLayer
- Entity Layer:
CoreBlog.EntityLayer
- Core Layer:
CoreBlog.CoreLayer
- Authentication:
CoreBlog.JwtAPI
- Multi-layered architecture
- JWT authentication support
- Entity Framework Core data access
- ASP.NET Core Web API
- MVC web interface
- Separation of concerns
- Repository pattern implementation
- Business logic validation
- .NET Core 8.0
- Entity Framework Core - ORM for data access
- JWT Bearer Authentication - Token-based authentication
- ASP.NET Core MVC - Web application framework
- ASP.NET Core Web API - RESTful API services
Each layer has specific responsibilities and dependencies:
Project | Purpose |
---|---|
CoreBlog.UI | Web interface |
CoreBlog.API | REST API endpoints |
CoreBlog.JwtAPI | Authentication services |
CoreBlog.BusinessLayer | Business rules |
CoreBlog.DataAccessLayer | Data operations |
CoreBlog.EntityLayer | Domain models |
CoreBlog.CoreLayer | Cross-cutting concerns |
- Ensure you have .NET 8.0 or later installed
- Set up your database connection string
- Run migrations to create the database schema
- Start with either the API or UI project based on your needs
- Use the JWT API for authentication token generation