Article-Generator

Tool-Grounded Article Generator

A lightweight content generation system that combines AI, web search, and full-stack functionality.

πŸ”— Live Demo

Access the deployed application here:

πŸ‘‰ https://article-generator-iota.vercel.app/login

Demo Credentials

Features

  1. Content Query Input - Accept article topics via user query
  2. Web Search Integration - Uses LLM with web search grounding for research
  3. URL Context Support - Optionally provide URLs as additional context
  4. Structured Article Generation - Produces articles in JSON format
  5. SEO Metadata Generation - Automatically generates SEO-optimized metadata including Open Graph tags
  6. HTML Document Production - Creates polished HTML documents with styling
  7. Authentication - Simple login-based authentication (no sign-up required)
  8. Protected Routes - Frontend routes protected by authentication
  9. Article Display - Preview generated HTML with SEO metadata
  10. HTML Download - Download the generated article as an HTML file
  11. Rate Limiting Handling - Gracefully handles API rate limits and search throttling

Tech Stack

Backend

Frontend

Quick Start

Backend Setup

  1. Navigate to the backend directory:
    cd backend
    
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Create environment file:
    cp .env.example .env
    
  4. Edit .env and add your API key:
    SECRET_KEY=your-secret-key-change-in-production
    OPENROUTER_API_KEY=your-openrouter-api-key
    
  5. Get an OpenRouter API key from https://openrouter.ai/

  6. Start the backend server:
    uvicorn main:app --reload
    

Backend will run at http://localhost:8000

Frontend Setup

  1. Navigate to the frontend directory:
    cd frontend
    
  2. Install dependencies:
    npm install
    
  3. Start the development server:
    npm run dev
    

Frontend will run at http://localhost:5173

Default Credentials

Usage

  1. Open http://localhost:5173 in your browser
  2. Login with default credentials
  3. Enter your article query (e.g., β€œWrite an article about Trump and the Venezuela attack”)
  4. Optionally add a URL for additional context
  5. Click β€œGenerate Article”
  6. View the generated article with SEO metadata (including OG tags)
  7. Download the HTML file if desired

API Endpoints

Authentication

Article Generation

Project Structure

article-generator/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py              # FastAPI application
β”‚   β”œβ”€β”€ auth.py              # Authentication logic
β”‚   β”œβ”€β”€ config.py            # Configuration
β”‚   β”œβ”€β”€ models.py            # Pydantic models
β”‚   β”œβ”€β”€ article_generator.py # Article generation
β”‚   β”œβ”€β”€ requirements.txt     # Python dependencies
β”‚   └── .env.example         # Environment template
└── frontend/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ pages/           # Page components
    β”‚   β”œβ”€β”€ components/      # Reusable components
    β”‚   β”œβ”€β”€ context/         # React Context
    β”‚   └── api/             # API service
    └── package.json         # Node dependencies

Notes