Welcome to OKBlog, where "OK" stands for "Over Kill"!
Why use a simple WordPress installation when you can create an army of microservices?
Is it necessary? Absolutely not.
Is it fun? Maybe?
Is it educational? I hope so!
When someone asks why you built a distributed system for a blog that gets twelve visitors a month, just say: "Because it's not alright, it's OKBlog!"
The application consists of the following components:
- AI Service (Go/Gin): Provides AI Capabilities
- Profile Service (Go/go-kit): Manages user profiles with PostgreSQL database
- Post Service (Java/Spring Boot): Handles blog posts and comments with Kafka integration
- Search Service (Rust): Provides search functionality across the platform
- File Service (Python/Flask): Manages file uploads and storage using MinIO
- Tag Service (Go): Handles post categorization and tagging
- Web Service (Vue.js/Nuxt): Frontend application with SSR for better SEO
- Admin Service (React): Administrative interface for content management
- Nginx: Web server and API gateway
- Elasticsearch & Kibana: Centralized logging infrastructure
- Go 1.21+ (for ai, profile and tag service development)
- Java 17+ (for post service development)
- Python 3.10+ (for file service development)
- Rust (for search service development)
- Node.js 18+ (for web and admin services development)
-
You need docker, docker compose, and python.
-
If you want, you can go to each folder and start the services, but I've prepared a running script to start all the services.
python ./tools/docker-container-manage/run-docker.py- Connect Debezium to MySQL and ElasticSearch.
python ./tools/init/init_debezium.py- Create Kibana Dataviews, which later can be accessed at http://localhost:5601
python ./tools/init/init_kibana.py- (Optional) Create a user and posts.
python ./tools/init/init_user_and_posts.pyAll requests are through the API Gateway, which can be accessed at http://localhost:80, while admin is accessed at http://localhost:3001
- AI Service API: http://localhost:3003
- Profile Service API: http://localhost:8080
- Post Service API: http://localhost:8081
- Search Service API: http://localhost:8082
- File Service API: http://localhost:8083
- Tag Service API: http://localhost:8084
- Web Application: http://localhost:3000
Each service can be developed independently:
- AI Service: See ai/README.md for details
- Profile Service: See profile/README.md for details
- Post Service: See post/README.md for details
- Search Service: See search/README.md for details
- File Service: See file/README.md for details
- Tag Service: See tag/README.md for details
- Web Service: See web/README.md for details
- Admin Service: See admin/README.md for details
The project uses GitHub Actions for continuous deployment of each microservice. The workflows are triggered when pushing tags with specific prefixes:
| Service | Tag Format | Workflow File |
|---|---|---|
| AI Service | ai-*-* |
ai-deploy.yml |
| Admin Service | admin-*-* |
admin-deploy.yml |
| Profile Service | profile-*-* |
profile-deploy.yml |
| File Service | file-*-* |
file-deploy.yml |
| Post Service | post-*-* |
post-deploy.yml |
| Search Service | search-*-* |
search-deploy.yml |
| Web Service | web-*-* |
web-deploy.yml |
| Tag Service | tag-*-* |
tag-deploy.yml |
At the moment, deployment is using Caprover, and each workflow follows these steps:
- Checks out the repository code
- Build and run the tests
- Sets up Docker Buildx for multi-platform builds
- Logs in to DockerHub using repository secrets
- Extracts the version from the tag name
- Builds and pushes a Docker image to DockerHub
- Deploys the service to CapRover using the appropriate app token
To deploy a service, create and push a tag with the appropriate prefix:
# Example: Deploy admin service version 1-2
git tag admin-1-2
git push origin admin-1-2The workflows require the following secrets to be configured in your GitHub repository:
DOCKERHUB_USERNAME- Your DockerHub usernameDOCKERHUB_TOKEN- Your DockerHub access tokenCAPROVER_SERVER- Your CapRover server URLCAPROVER_ADMIN_APP_TOKEN- CapRover token for admin serviceCAPROVER_AI_APP_TOKEN- CapRover token for ai serviceCAPROVER_PROFILE_APP_TOKEN- CapRover token for profile serviceCAPROVER_FILE_APP_TOKEN- CapRover token for file serviceCAPROVER_POST_APP_TOKEN- CapRover token for post serviceCAPROVER_SEARCH_APP_TOKEN- CapRover token for search serviceCAPROVER_WEB_APP_TOKEN- CapRover token for web serviceCAPROVER_TAG_APP_TOKEN- CapRover token for tag service