Skip to content

Latest commit

 

History

History
252 lines (173 loc) · 7.62 KB

File metadata and controls

252 lines (173 loc) · 7.62 KB

DevPostAI - GitHub Repository to Social Media Post Generator

DevPostAI is an AI-powered content tool for developers, maintainers, developer advocates, and technical teams. Paste a GitHub repository URL, choose a tone, review the repository insights, and generate editable social posts for LinkedIn, Twitter/X, and WhatsApp.

Version License React Vite


Key Features

AI Repository Analysis

  • Deep repository analysis: Reads README content, package metadata, repository stats, commits, and language breakdown from GitHub.
  • Project type detection: Uses dependency and README signals to identify web apps, APIs, CLIs, libraries, mobile apps, and more.
  • Feature extraction: Pulls useful features, use cases, technical insights, and recent updates from repository content.
  • Fallback generation: Produces template-based posts if the AI provider is unavailable.

Production Content Workflow

  • Tone selector: Generate posts in Professional, Technical, Launch, Founder, Casual, or Recruiting styles.
  • Platform-specific drafts: Creates content for LinkedIn, Twitter/X, and WhatsApp.
  • Editable posts: Refine every generated post before copying or sharing.
  • Platform checks: Shows character counts, readiness status, platform limits, and hashtag counts.
  • Direct sharing: Open LinkedIn, Twitter/X, or WhatsApp sharing flows from generated drafts.
  • Recent history: Stores the latest generations in browser local storage for quick reuse.

Repository Insight Preview

  • Trust-building summary: Shows what DevPostAI understood before you publish.
  • Repository stats: Displays stars, forks, open issues, and last updated date.
  • Detected stack: Shows project type, languages, and dependencies.
  • Recent updates: Surfaces recent commit messages that can shape stronger launch posts.

Tech Stack

  • Frontend: React 19, Vite 7
  • Backend: Express for local development, Vercel Serverless Function for production
  • AI: Google Gemini via @google/generative-ai
  • Data: GitHub REST API and raw GitHub content
  • Styling: Vanilla CSS custom design system
  • Icons: Lucide React
  • Animations: Framer Motion

Getting Started

Prerequisites

  • Node.js 18 or higher
  • npm
  • GitHub account for an optional API token
  • Google Gemini API key for AI generation

Installation

  1. Clone the repository:

    git clone https://github.com/mallelamanojkumar90/DevPostAI.git
    cd DevPostAI
  2. Install frontend and serverless dependencies:

    npm install
  3. Install local Express API dependencies:

    cd server
    npm install
    cd ..
  4. Create your environment file:

    cp .env.example .env
  5. Add your environment variables:

    GITHUB_TOKEN=your_github_token_here
    GEMINI_API_KEY=your_gemini_api_key_here

GITHUB_TOKEN is recommended because unauthenticated GitHub API requests are limited to 60 requests per hour. Authenticated requests can reach 5,000 requests per hour. GEMINI_API_KEY enables AI generation; without it, DevPostAI uses fallback post templates.

Local Development

Start the API server in one terminal:

cd server
npm run dev

Start the frontend in another terminal:

npm run dev

Open http://localhost:5173. Vite proxies /api requests to the local Express server at http://localhost:5000.


Usage

  1. Paste a public GitHub repository URL.
  2. Select a content tone.
  3. Generate posts.
  4. Review the repository insight panel.
  5. Edit the LinkedIn, Twitter/X, and WhatsApp drafts.
  6. Check character limits and hashtag counts.
  7. Copy or share the final content.

Example repositories:

  • https://github.com/facebook/react
  • https://github.com/vercel/next.js
  • https://github.com/vitejs/vite

Production Deployment

Vercel

This repository includes api/generate.js, a Vercel-compatible serverless API route. Vercel serves the Vite frontend from dist and handles generation requests at /api/generate.

  1. Push the code to GitHub.
  2. Import the repository in Vercel.
  3. Use the default Vite settings:
    • Build command: npm run build
    • Output directory: dist
    • Install command: npm install
  4. Add environment variables:
    • GITHUB_TOKEN
    • GEMINI_API_KEY
  5. Deploy.

Render or Other Node Hosts

You can run the Express API in server/ as a Node web service. Pair it with a static frontend deployment, or extend server/index.js to serve the built dist folder from the same host.

Netlify

The current production API function is written for Vercel. To deploy on Netlify, add an equivalent Netlify Function or host the Express API separately and point the frontend to that backend.


Project Structure

DevPostAI/
├── api/
│   └── generate.js          # Vercel serverless generation endpoint
├── public/                  # Static assets
├── server/
│   ├── index.js             # Local Express API entry point
│   ├── routes/
│   │   └── generate.js      # Local generation route
│   └── services/
│       ├── ai.js            # Gemini generation and fallback logic
│       └── github.js        # GitHub repository analysis
├── src/
│   ├── App.jsx              # Main React application
│   ├── index.css            # Global styles and design system
│   └── main.jsx             # React entry point
├── .env.example             # Environment variable template
├── package.json             # Frontend and serverless dependencies
├── vite.config.js           # Vite config with local API proxy
├── vercel.json              # Vercel deployment config
└── README.md

Scripts

# Start frontend development server
npm run dev

# Build frontend for production
npm run build

# Preview production build
npm run preview

# Run linter
npm run lint

# Start local API server
cd server && npm run dev

Environment Variables

Variable Description Required
GITHUB_TOKEN GitHub token for higher API limits Recommended
VITE_GITHUB_TOKEN Backward-compatible GitHub token name Optional
GEMINI_API_KEY Google Gemini API key for AI-generated posts Recommended

Troubleshooting

API rate limit exceeded

Add GITHUB_TOKEN to .env locally or to your hosting provider environment variables.

Posts are not generating

Check that the repository URL is valid, public, and points to a repository rather than a profile or organization page. Also confirm GEMINI_API_KEY is set. If Gemini is unavailable, the app should still return fallback posts.

Vercel app loads but /api/generate fails

Confirm api/generate.js deployed successfully and that GITHUB_TOKEN and GEMINI_API_KEY are configured in Vercel for Production, Preview, and Development environments as needed.

Local frontend loads but generation fails

Start the Express API with cd server && npm run dev. The frontend dev server proxies /api requests to http://localhost:5000.


Security Notes

  • Keep .env out of git.
  • Use minimal GitHub token scopes. public_repo is enough for public repositories.
  • Prefer server-side GITHUB_TOKEN over exposing credentials to the browser.
  • Rotate tokens periodically for production deployments.

License

This project is licensed under the MIT License.