π Blog Microservice Platform
A modern, scalable blog platform built with a microservices architecture using Go. This is a learning project designed to demonstrate microservices concepts and best practices.
π Overview
This project implements a complete blog platform with separate services for user management, post handling, and notifications. Each service is independently deployable and communicates through Kafka messaging to ensure reliability and scalability. The platform is built as an educational resource to explore and understand microservice architecture patterns.
ποΈ Architecture
The platform consists of the following microservices:
- User Service: Handles user registration, authentication, and profile management
- Post Service: Manages blog posts and comments
- Notification Service: Sends email notifications for account verification, password resets, etc.
Communication
Services communicate asynchronously via Kafka for event-driven operations and directly via HTTP for synchronous API requests.
β¨ Features
-
User Management
- Registration and account verification
- Authentication with JWT
- Password reset functionality
- Role-based access control
-
Blog Content Management
- Create, read, update, and delete blog posts
- Comment management
-
Notification System
- Email notifications
- Customizable templates
π» Tech Stack
- Backend: Go
- Message Broker: Kafka
- API Documentation: OpenAPI/Swagger
- Containerization: Docker
- Observability: OpenTelemetry, Jaeger
π¦ Getting Started
Prerequisites
- Docker and Docker Compose
- Go 1.21 or higher
Installation
- Clone the repository:
git clone https://github.com/chrishrb/blog-microservice.git
cd blog-microservice
- Start the services using Docker Compose:
docker-compose up -d
- Access the services:
π API Documentation
The API is documented using OpenAPI/Swagger. You can access the documentation via Swagger UI at http://localhost:8081 after starting the services.
π¨βπ» Development
Project Structure
blog-microservice/
βββ user-service/ # User management service
βββ post-service/ # Post and comment management service
βββ notification-service/ # Notification delivery service
βββ internal/ # Shared code between services
βββ config/ # Configuration files
βββ docker-compose.yaml # Docker Compose configuration
Building the Services
Build all services:
make build
π§ͺ Testing
Run the tests with:
make test
π License
This project is licensed under the MIT License - see the LICENSE file for details.