BlogHub is a C#/.NET REST API for creating and managing blog content. It provides full CRUD operations for blog posts, comments, tags, and user management with JWT authentication.
- Blog Posts: Create, read, update, and delete blog posts with cover images
- Comments: Add comments to posts with voting system (upvote/downvote)
- Tags: Organize posts with tagging system
- User Management: Complete authentication and authorization system
- File Upload: Image upload support via Cloudinary integration
- Caching: Redis-based caching for improved performance
- Background Jobs: Hangfire integration for email notifications
- Pagination, sorting, and filtering on list endpoints
- .NET 8.0 - Framework
- ASP.NET Core Web API - Web framework
- Entity Framework Core - ORM
- SQL Server - Database
- JWT Bearer - Authentication
- Redis - Caching
- Cloudinary - Image storage
- Hangfire - Background job processing
- Serilog - Logging
- Swagger/OpenAPI - API documentation
- Docker - Containerization
- .NET 8.0 SDK
- SQL Server (LocalDB or full instance)
- Redis Server
- Cloudinary Account (for image upload)
- SMTP Server configuration (for email notifications)
git clone https://github.com/Promise30/BlogHub.git
cd BlogHubUpdate appsettings.json (and/or appsettings.Development.json) with your connection string and any other settings.
Example (adjust to your environment):
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=BlogHub;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}If using EF Core, apply migrations:
dotnet ef database updateIf you are not using EF Core, remove this section and document your actual data setup.
From the project directory that contains your web API entry point:
dotnet restore
dotnet build
dotnet runBy default, ASP.NET Core listens on:
Below are some of the API endpoints:
POST /api/auth/register- Register new userPOST /api/auth/login- User login
GET /api/posts/user-posts- Get user's postsPOST /api/posts- Create new post
POST /api/comments/posts/{id}- Create commentPUT /api/comments/{id}- Update comment
Build and run with Docker:
docker build -t blogging-api . docker run -p 8080:80 blogging-apiOr use Docker Compose:
docker-compose up -d- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.