Micro Blog
A microblogging app built with Go Micro

Overview
Yet another microblog. But here's the catch. Rather than just spitting out your thoughts,
co-author them with AI instead. Reflect and be more thoughtful. Get instant feedback and
rewrite as needed. Or even just put down your thoughts and let the AI reword it for you.
Features
- Microservices-based architecture (Users, Posts, Comments, Web)
- Minimalist web UI (feed, profiles, login, signup)
- AI co-authoring for posts (OpenAI integration)
- Tagging and tag-based filtering for posts
- REST API for all major features
- GitHub Actions CI for Go tests
- Licensed under AGPL v3
Contents
Services
The project consists of the following microservices:
- Users: User management (create, read, update, delete)
- Posts: Post management (create, read, delete, list, tag management, AI co-authoring)
- Comments: Comment management (create, read, delete, list)
- Web: REST API and web app that uses all other services
Web Interface
A minimalist web interface for the blog, located in web/static/:
index.html: Main feed, create posts, view posts and comments
login.html: User login page
signup.html: User registration page
profile.html: User profile, posts, and comments
Everything is server side rendered
AI Co-authoring
The blog includes an AI co-authoring feature that allows users to generate post content with the help of AI. When creating a post, users can:
- Enter a title and a brief description or outline of what they want to write about
- Click "Write with AI" to generate a full post based on their description
- Edit the generated content before posting
Configuration
To use the AI co-authoring feature, you need to set your OpenAI API key as an environment variable:
export OPENAI_API_KEY=your_openai_api_key
Then start the posts service. The service will log whether the AI co-authoring feature is enabled based on the API key configuration.
Tag Features
The blog allows you to:
- Add tags to posts
- Remove tags from posts
- Filter the feed to show posts with a specific tag
- Browse all available tags
Getting Started
Prerequisites
- Go 1.24 or higher
- Micro v5 (master branch)
To install Micro CLI:
go install go-micro.dev/v5/cmd/micro@master
Make sure that $GOPATH/bin (or $HOME/go/bin) is in your PATH so you can use the micro command.
Launching Services
Clone and cd into the blog directory and run it
micro run
Browse to http://localhost:8089
API Endpoints
Posts
Users
GET /users: List all users
GET /users/:id: Get a user by ID
POST /users: Create a new user
{
"name": "User Name",
"email": "email@example.com"
}
POST /signup: Register a new user (and log in)
{
"name": "User Name",
"email": "email@example.com",
"password": "plaintextpassword"
}
POST /login: Log in as a user
{
"email": "email@example.com",
"password": "plaintextpassword"
}
POST /logout: Log out the current user
GET /users/me: Get the current session user info
POST /posts/:id/tags: Add a tag to a post
{
"tag": "tagname"
}
DELETE /posts/:id/tags/:tag: Remove a tag from a post
GET /tags: Get all available tags
GET /tags?post_id=:id: Get tags for a specific post
GET /posts/by-tag/:tag: Get posts with a specific tag
Project Structure
blog/
├── comments/ # Comments service
│ ├── handler/ # Request handlers
│ ├── main.go # Entry point
│ └── proto/ # Protobuf definitions
├── posts/ # Posts service
│ ├── handler/
│ ├── main.go
│ └── proto/
├── users/ # Users service
│ ├── handler/
│ ├── main.go
│ └── proto/
└── web/ # REST API and static web UI
├── main.go # REST API server
└── static/ # Static web UI (index.html, login.html, signup.html, profile.html)