A backend service for a social media blogging platform, built with Golang and following Clean Architecture principles.
It provides authentication, blog CRUD operations, comments, reactions, AI integration, caching, and rate limiting to ensure performance and scalability.
-
Authentication & Authorization
- Register, Login, Logout, Refresh Tokens
- Forgot/Reset Password with Email
- User Activation via Email
- Google OAuth Integration
- User promotion/demotion
-
Blog System
- Create, Update, Delete blogs
- Search blogs by title, author, and tags
- List all blogs, get by ID, and filter by user
- Blog recommendations (Recs feature)
-
Comments & Reactions
- Add, list, and delete comments
- Add/Remove reactions
- Retrieve metrics for engagement
-
Performance & Scaling
- Rate limiting
- Database indexing
- Caching repetitive/heavy tasks with Redis
- Goroutines for concurrent tasks
-
AI Integration
- AI-powered blog functionality (content enhancements, summaries, or recommendations)
- Language: Go (Golang)
- Architecture: Clean Architecture
- Database: SQL (with indexing for performance)
- Cache: Redis
- Authentication: JWT + Google OAuth
- Email Service: For activation and password reset
- Concurrency: Goroutines
git clone https://github.com/ellay21/blog-backend.git
cd blog-backendgo mod tidyCreate a .env file in the root directory and set the following:
DB_URL=your_database_url
REDIS_URL=your_redis_url
JWT_SECRET=your_secret_key
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
EMAIL_HOST=your_email_smtp_host
EMAIL_USER=your_email_user
EMAIL_PASS=your_email_passwordgo run main.goPOST /auth/register→ Register userPOST /auth/login→ Login userPOST /auth/refresh→ Refresh tokenPOST /auth/forgot-password→ Request reset linkPOST /auth/reset-password→ Reset passwordPOST /blogs→ Create a blogGET /blogs→ List all blogsGET /blogs/{id}→ Get blog by IDPOST /blogs/{id}/comments→ Add commentPOST /blogs/{id}/reactions→ Add/remove reaction
(Full API documentation to be included via Swagger/Postman collection.)