blog-microservice

module
v0.0.0-...-43686f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2025 License: MIT

README ΒΆ

πŸš€ 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
  1. Clone the repository:
git clone https://github.com/chrishrb/blog-microservice.git
cd blog-microservice
  1. Start the services using Docker Compose:
docker-compose up -d
  1. 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.

Directories ΒΆ

Path Synopsis
internal
cmd
api
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.
cmd
api
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL