Skip to content

Automated Blog Machine is a full-stack, AI-driven blogging system that automatically generates, stores, and publishes blog posts every week. Powered by Google Cloud Run, Firebase Hosting, Cloud Scheduler, and Gemini API, it scrapes trending topics from Dev.to, creates content using AI, and serves it via a modern React + Vite frontend.

Notifications You must be signed in to change notification settings

ATHARVA262005/Automated-Blog-Machine-AI-Powered-Blog-Generation-Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Automated Blog Machine

An AI-powered blog platform that automatically generates and publishes blog posts using Google Cloud Run, Cloud Run Jobs, Cloud Scheduler, Firebase Hosting, and Gemini API.

It scrapes trending topics from Dev.to, generates blog content with Gemini AI, stores it in MongoDB, and serves it via a modern frontend deployed on Firebase.


💰 Cost & Limits (as of September 16, 2025)

This project mostly runs within Google Cloud free tier:

  • Cloud Run

    • 2 million vCPU-seconds, 1 million GiB-seconds, and 2 million requests per month free
    • 1 GB egress per month free
    • After free tier, very low costs (your test run was ~₹0.94)
  • Cloud Scheduler

    • 3 jobs per month free
    • After that: $0.10 per job per month (~₹8 INR)
  • Firebase Hosting

    • Free tier: 1 GB storage, 10 GB/month bandwidth
    • Beyond that: ~$0.15/GB storage, ~$0.15/GB bandwidth
  • Secret Manager

    • 10,000 secret access operations per month free
    • Storage: first 10 secrets free, then $0.06/secret/month

👉 With weekly automation and light frontend usage, you’ll stay well inside the free tier.
Actual monthly costs should remain ~₹0 unless traffic spikes heavily.


📂 Project Structure

AUTOMATED BLOG MACHINE
├── automation          # Automation job (auto-generate blogs)
│   ├── autoGenerateBlog.js
│   ├── Dockerfile
│   ├── package.json
│   └── package-lock.json
│
├── client              # React frontend (Firebase Hosting)
│   ├── public
│   ├── src
│   ├── dist
│   ├── firebase.json
│   ├── vite.config.js
│   ├── package.json
│   └── README.md
│
└── server              # Backend API (Cloud Run)
    ├── server.js
    ├── Dockerfile
    ├── package.json
    ├── .dockerignore
    └── .env

⚙️ Prerequisites


🔑 Environment Variables

Create a .env file in the server and automation folders with the following variables:

# MongoDB connection string
MONGODB_URI=your-mongodb-uri

# Gemini API key (Google Generative AI)
GEMINI_API_KEY=your-gemini-api-key

# Server port (default 5000)
PORT=5000

🖥️ Backend Setup (Cloud Run Service)

  1. Build & push Docker image:

    cd server
    gcloud builds submit --tag gcr.io/automated-blog-machine/blog-backend .
  2. Deploy to Cloud Run:

    gcloud run deploy automated-blog-backend      --image gcr.io/automated-blog-machine/blog-backend:latest      --platform managed      --region asia-south1      --allow-unauthenticated      --port 5000      --set-env-vars="GOOGLE_CLOUD_PROJECT=automated-blog-machine"      --update-secrets="MONGODB_URI=mongodb-uri:latest,GEMINI_API_KEY=gemini-api-key:latest"
  3. Note down the Cloud Run URL (you’ll need it for the client).


🌐 Frontend Setup (Firebase Hosting)

  1. Go to client folder:

    cd client
  2. Update API endpoints to use your Cloud Run backend URL.

  3. Build project:

    npm install
    npm run build
  4. Deploy to Firebase Hosting:

    firebase login
    firebase init hosting
    firebase deploy
  5. Your app will be available at:

    https://<your-project>.web.app
    

🤖 Automation (Cloud Run Job)

  1. Build automation image:

    cd automation
    gcloud builds submit --tag gcr.io/automated-blog-machine/automation .
  2. Deploy as Cloud Run Job:

    gcloud run jobs create automation-job      --image gcr.io/automated-blog-machine/automation:latest      --region asia-south1      --memory 512Mi      --cpu 1      --task-timeout 300      --max-retries 3
  3. Run manually (test):

    gcloud run jobs execute automation-job --region asia-south1

⏰ Scheduling (Cloud Scheduler)

  1. Create weekly job (runs every Monday 9AM IST):

    gcloud scheduler jobs create http weekly-blog-generator      --location=asia-south1      --schedule="0 9 * * 1"      --uri="https://asia-south1-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/automated-blog-machine/jobs/automation-job:run"      --http-method=POST      --oauth-service-account-email="[email protected]"      --description="Generates a new blog post every Monday at 9 AM"
  2. Manually trigger to test:

    gcloud scheduler jobs run weekly-blog-generator --location=asia-south1
  3. Check last execution:

    gcloud run jobs executions list --job=automation-job --region=asia-south1 --limit=1

🛠 Managing Automation

You can manage and test your Cloud Run Job and Scheduler with the following commands:

Run the automation job manually

gcloud run jobs execute automation-job --region=asia-south1

View all scheduler jobs

gcloud scheduler jobs list --location=asia-south1

Pause automation

gcloud scheduler jobs pause weekly-blog-generator --location=asia-south1

Resume automation

gcloud scheduler jobs resume weekly-blog-generator --location=asia-south1

📊 Monitoring

  • Logs → Google Cloud Console → Logging
  • Executions → gcloud run jobs executions list
  • Scheduler → Google Cloud Console → Cloud Scheduler

💡 Features

  • ✨ Auto-generates blogs from trending Dev.to topics
  • ✨ Powered by Gemini API for AI content
  • ✨ Fully serverless: Cloud Run, Firebase Hosting, MongoDB Atlas
  • ✨ Weekly automation with Cloud Scheduler
  • ✨ Zero-cost on free tier (with trial credits)

🏆 Credits

Built with:


📬 Contact

For support, questions, or collaboration:

Your Name
📧 Email: [email protected] 🌐 GitHub: ATHARVA262005

About

Automated Blog Machine is a full-stack, AI-driven blogging system that automatically generates, stores, and publishes blog posts every week. Powered by Google Cloud Run, Firebase Hosting, Cloud Scheduler, and Gemini API, it scrapes trending topics from Dev.to, creates content using AI, and serves it via a modern React + Vite frontend.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published