BlogMate is a powerful, feature-rich blogging API built in Go with the Gin framework and backed by MongoDB. It supports secure user management, complete CRUD operations for blog posts, interactive comments and replies, and AI-powered content recommendations via Gemini AI. Designed by the Yesetoda team, BlogMate is engineered for scalability and seamless integration into your development and deployment pipelines.
- Features
- Architecture & Tech Stack
- Installation & Setup
- Configuration
- Running the Application
- API Documentation
- AI Model & Validation
- Contributing
- License
- Contact
-
User Management:
Secure registration, login, account verification, token refresh, and role-based authorization (JWT). -
Blog Management:
Full CRUD support for blog posts along with pagination and filtering. -
Interactive Comments & Replies:
Easily post comments and threaded replies with like, dislike, and view functionalities. -
AI-Powered Recommendations:
Integrates Gemini AI to boost your content:- Blog Recommendations:
RecommendBlogs(Data) ([]domain.BlogRecommendation, error)
- Title Suggestions:
RecommendTitle(content string, tags []string) (string, error)
- Content Generation:
RecommendContent(title string, tags []string) (string, error)
- Tag Recommendations:
RecommendTags(title string, content string) ([]string, error)
- Content Summarization:
Summarize(Data) (string, error)
- Validation:
Validate(Data) error
- Chat Interface:
Chat(prompt string) (string, error)
- Blog Recommendations:
-
Email Support:
Uses Google App credentials to send verification emails and notifications. -
Validation & Rule Enforcement:
Automatically ensures your blog content complies with predefined standards. -
Swagger Documentation:
Comprehensive API docs generated via Swaggo are available for interactive testing.
- Language: Go (Golang)
- Framework: Gin
- Database: MongoDB
- API Documentation: Swagger (Swaggo)
- AI Integration: Gemini AI for smart content recommendations
- Email Integration: Google App credentials
- Configuration: YAML-based configuration (with environment variable overrides)
git clone https://github.com/yesetoda/BlogMate.git
cd BlogMate
Enable Go Modules and download dependencies:
go mod download
Since the entry point is in delivery/main.go
:
cd delivery
go build -o blogmate
BlogMate uses a YAML configuration file. Although config.yaml
is gitignored, you can provide your configuration via environment variables on production platforms such as Render.
Local Development:
Create a config.yaml
in the project root with the following structure:
database:
username: <your-database-username>
password: <your-database-password>
uri: <your-database-uri>
email:
key: <google-app-key>
port: <port-number>
jwt: <jwt-key>
gemini:
api_key: <your-gemini-key>
model: <gemini-model-name>
Production Deployment: Use environment variables on Render (for example):
DATABASE_USERNAME
DATABASE_PASSWORD
DATABASE_URI
EMAIL_KEY
PORT
JWT
GEMINI_API_KEY
GEMINI_MODEL
Your configuration loader should merge these values accordingly.
To start the server:
-
Local:
cd delivery go run main.go
The server will listen on the port defined in your configuration file.
-
On Render:
- Set the Root Directory to
delivery
. - Build Command:
go build -tags netgo -ldflags '-s -w' -o app
- Start Command:
./app
- Set the Root Directory to
BlogMate comes with built-in Swagger documentation. Generate the docs with:
swag init --dir . --parseDependency
Then navigate to:
http://localhost:<port>/docs/index.html
This interactive interface allows you to test endpoints and review API contracts.
The core AI interface includes methods for content suggestion and validation:
type AIModel interface {
RecommendBlogs(Data) ([]domain.BlogRecommendation, error)
RecommendTitle(content string, tags []string) (string, error)
RecommendContent(title string, tags []string) (string, error)
RecommendTags(title string, content string) ([]string, error)
Summarize(Data) (string, error)
Validate(Data) error
Chat(prompt string) (string, error)
}
- Recommendations: Improve your blog posts with tailored AI suggestions.
- Validation: Ensure content compliance with your defined rules.
- Chat: Interact with an AI for brainstorming and support.
Configure your Gemini AI integration by supplying the appropriate API key and model name in your configuration.
Contributions are welcome! To contribute:
- Fork the Repository.
- Create a Feature Branch:
git checkout -b feature/your-feature-name
- Commit Your Changes.
- Submit a Pull Request: Provide a detailed description of your changes and the problem they solve.
Please follow the project’s coding standards and include tests where necessary.
BlogMate is open-source software.
For inquiries or support, please contact the Yesetoda team.
Explore more details on our GitHub repository and try the live API:
- Website: Blog-Mate Api
- Swagger Documentation: Blog-Mate Api Docs
Enjoy using BlogMate – your intelligent solution for modern blogging!