UserBlog
A blogging platform REST API built with ASP.NET Core. Goes beyond basic CRUD: covers JWT-based authentication, BCrypt password hashing, request validation with FluentValidation, and interactive Swagger docs — on top of EF Core with PostgreSQL and Docker Compose for local development.
Tech
Features
- JWT authentication — register and login endpoints issue signed JWT tokens; protected routes require a valid bearer token.
- BCrypt password hashing — passwords are hashed with BCrypt.Net-Next before storage; plaintext is never persisted.
- FluentValidation — request DTOs are validated via FluentValidation rules integrated into the ASP.NET Core pipeline, returning structured error responses.
- Blog posts — full CRUD for posts scoped to authenticated users.
- Swagger / OpenAPI — interactive API reference served via Swashbuckle in development.
- EF Core + migrations — PostgreSQL backend with code-first schema managed through EF Core migrations.
- Docker Compose — single command spins up the API and database locally.
Architecture
- Feature-based structure — code organised by domain:
Auth/,Users/,Posts/, with shared utilities inCommon/. - Data access layer — dedicated
Data/module with EF Core context and repository pattern. - Configuration — environment-specific settings via
appsettings.jsonandappsettings.Development.json.