AI-powered GitHub repository analyzer and chat interface built with Next.js, tRPC, and Google Gemini AI
RepoChat is an intelligent repository management system that allows you to:
- π Connect GitHub repositories
- π€ AI-powered commit summarization using Google Gemini
- π Automatic code analysis and embeddings
- π¬ Interactive Q&A about your codebase
- π Visual commit history and insights
- π Secure authentication with Clerk
- Repository Integration: Seamlessly connect and index GitHub repositories
- AI Commit Summaries: Automatically generate human-readable commit summaries
- Code Embeddings: Vector-based code search using semantic understanding
- Real-time Updates: Automatic polling for new commits
- Project Dashboard: Visual overview of all your connected repositories
- Meeting Transcription: (Coming soon) Record and analyze development meetings
- Type-safe API: End-to-end type safety with tRPC
- Modern UI: Beautiful interface built with shadcn/ui components
- Responsive Design: Optimized for desktop and mobile devices
- Database: PostgreSQL with Prisma ORM and pgvector extension
- Authentication: Secure user management with Clerk
- Node.js 18+ and npm/yarn/pnpm
- PostgreSQL database with pgvector extension
- GitHub account and personal access token
- Google Gemini API key
- Clerk account for authentication
- Clone the repository
git clone https://github.com/yourusername/repochat.git
cd repochat- Install dependencies
npm install
# or
pnpm install
# or
yarn install- Set up environment variables
Create a .env file in the root directory:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/repochat?schema=public"
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxxxx
CLERK_SECRET_KEY=sk_test_xxxxx
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
# GitHub
GITHUB_TOKEN=ghp_xxxxx
# Google Gemini AI
GEMINI_API_KEY=xxxxx
# Node Environment
NODE_ENV=development- Set up the database
# Generate Prisma client
npx prisma generate
# Run migrations
npx prisma migrate dev
# (Optional) Open Prisma Studio
npx prisma studio- Run the development server
npm run dev
# or
pnpm dev
# or
yarn devOpen http://localhost:3000 in your browser.
If you prefer to run the database and app in Docker for development, this repository includes a simple docker-compose.yml and Dockerfile to get you started.
Quick steps (PowerShell on Windows):
- Copy your env file and fill in secrets (do not commit it):
Copy-Item .env.example .env
# Edit .env and replace tokens/keys with your local secrets- Start Postgres and the app (start only
dbandappto save memory):
# Start DB and app
docker-compose up -d --build db app
# (Optional) start everything including pgAdmin
docker-compose up -d --build- Follow logs:
docker-compose logs -f app
docker-compose logs -f dbsrc/
βββ app/
β βββ (protected)/ # Protected routes
β β βββ dashboard/ # Main dashboard
β β βββ qa/ # Q&A interface
β β βββ meetings/ # Meeting management
β β βββ create/ # Project creation
β βββ api/
β β βββ trpc/ # tRPC API routes
β βββ sign-in/ # Authentication pages
β βββ sign-up/
βββ components/
β βββ ui/ # shadcn/ui components
βββ hooks/ # Custom React hooks
βββ lib/ # Utility functions
β βββ gemini.ts # AI integration
β βββ github.ts # GitHub API
β βββ github-loader.ts # Repository indexing
βββ server/
β βββ api/
β β βββ routers/ # tRPC routers
β β βββ trpc.ts # tRPC configuration
β βββ db.ts # Prisma client
βββ styles/
βββ globals.css # Global styles
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- UI Components: shadcn/ui (New York style)
- Icons: Lucide React
- Forms: React Hook Form
- API: tRPC v11
- Database: PostgreSQL with Prisma ORM
- Vector Search: pgvector extension
- Authentication: Clerk
- AI/ML: Google Gemini AI
- Code Quality: ESLint + TypeScript ESLint
- Formatting: Prettier
- Package Manager: pnpm/npm/yarn
When you connect a repository, RepoChat:
- Clones and analyzes the codebase
- Generates AI summaries for each file
- Creates vector embeddings for semantic search
- Stores structured data in PostgreSQL
- Automatically fetches new commits
- Analyzes git diffs
- Generates concise, human-readable summaries
- Displays commit history with author info
- Ask questions about your codebase
- Get context-aware answers
- Search through commit history
- Understand code relationships
POST /api/trpc/project.createProject- Create a new projectGET /api/trpc/project.getProjects- Get all user projectsGET /api/trpc/project.getCommits- Get project commits
RepoChat uses shadcn/ui components with the New York style variant:
- Sidebar navigation
- Cards and layouts
- Forms and inputs
- Buttons and dialogs
- Tables and data display
- Server-side authentication with Clerk
- Environment variable validation with Zod
- Protected API routes with middleware
- Secure database queries with Prisma
Database Connection Error
- Ensure PostgreSQL is running
- Check DATABASE_URL in .env
- Verify pgvector extension is installed
GitHub API Rate Limit
- Use a personal access token
- Implement exponential backoff
- Consider caching responses
AI Summarization Fails
- Check GEMINI_API_KEY is valid
- Verify API quota limits
- Review error logs for details
We welcome contributions! Please see CONTRIBUTORS.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with T3 Stack
- UI components from shadcn/ui
- Icons from Lucide
- AI powered by Google Gemini
For questions or support, please open an issue on GitHub or contact the maintainers.
Made with β€οΈ by the RepoChat team