Skip to content

herin7/whatdoc.xyz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WhatDoc Logo

Connect your GitHub. Get beautiful, AI-generated documentation instantly.
Docs that don't look boring.

WebsiteFeaturesHow It WorksQuickstartTemplatesTech Stack

Live GitHub Repo Issues Stars



The Problem

Every developer knows the pain: you build something great, but writing the docs feels like a second full-time job. So you don't. Your README stays a one-liner, your API has no reference, and your users bounce.

WhatDoc fixes this. Connect your GitHub, import a repo, pick a template, and get production-ready documentation in under 60 seconds.


✨ Features

Feature Description
🧠 Smart Code Ingestion Shallow-clones your repo, walks the directory tree, filters noise (lockfiles, dist, tests), and compresses source via a regex-based minifier before sending to the LLM.
🎨 4 Pro Templates Choose from Twilio, Django, MDN, or AeroLaTeX-inspired themes. Every template is responsive, dark-mode ready, and gorgeous.
🌐 Custom Subdomains Every project gets its own yourproject.whatdoc.xyz subdomain — instant shareable docs.
🔑 BYOK (Bring Your Own Key) Plug in your Gemini API key for unthrottled, limit-free generation. Stored in local storage, never touches our servers.
🔗 GitHub OAuth Connect your GitHub, import repos (public or private), and generate docs in one flow.
✏️ Live Editor Edit your generated documentation in a rich markdown editor. Changes save instantly.
🚀 One-Click Deploy Generate → customize → deploy. Your docs go live at a permanent URL in seconds.
🧪 API Playground Test API endpoints directly from your documentation page — auto-generated from backend routes.
✂️ Token Guillotine Caps free-tier payloads at ~200k tokens with a smart file-boundary cutoff. BYOK users get the full context window.
⌨️ Command Palette Power-user keyboard shortcuts for fast navigation.

⚙️ The Engine

WhatDoc uses a multi-stage pipeline to go from raw repo → polished docs:

┌┐
│                                                              │
│   ① Shallow Clone        ② Code Ingestion      ③ LLM Call   │
│   ──     ──     ──   │
│   simple-git depth-1     Walk dir tree,         Gemini       │
│   to /tmp, ephemeral     filter noise files,    generates    │
│                          regex-minify each,     README +     │
│                          concatenate all         API ref     │
│                                                              │
│   ④ Cleanup & Render                                         │
│   ──                                         │
│   Nuke cloned files,                                         │
│   save markdown to DB,                                       │
│   render with chosen                                         │
│   React template                                             │
│                                                              │
└┘

Key design decisions:

  • Ephemeral clones — Repos are cloned to /tmp, parsed, and deleted. Nothing persists on disk.
  • Regex Guillotine — Strips block comments, consecutive // runs, base64 blobs, long string literals, and collapses blank lines before sending to the LLM. Keeps token count lean.
  • Paradigm-aware prompting — The system prompt instructs Gemini to detect the repo type (REST API vs frontend vs CLI) and adapt the doc structure accordingly.
  • Fat-Trimmer blocklist — Lockfiles, dist/, __tests__/, .min.js, source maps, and existing READMEs are all excluded automatically.
  • Round-robin key rotation — Free-tier requests rotate across multiple Gemini API keys to avoid 429s. BYOK bypasses this entirely.
  • Retry with exponential backoff — Rate-limited requests retry up to 3 times with 15s → 30s → 60s delays.

🎨 Templates

Twilio
API-first dark layout with sidebar nav
Django
Classic two-column docs with TOC
MDN
Reference-style with breadcrumbs
AeroLaTeX
Academic glassmorphic on paper-white

🚀 Quickstart

Prerequisites

  • Node.js 18+
  • MongoDB (local or Atlas)
  • Gemini API KeyGet one free

1. Clone

git clone https://github.com/herin7/whatdoc.xyz.git
cd whatdoc.xyz

2. Setup Server

cd server
npm install

Create a .env file:

MONGO_URI=mongodb://localhost:27017/whatdoc
JWT_SECRET=your-secret-key
GEMINI_API_KEY=your-gemini-key
PORT=3000
CLIENT_URL=http://localhost:5173
CORS_ORIGINS=http://localhost:5173,http://localhost:4173
APP_DOMAIN=localhost

Start the server:

npm start

3. Setup Client

cd ../client
npm install

Create a .env file:

VITE_API_URL=http://localhost:3000
VITE_APP_DOMAIN=localhost:5173

Start the dev server:

npm run dev

Open http://localhost:5173 and you're live. 🎉


🛠 Tech Stack

Frontend

Tech Purpose
React 19 UI framework
Vite Build tool & dev server
TailwindCSS Utility-first styling
React Router Client-side routing
Lucide Icons Icon system
React Markdown Markdown rendering
React Syntax Highlighter Code blocks

Backend

Tech Purpose
Express 5 HTTP server
MongoDB + Mongoose Database & ODM
Gemini API AI-powered doc generation
simple-git Ephemeral repo cloning
ignore .gitignore-aware file filtering
JWT + bcrypt Authentication
Zod Schema validation

📂 Project Structure

whatdoc.xyz/
├── client/                 # React frontend
│   ├── src/
│   │   ├── app/            # Landing page
│   │   ├── components/     # Reusable UI components
│   │   ├── config/         # Template registry
│   │   ├── context/        # Auth context provider
│   │   ├── lib/            # API client & utilities
│   │   ├── pages/          # Route pages
│   │   └── templates/      # Doc display templates
│   └── public/             # Static assets
│
├── server/                 # Express backend
│   ├── controllers/        # Route handlers
│   ├── models/             # Mongoose schemas
│   ├── routes/             # API routes
│   ├── services/           # Engine & LLM logic
│   ├── middlewares/        # Auth middleware
│   └── utils/              # Key rotation manager
│
└── README.md

🤝 Contributing

Contributions are welcome! Here's how:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

📄 License

This project is open source under the MIT License.


Built by @herin7
If WhatDoc helped you, consider giving it a ⭐

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages