Skip to content

Parthakashyap/GenPost

Repository files navigation

The GenPost - AI-Powered Blog Platform

The GenPost is a modern, AI-enhanced blogging platform built with Next.js, MongoDB, and Tailwind CSS. It features a robust admin dashboard, AI content generation using Google Gemini, automated image sourcing via Unsplash, and privacy-focused analytics.

Features

  • Modern Tech Stack: Built with Next.js 14 (App Router), TypeScript, and Tailwind CSS.
  • AI Content Generation: Integrated with Google Gemini to generate article drafts and ideas.
  • Image Integration: Integrated with Unsplash API for automatic cover image fetching.
  • Admin Dashboard: comprehensive admin panel to manage posts, topics, and settings.
  • Analytics: Built-in privacy-first analytics tracking views, unique visitors, and country data.
  • Contact System: Functional contact form with admin notifications and "mark as read" functionality.
  • Responsive Design: Fully responsive UI with Dark/Light mode support.
  • SEO Optimized: Dynamic metadata and SEO-friendly structure.

Tech Stack

Getting Started

Prerequisites

  • Node.js 18+
  • MongoDB Database

Installation

  1. Clone the repository

    git clone https://github.com/Parthakashyap/GenPost.git
    cd GenPost
  2. Install dependencies

    npm install
  3. Environment Setup Create a .env.local file in the root directory and add the following variables:

    MONGODB_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret_key
    GEMINI_API_KEY=your_gemini_api_key
    UNSPLASH_ACCESS_KEY=your_unsplash_access_key
    NEXT_PUBLIC_APP_URL=http://localhost:3000
  4. Run the development server

    npm run dev

    Open http://localhost:3000 with your browser to see the result.

Project Structure

  • app/: Next.js App Router pages and API routes.
  • components/: Reusable UI components.
  • lib/: Utility functions and database connection.
  • models/: Mongoose schemas (Post, Analytics, ContactMessage, etc.).
  • public/: Static assets.

Admin Access

The admin panel is located at /admin. You will need to create an admin account in your database.

GitHub Actions

This project includes a GitHub Action workflow (.github/workflows/cron.yml) to automate content generation.

Configuration

To use the automated workflow, you need to set up the following GitHub Secrets in your repository settings:

  • VERCEL_PROJECT_PRODUCTION_URL: The full URL of your production deployment (e.g., https://your-blog.vercel.app).
  • CRON_SECRET: A secret key used to authenticate the cron job request. This must match the CRON_SECRET environment variable in your Vercel deployment.

Workflows

  • Trigger Cron Job: This workflow runs automatically every hour (0 * * * *) to trigger the content generation API endpoint.
    • It can also be triggered manually from the "Actions" tab in GitHub.
    • Manual Inputs:
      • force: (Boolean, default: true) If set to true, it forces generation even if the schedule criteria aren't met.

License

This project is licensed under the MIT License.

About

A modern, AI-powered blogging platform built with Next.js 14, MongoDB, and Tailwind CSS. Features automated content generation via Google Gemini, Unsplash integration, and a full admin dashboard.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors