Driftless is an AI-powered platform that automates README generation and detects documentation drift, ensuring codebase documentation is always current by reading code, generating accurate documentation, and raising GitHub PRs automatically.
- π― About
- β¨ Features
- π οΈ Tech Stack
- π Prerequisites
- βοΈ Installation
- π Environment Variables
- π Usage
- π API Reference
- π Project Structure
- π€ Contributing
- π License
Outdated documentation is a common pain point for development teams, leading to confusion, slower onboarding, and increased maintenance overhead. As codebases evolve, manual README updates often fall behind, creating a "documentation drift" that hinders productivity and project understanding. This problem is exacerbated in fast-paced development environments where keeping documentation in sync with code changes becomes a significant burden.
Driftless solves this by intelligently reading code and generating accurate READMEs using advanced AI models like Google Gemini and Groq. It proactively detects when documentation diverges from the codebase, providing real-time drift alerts π and automating updates via GitHub Pull Requests π€. This ensures that your project's documentation is always current, reducing manual effort and improving developer experience.
- π€ AI-powered README generation β Automatically create and update READMEs by analyzing your codebase using Google Gemini and Groq.
- π Real-time documentation drift detection β Continuously monitor your repositories for discrepancies between code and documentation, with historical tracking and alerts.
- π Automated GitHub Pull Request creation β When drift is detected, Driftless can automatically generate and submit GitHub PRs with suggested documentation updates.
- π Secure user authentication β Seamlessly sign in and manage access using NextAuth.js with GitHub OAuth and Supabase for robust security.
- π³ Subscription management and checkout flows β Integrated with Dodo Payments for handling various subscription plans and secure transactions.
- π CI/CD integration for documentation drift checks β Incorporate documentation checks into your continuous integration pipeline using dedicated API keys.
- π Interactive data visualization β Track documentation health and drift history with intuitive charts powered by Recharts.
- βοΈ Customizable settings β Manage account details, API keys, and notification preferences through a dedicated settings portal.
π¨ Frontend
| Technology | Purpose |
|---|---|
| Next.js | React Framework for server-side rendering and routing |
| Tailwind CSS | Utility-first CSS framework for rapid UI development |
| Radix UI | Unstyled, accessible components for building design systems |
| Recharts | Composable charting library built with React and D3 |
βοΈ Backend & Infrastructure
| Technology | Purpose |
|---|---|
| TypeScript | Statically typed superset of JavaScript for enhanced code quality |
| Supabase | Open-source Firebase alternative for database, auth, and storage |
| NextAuth.js | Flexible authentication for Next.js applications |
| Groq | High-performance AI inference engine for generative models |
| Octokit | Official GitHub API client for Node.js |
| Resend | Developer-friendly email API for transactional emails |
| Google Gemini | Advanced generative AI models for code analysis and content generation |
β οΈ Make sure you have all of these installed before starting.
- Node.js 18+ β Download Β· Check:
node --version - npm β Comes with Node.js Β· Check:
npm --version - Supabase account β Sign up
- GitHub OAuth App β Create one
- Google Cloud Project (Generative AI) β Set up
- Dodo Payments account β Sign up
- Resend account β Sign up
git clone https://github.com/het2576/Driftless.git
cd Driftlessnpm installcp .env.example .env.localπ‘ Open
.env.localand fill in your values. See Environment Variables below.
Create a .env.local file in the project root:
# β
Required: Secret key for NextAuth.js session encryption
NEXTAUTH_SECRET=
# β
Required: Base URL of the application for NextAuth.js callbacks
NEXTAUTH_URL=
# βͺ Optional: Email address used as the 'From' sender for Resend emails
RESEND_FROM_EMAIL=
# β
Required: GitHub OAuth Client ID for authentication
GITHUB_CLIENT_ID=
# β
Required: GitHub OAuth Client Secret for authentication
GITHUB_CLIENT_SECRET=
# β
Required: API key for Google Gemini Generative AI services
GEMINI_API_KEY=
# β
Required: API key for Groq AI inference engine
GROQ_API_KEY=
# β
Required: Public URL for the Supabase project
NEXT_PUBLIC_SUPABASE_URL=
# β
Required: Public Anon Key for client-side Supabase access
NEXT_PUBLIC_SUPABASE_ANON_KEY=
# β
Required: Service Role Key for server-side Supabase access
SUPABASE_SERVICE_ROLE_KEY=
# β
Required: GitHub App ID for webhook automation
GITHUB_APP_ID=
# β
Required: Private key for GitHub App authentication
GITHUB_APP_PRIVATE_KEY=
# β
Required: Webhook secret for GitHub App events
GITHUB_APP_WEBHOOK_SECRET=
# β
Required: GitHub App Client ID for OAuth flows
GITHUB_APP_CLIENT_ID=
# β
Required: GitHub App Client Secret for OAuth flows
GITHUB_APP_CLIENT_SECRET=
# β
Required: API key for Dodo Payments
DODO_API_KEY=
# β
Required: Dodo Payments environment (test_mode or live_mode)
DODO_ENVIRONMENT=
# β
Required: Webhook secret for Dodo Payments events
DODO_WEBHOOK_SECRET=
# β
Required: Product ID for the Dodo Pro plan
DODO_PRO_PRODUCT_ID=
# β
Required: Product ID for the Dodo Pro annual plan
DODO_PRO_ANNUAL_PRODUCT_ID=
# β
Required: Product ID for the Dodo Team plan
DODO_TEAM_PRODUCT_ID=
# β
Required: Product ID for the Dodo Team annual plan
DODO_TEAM_ANNUAL_PRODUCT_ID=
# β
Required: Public publishable key for Dodo Payments client-side integration
NEXT_PUBLIC_DODO_PUBLISHABLE_KEY=
# β
Required: Email address for receiving contact form submissions
CONTACT_EMAIL=
# β
Required: Secret key for authenticating cron jobs
CRON_SECRET=| Variable | Required | Description |
|---|---|---|
NEXTAUTH_SECRET |
β Yes | Secret key for NextAuth.js session encryption |
NEXTAUTH_URL |
β Yes | Base URL of the application for NextAuth.js callbacks |
RESEND_FROM_EMAIL |
βͺ No | Email address used as the 'From' sender for Resend emails |
GITHUB_CLIENT_ID |
β Yes | GitHub OAuth Client ID for authentication |
GITHUB_CLIENT_SECRET |
β Yes | GitHub OAuth Client Secret for authentication |
GEMINI_API_KEY |
β Yes | API key for Google Gemini Generative AI services |
GROQ_API_KEY |
β Yes | API key for Groq AI inference engine |
NEXT_PUBLIC_SUPABASE_URL |
β Yes | Public URL for the Supabase project |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
β Yes | Public Anon Key for client-side Supabase access |
SUPABASE_SERVICE_ROLE_KEY |
β Yes | Service Role Key for server-side Supabase access |
GITHUB_APP_ID |
β Yes | GitHub App ID for webhook automation |
GITHUB_APP_PRIVATE_KEY |
β Yes | Private key for GitHub App authentication |
GITHUB_APP_WEBHOOK_SECRET |
β Yes | Webhook secret for GitHub App events |
GITHUB_APP_CLIENT_ID |
β Yes | GitHub App Client ID for OAuth flows |
GITHUB_APP_CLIENT_SECRET |
β Yes | GitHub App Client Secret for OAuth flows |
DODO_API_KEY |
β Yes | API key for Dodo Payments |
DODO_ENVIRONMENT |
β Yes | Dodo Payments environment (test_mode or live_mode) |
DODO_WEBHOOK_SECRET |
β Yes | Webhook secret for Dodo Payments events |
DODO_PRO_PRODUCT_ID |
β Yes | Product ID for the Dodo Pro plan |
DODO_PRO_ANNUAL_PRODUCT_ID |
β Yes | Product ID for the Dodo Pro annual plan |
DODO_TEAM_PRODUCT_ID |
β Yes | Product ID for the Dodo Team plan |
DODO_TEAM_ANNUAL_PRODUCT_ID |
β Yes | Product ID for the Dodo Team annual plan |
NEXT_PUBLIC_DODO_PUBLISHABLE_KEY |
β Yes | Public publishable key for Dodo Payments client-side integration |
CONTACT_EMAIL |
β Yes | Email address for receiving contact form submissions |
CRON_SECRET |
β Yes | Secret key for authenticating cron jobs |
π Never commit your
.env.localfile. It's already in.gitignore.
npm run devOpen http://localhost:3000 in your browser.
To experience Driftless, start the development server and navigate to the application in your browser.
- Click "Sign in with GitHub" to authenticate your account.
- Once logged in, you can navigate to the "Generate README" section.
- Provide a GitHub repository URL or select one from your installations.
- Initiate the README generation process to see how Driftless analyzes your code and produces documentation.
- Explore the "Drift History" to monitor documentation health over time.
π Base URL:
http://localhost:3000
π Authentication: Sign in via the web interface β API endpoints use session cookies.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET |
/api/alerts/drift |
Retrieve documentation drift alerts | π Required |
POST |
/api/analyze |
Analyze a repository for documentation insights | π Required |
GET |
/api/auth/[...nextauth] |
Handle NextAuth.js authentication callbacks | π Public |
POST |
/api/auth/[...nextauth] |
Handle NextAuth.js authentication requests | π Public |
POST |
/api/checkout/confirm |
Confirm a Dodo Payments checkout session | π Required |
GET |
/api/checkout |
Retrieve Dodo Payments checkout details | π Required |
POST |
/api/checkout |
Initiate a Dodo Payments checkout session | π Required |
POST |
/api/ci/check |
Perform a documentation drift check for CI/CD | π Required |
POST |
/api/contact |
Submit a contact form message | π Required |
GET |
/api/cron/drift-alerts |
Trigger scheduled documentation drift alerts | π Required |
POST |
/api/cron/test-alert |
Send a test documentation drift alert | π Required |
GET |
/api/drift/history |
Retrieve historical documentation drift data | π Required |
POST |
/api/drift/reset |
Reset documentation drift history for a repository | π Required |
POST |
/api/drift |
Initiate a documentation drift analysis | π Required |
POST |
/api/generate |
Generate a README for a given repository | π Required |
POST |
/api/generate/stream |
Stream README generation results | π Required |
POST |
/api/install/save |
Save GitHub App installation details | π Required |
GET |
/api/installations |
Retrieve user's GitHub App installations | π Required |
GET |
/api/me |
Get current authenticated user's profile | π Required |
POST |
/api/notifications/read |
Mark user notifications as read | π Required |
GET |
/api/notifications |
Retrieve user's notifications | π Required |
GET |
/api/org/repos |
Get repositories for an organization | π Required |
GET |
/api/portal |
Access Dodo Payments customer portal | π Required |
POST |
/api/pr |
Create a GitHub Pull Request for documentation updates | π Required |
GET |
/api/readmes/[id]/share |
Share a generated README by ID | π Required |
GET |
/api/readmes/latest |
Retrieve the latest generated README | π Required |
GET |
/api/repos |
Get user's accessible repositories | π Required |
GET |
/api/review/[token] |
Review a documentation update via token | π Required |
POST |
/api/roast |
Generate a "roast" of a README (public demo) | π Public |
POST |
/api/settings/account |
Update user account settings | π Required |
POST |
/api/settings/apikey |
Manage user API keys | π Required |
POST |
/api/settings/notifications |
Update user notification settings | π Required |
GET |
/api/team/members |
Retrieve team members | π Required |
POST |
/api/webhooks/dodo |
Handle incoming Dodo Payments webhook events | π Public |
POST |
/api/webhooks/github |
Handle incoming GitHub webhook events | π Public |
# Public endpoints can be called directly.
# Protected endpoints require an active browser session.
curl http://localhost:3000/api/roast -X POST -H "Content-Type: application/json" -d '{"text": "This is a README."}'{
"success": true,
"data": {
"roast": "Your README is so basic, it probably thinks 'git push' is a workout routine."
}
}Driftless/
βββ app/ # Next.js App Router: pages, API routes, and layouts
β βββ api/ # API routes (e.g., /api/auth, /api/generate)
β βββ (auth)/ # Authentication-related pages and components
β βββ (dashboard)/ # Main application dashboard and features
β βββ page.tsx # Entry point for the root application
βββ components/ # Reusable UI components
βββ lib/ # Utility functions, API clients, and helpers
βββ public/ # Static assets (images, favicons)
βββ styles/ # Global styles and Tailwind CSS configuration
βββ types/ # TypeScript type definitions
βββ .env.example # Environment variables template
βββ package.json # Dependencies and scripts
βββ README.md # This file
The project follows a modular, feature-based structure typical for Next.js applications using the App Router. Core application logic, UI components, and API routes are logically grouped, promoting maintainability and scalability. This organization allows for clear separation of concerns, making it easier to navigate and extend the codebase.
Contributions make this project better. Here's how to get involved:
Before creating a bug report:
- β Check the existing issues
- β Collect your environment details (OS, Node version, browser)
- β Reproduce the bug consistently
Feature suggestions are tracked as GitHub issues.
- π΄ Fork the repository
- πΏ Create a feature branch:
git checkout -b feat/amazing-feature - πΎ Commit your changes:
git commit -m 'feat: add amazing feature' - π€ Push to the branch:
git push origin feat/amazing-feature - π Open a Pull Request
Commit convention: We use Conventional Commits
feat:β new featurefix:β bug fixdocs:β documentation onlyrefactor:β code change, no feature or fixtest:β add or update tests
This project is licensed under the MIT License.
You're free to use, modify, and distribute this project for any purpose. See the LICENSE file for full details.
Built with β€οΈ by het2576
If this project helped you, consider giving it a β
β Star this repo Β· π Report a Bug Β· π‘ Request a Feature