Skip to content

A Go-based backend for a social media blogging platform, built with Clean Architecture. It provides authentication, blog management, comments, reactions, AI integration, caching, rate limiting, and Google OAuth, delivering a scalable and efficient backend for modern social apps.

Notifications You must be signed in to change notification settings

ellay21/Social-Media-Blog-Backend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Social Media Blog Backend

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.


🚀 Features

  • 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)

🛠️ Tech Stack

  • 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

📦 Getting Started

Clone the repository

git clone https://github.com/ellay21/blog-backend.git
cd blog-backend

Install dependencies

go mod tidy

Configure environment variables

Create 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_password

Run the application

go run main.go

📖 API Highlights

  • POST /auth/register → Register user
  • POST /auth/login → Login user
  • POST /auth/refresh → Refresh token
  • POST /auth/forgot-password → Request reset link
  • POST /auth/reset-password → Reset password
  • POST /blogs → Create a blog
  • GET /blogs → List all blogs
  • GET /blogs/{id} → Get blog by ID
  • POST /blogs/{id}/comments → Add comment
  • POST /blogs/{id}/reactions → Add/remove reaction

(Full API documentation to be included via Swagger/Postman collection.)


🧑‍💻 Contributors


About

A Go-based backend for a social media blogging platform, built with Clean Architecture. It provides authentication, blog management, comments, reactions, AI integration, caching, rate limiting, and Google OAuth, delivering a scalable and efficient backend for modern social apps.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%