A modern, cloud-native blogging platform built with Go microservices architecture.
blogbish/
├── auth-service/ # Authentication and user management
├── post-service/ # Blog post and category management
├── comment-service/ # Comment management
├── media-service/ # Media handling
├── search-service/ # Full-text search and suggestions
├── docker-compose.yml # Docker composition for all services
├── prometheus.yml # Prometheus monitoring configuration
├── Makefile # Build and management commands
├── go.work # Go workspace configuration
└── README.md
-
Auth Service (Port: 8080)
- User registration and authentication
- JWT token management
- Role-based access control
-
Post Service (Port: 8081)
- Blog post CRUD operations
- Category management
- Filtering & pagination
-
Media Service (Port: 8082)
- Upload/download files to MinIO (S3-compatible)
- Metadata management, Redis caching
-
Comment Service (Port: 8083)
- Comment CRUD, like, report, moderate
- WebSocket hub for live comments
-
Search Service (Port: 8084)
- Full-text search and suggestions (Elasticsearch)
- Index posts and comments
- Analytics Service
- Backend: Go (Golang)
- Framework: Chi (lightweight HTTP router)
- Database: PostgreSQL
- Cache: Redis
- Message Queue: RabbitMQ (coming soon)
- Documentation: Swagger/OpenAPI
- Containerization: Docker
- Monitoring: Prometheus & Grafana
- Logging: ELK Stack (coming soon)
- Go 1.21 or later
- Docker and Docker Compose
- Make (for using Makefile commands)
- PostgreSQL 15
- Redis 7
-
Clone the repository:
git clone https://github.com/yourusername/blogbish.git cd blogbish
-
Start all services:
make docker-up
-
Run database migrations:
make migrate-up
-
Access the services:
- Auth Service: http://localhost:8080
- Post Service: http://localhost:8081
- Media Service: http://localhost:8082
- Comment Service: http://localhost:8083
- Search Service: http://localhost:8084
make build
- Build all servicesmake test
- Run tests for all servicesmake clean
- Clean build artifactsmake docker-up
- Start all servicesmake docker-down
- Stop all servicesmake migrate-up
- Run database migrationsmake migrate-down
- Rollback database migrationsmake run-auth-service
- Run auth service locallymake run-post-service
- Run post service locally
- Create a new directory for your service
- Copy the basic service structure from existing services
- Add the service to:
- docker-compose.yml
- go.work
- Makefile (SERVICES variable)
- prometheus.yml (if metrics are needed)
POST /auth/register
- Register a new userPOST /auth/login
- Login userGET /auth/me
- Get current user info (Protected)
POST /posts
- Create a new post (Protected)GET /posts
- List posts with filtering and paginationGET /posts/{id}
- Get post by IDPUT /posts/{id}
- Update post by ID (Protected)DELETE /posts/{id}
- Delete post by ID (Protected)GET /categories
- List categoriesPOST /categories
- Create category (Protected)GET /categories/{slug}
- Get category by slugPUT /categories/{slug}
- Update category by slug (Protected)DELETE /categories/{slug}
- Delete category by slug (Protected)
POST /api/v1/media/upload
- Upload a file (Protected)GET /api/v1/media/{id}
- Get media metadataGET /api/v1/media/{id}/download
- Download filePUT /api/v1/media/{id}/metadata
- Update metadata (Protected)DELETE /api/v1/media/{id}
- Delete file (Protected)
POST /comments
- Create a comment (Protected)GET /comments
- List comments (query:post_id
,user_id
,status
,parent_id
,page
,page_size
)GET /comments/{id}
- Get comment by IDPUT /comments/{id}
- Update comment (Protected, author only)DELETE /comments/{id}
- Delete comment (Protected, author only)POST /comments/{id}/like
- Like a commentPOST /comments/{id}/report
- Report a commentPUT /comments/{id}/moderate?status={approved|rejected|pending}
- Moderate commentGET /ws?post_id={postId}
- WebSocket for live comments (Protected)
POST /search
- Search posts/commentsPOST /suggest
- Get search suggestionsPOST /index/post
- Index a postPOST /index/comment
- Index a comment
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.