Connect a repo. Push code. Get a professional README β automatically.
Features β’ How It Works β’ Tech Stack β’ Installation β’ API β’ Deployment
DaemonDoc is an AI-powered documentation engine that automates the creation and maintenance of GitHub READMEs. By integrating directly with your repositories via webhooks, it analyzes your codebase and commit diffs to ensure your documentation remains accurate and up-to-date without manual intervention.
The system features a sophisticated dual-mode AI pipeline:
- Full Generation: Scans the repository tree and key files to build a comprehensive initial README.
- Patch Mode: Uses stored section hashes to surgically update only the parts of the README affected by recent commits, preserving the rest of the document and minimizing token usage.
Powered by Google Gemini (primary, 1M token context) with a resilient fallback to Groq, DaemonDoc handles complex repository structures with ease. It includes a full-featured dashboard for repository management, real-time generation logs, and a Pro subscription tier powered by Razorpay.
- SEO-Optimized Landing Port β High-performance Next.js 16 (App Router) landing page with SSR, dynamic metadata, and JSON-LD structured data for superior search visibility.
- Automated Sitemap Generation β Dynamic
sitemap.xmlgeneration via Next.js Metadata API to ensure search engines crawl and index the latest landing page content efficiently. - Server-Side Pricing Sync β Real-time plan fetching via SSR with ISR revalidation, ensuring pricing accuracy without client-side waterfalls.
- Modern Typography & Design β Professional aesthetic using Inter and Space Grotesk fonts, powered by Tailwind CSS v4 and custom-engineered gradients.
- AI Discovery Layer β Machine-readable
llms.txtandsite-metadata.jsonfiles providing high-density technical summaries and capability maps for AI crawlers. - Semantic Repository Metadata β Integrated
README-AI.mdand extended JSON-LD metadata for improved semantic association and GitHub discovery. - Agent-Ready Context β Dedicated
ai-context.mdinstruction sets designed for seamless integration and accurate recommendation by AI developer agents. - Real-time Log Detail Streaming β Live-updating message trails for generation jobs powered by Convex reactive subscriptions.
- Expandable Activity Logs β Interactive log rows that expand to reveal a live-updating message trail of the documentation pipeline using Framer Motion animations.
- Unified Log Correlation β Seamlessly links MongoDB persistent logs with Convex transient message streams via unique log identifiers for real-time status tracking.
- Dynamic Hero Experience β Enhanced landing page featuring interactive video controls, floating tech stack iconography, and animated workflow steps (Connect, Push, Sync).
- Guided User Onboarding Walkthrough β A multi-stage interactive experience including non-blocking dashboard banners and contextual guidance in the activity logs.
- Pro Subscription Tier β Unlock unlimited repositories, priority AI generation, and enhanced project/competitor analysis limits.
- Seamless Payment Integration β Integrated upgrade flow with real-time plan synchronization and localized currency formatting (INR) via Razorpay.
- Animated Technical Iconography β Custom-engineered SVG animations (Hammer, Disc, PlugZap, Search) that visualize complex engine processes like AST scanning.
- Intelligent Code Analysis β Powered by Gemini 1.5 Flash for deep understanding of codebase structure, logic, and intent with RAG-based context synthesis.
- Multi-Key AI Fallback β Resilience through 3-key rotation for both Gemini and Groq providers, ensuring continuous generation availability.
- Async Job Queue β BullMQ + Redis handles all generation in the background; webhooks return instantly to GitHub.
- Enterprise-Grade Security β Bank-level AES-256 encryption protects GitHub tokens and repository access keys at rest.
- Connect GitHub Account β OAuth login, encrypted token stored
- Activate a Repo β Webhook created. If it's the first activation, an initial README is generated immediately.
- Push Code β Webhook fires, job queued in Redis
- AI Scans Codebase β Step 1: file selection (mini model) Step 2: README generation (main model)
- README Committed β Pushed back to your repo automatically
- Feature Announcement β (Optional) Craft updates via a 4-step guided wizard in the Admin dashboard, featuring categorized tags, targeted recipient selection, unlimited change entries, and real-time validation.
- Full generation β Used when no README exists yet, or the existing one is under 500 characters. Scans up to 50 files and generates from scratch.
- Patch mode β Used on subsequent pushes. Identifies which README sections are affected by the changed files, then surgically rewrites only those sections using a SHA-256 section hash to detect what actually changed.
Gemini key 1 β Gemini key 2 β Gemini key 3 β Groq key 1 β Groq key 2 β Groq key 3
Retriable errors (429 rate limit, 503 overload, network errors) move to the next key. Auth failures (401/403) and payload errors (413) also fall through.
| Technology | Purpose | Version |
|---|---|---|
| Next.js | App Router | 16.x |
| React | UI framework | 19.x |
| Tailwind CSS | Styling | 4.x |
| Framer Motion | Animations | 12.x |
| Lucide React | Icons | 0.562.0 |
| Technology | Purpose | Version |
|---|---|---|
| React | UI framework | 19.x |
| Vite | Build tool | 7.x |
| Convex React Client | Real-time subscriptions | 1.17.x |
| React Router | Client-side routing | 7.x |
| Tailwind CSS | Styling | 4.x |
| Framer Motion | Animations & Transitions | 12.x |
| Lucide React | Icons | 0.562.0 |
| PostHog | Analytics | β |
| Technology | Purpose | Version |
|---|---|---|
| Node.js | Runtime | 18+ |
| Express | Web framework | 5.x |
| Convex | Real-time log store | β |
| MongoDB + Mongoose | Database | β |
| Redis + IORedis | Job queue backing & Cache | β |
| BullMQ | Job queue | 5.x |
| JWT | Auth tokens | β |
| Service | Role |
|---|---|
| Gemini 1.5 Flash | Primary README generation (1M context) |
| Groq | Fallback provider for both generation and selection |
| Convex | Live log metadata and message details |
| GitHub API | Repo tree, file content, webhooks, commits |
| Razorpay | Payment processing and subscription management |
| Resend | Transactional and broadcast email services |
DaemonDoc follows a modern decoupled architecture designed for scalability and reliability:
- Frontend: A high-performance SPA built with React 19, Vite 7, and Tailwind CSS v4. It utilizes Convex React Client for read-only reactive subscriptions to live log details.
- Backend: An Express.js 5 REST API handling authentication, repository orchestration, and payment processing. It mirrors log events to Convex via HTTP actions.
- Worker Tier: A robust BullMQ system backed by Redis that offloads long-running AI generation tasks from the main request cycle.
- Real-time Layer: Convex serves as the transient store for live log metadata and message trails, allowing the client to stream updates without polling the primary database.
- Data Layer: MongoDB (via Mongoose) remains the authoritative source for user profiles, encrypted GitHub tokens, and persistent generation logs.
- AI Engine: A multi-provider strategy utilizing Google Gemini for deep context analysis, falling back to Groq for high-speed resilience.
- Integrations:
- GitHub API: For OAuth, webhook management, and committing documentation via the Contents API.
- Razorpay: For secure INR payment processing and subscription lifecycle management.
- Resend: For transactional and broadcast email delivery.
- Node.js 18+ or Bun
- MongoDB (local or Atlas)
- Redis (local or via Docker)
- Convex Account
- GitHub OAuth App
- Gemini API keys from Google AI Studio
- Groq API keys from Groq Console (fallback)
bash git clone https://github.com/kaihere14/daemondoc.git cd daemondoc
If you have Docker installed, you can quickly spin up the required Redis service:
bash cd server docker-compose up -d
bash cd ../convex-server npm install npx convex dev # This will set up your Convex project and generate types
bash cd ../server npm install # or bun install
Create server/.env with your environment variables (refer to the Configuration section).
bash cd ../client npm install # or bun install
bash cd ../seo-client npm install
MONGO_URI=mongodb+srv://user:password@cluster.mongodb.net/daemondoc
- Indexing: The
userIdandlogIdfields in theuserLogschema are indexed to optimize query performance for activity tracking and real-time correlation between MongoDB and Convex.
- logs: Stores transient log metadata (
logId,status,repoName,updatedAt) for reactive UI updates. - logMessages: Stores chronological message trails for active generation jobs, indexed by
logIdfor efficient streaming to the client.
JWT_SECRET=your_jwt_secret_minimum_32_chars GITHUB_TOKEN_SECRET=64_char_hex_for_aes256_encryption
GITHUB_CLIENT_ID=your_oauth_client_id GITHUB_CLIENT_SECRET=your_oauth_client_secret GITHUB_CALLBACK_URL=http://localhost:3000/auth/github/callback GITHUB_WEBHOOK_SECRET=your_webhook_secret
Note: The webhook handler now ignores pushes to nonβdefault branches, so README generation only occurs for pushes on the repository's default branch.
REDIS_HOST=your-redis-host REDIS_PORT=6379 REDIS_PASSWORD=your_redis_password
- Production (Canonical):
https://www.daemondoc.online - Frontend (Local):
http://localhost:5173 - Backend (Local):
http://localhost:3000
GEMINI_API_KEY1=your_gemini_key_1 GEMINI_API_KEY2=your_gemini_key_2 GEMINI_API_KEY3=your_gemini_key_3 GEMINI_MODEL=gemini-3-flash-preview GEMINI_MODEL_MINI=gemini-3-flash-preview
GROQ_API_KEY1=your_groq_key_1 GROQ_API_KEY2=your_groq_key_2 GROQ_API_KEY3=your_groq_key_3 GROQ_MODEL=openai/gpt-oss-120b
This provider includes intelligent prompt truncation to respect the 8,000 token context limit. It utilizes a middle-cut strategy to preserve critical context framing (head and tail) when processing large codebases.
README_FILE_NAME=README.md
### 3. Client setup
```bash
cd client
npm install
Create client/.env:
VITE_BACKEND_URL=http://localhost:3000# Terminal 1 β backend
cd server && npm run dev
# Terminal 2 β frontend
# Vite SPA (Main App)
cd client && npm run dev
# Next.js (SEO Landing Port)
cd seo-client && npm run dev
Open **http://localhost:5173** (App) or **http://localhost:3000** (Landing)
---
## Configuration
### Convex Integration
1. Create a project on [Convex](https://www.convex.dev/)
2. Add to `client/.env`:
- `VITE_CONVEX_URL=your_convex_deployment_url`
3. Add to `server/.env`:
- `CONVEX_SITE_URL=your_convex_site_url` (for HTTP actions)
### GitHub OAuth App
1. Go to [GitHub Developer Settings](https://github.com/settings/developers) β **New OAuth App**
2. Set **Authorization callback URL** to `http://localhost:3000/auth/github/callback`
3. Copy **Client ID** and **Client Secret** β add to `server/.env`
4. Ensure your webhook is configured for push events; the system will only process pushes to the default branch.
### PostHog Analytics
1. Sign up at [PostHog](https://posthog.com/)
2. Create a new project and copy your **Project API Key** and **API Host**
3. Add to `client/.env`:
- `VITE_PUBLIC_POSTHOG_PROJECT_TOKEN=your_project_token`
- `VITE_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com` (or your region's host)
### Gemini API Keys
1. Visit [Google AI Studio](https://aistudio.google.com/app/apikey)
2. Create up to 3 API keys for rate limit resilience
3. Add as `GEMINI_API_KEY1`, `GEMINI_API_KEY2`, `GEMINI_API_KEY3` in `server/.env`
### Groq API Keys (fallback)
1. Visit [Groq Console](https://console.groq.com) β **API Keys**
2. Create up to 3 keys
3. Add as `GROQ_API_KEY1`, `GROQ_API_KEY2`, `GROQ_API_KEY3` in `server/.env`
# macOS
brew install redis && brew services start redis
# Ubuntu
sudo apt-get install redis-server && sudo systemctl start redis-server
redis-cli ping # β PONGCloud: Redis Cloud β copy host/port/password to .env
Base URL: http://localhost:3000 (dev) / your Render URL (prod)
All protected routes require Authorization: Bearer <jwt_token>.
| Method | Endpoint | Description |
|---|---|---|
GET |
/auth/github |
Initiates GitHub OAuth |
GET |
/auth/github/callback |
OAuth callback, returns JWT |
POST |
/auth/verify |
Verify JWT, return user info |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/github/getGithubRepos |
List user's repos with activation status |
POST |
/api/github/addRepoActivity |
Activate a repo (creates webhook, queues initial generation) |
POST |
/api/github/deactivateRepoActivity |
Deactivate a repo (removes webhook) |
POST |
/api/github/webhookhandler |
GitHub push event receiver |
GET |
/api/github/fetchLogs |
Get activity log for the authenticated user |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/convex/test |
Test Convex connection and connectivity |
GET |
/api/convex/tasks |
Fetch sample tasks from the Convex data store |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/payments/admin/analytics |
Fetch aggregate payment and revenue statistics |
GET |
/api/payments/admin/users |
List users with plan details (supports search, plan filter, and pagination) |
POST |
/api/payments/admin/revoke-plan |
Revoke a user's pro plan and revert to free tier limits |
PATCH |
/api/payments/admin/update-plan-price |
Update the price of a specific subscription plan |
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Health check β returns status, uptime, redis state |
-
New Web Service β connect repo
-
Settings:
Root Directory: server Build Command: npm install Start Command: npm start
-
Environment variables β add everything from
server/.env, updating:GITHUB_CALLBACK_URLβhttps://your-app.onrender.com/auth/github/callbackFRONTEND_URLβ your Vercel URLBACKEND_URLβ your Render URL
Required vars:
MONGO_URI, JWT_SECRET, GITHUB_TOKEN_SECRET, GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, GITHUB_CALLBACK_URL, GITHUB_WEBHOOK_SECRET, REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, FRONTEND_URL, BACKEND_URL, GEMINI_API_KEY1, GEMINI_API_KEY2, GEMINI_API_KEY3, GEMINI_MODEL, GEMINI_MODEL_MINI, GROQ_API_KEY1, GROQ_API_KEY2, GROQ_API_KEY3, GROQ_MODEL, README_FILE_NAME
-
New Project β import repo
-
Settings:
Root Directory: client Build Command: npm run build Output Directory: dist
-
Environment variable:
VITE_BACKEND_URL= your Render URL
-
New Project β import repo
-
Settings:
Root Directory: seo-client Build Command: npm run build Output Directory: .next
-
Environment variables:
NEXT_PUBLIC_APP_URL=https://daemondoc.onlineBACKEND_URL= your Render URL
Set up an uptime monitor at UptimeRobot or cron-job.org pinging https://your-app.onrender.com/health every 5 minutes.
README not updating after push
- Check repo β Settings β Webhooks β recent deliveries
- Verify
GITHUB_WEBHOOK_SECRETmatches what's set on the webhook - Make sure
BACKEND_URLis publicly reachable (use ngrok for local dev)
AI generation failing
- Check server logs for which provider/key failed and why
- 429 errors mean rate limits β add more keys or wait
- If all keys fail, the job fails and shows in Activity Logs
Redis connection errors
redis-cli ping # should return PONGFor cloud Redis, verify the IP whitelist includes your server's IP.
OAuth callback mismatch
GITHUB_CALLBACK_URLin.envmust exactly match the URL registered in your GitHub OAuth App settings
- GitHub tokens encrypted at rest with AES-256-GCM (random IV per entry)
- GitHub tokens excluded from API responses
- Webhooks verified with HMAC-SHA256 using timing-safe comparison
- JWT sessions with 7-day expiration
- Never commit
.envβ it's in.gitignore
Built by Arman Thakur & Yash Bavadiya