AI-powered code intelligence for your GitHub repositories.
BuildFolio is a full-stack AI developer platform that connects with GitHub, indexes repository source code, stores semantic embeddings in PostgreSQL with PGVector, and lets developers ask natural-language questions about their codebase.
Instead of manually searching through hundreds of files, developers can use BuildFolio to understand architecture, APIs, authentication, database logic, dependencies, and implementation details through an AI-powered chat interface.
- π GitHub OAuth Authentication
- π¦ GitHub Repository Synchronization
- π Repository Search & Filtering
- π§ AI-powered Code Intelligence
- π RAG-based Code Understanding
- βοΈ Automatic Source Code Chunking
- π’ Vector Embeddings
- π PostgreSQL + PGVector
- π¬ Repository-based AI Chat
- β‘ Streaming AI Responses
- π Code Citations
- π Repository Indexing Statistics
- π Dark / Light Theme
- π± Responsive Developer Dashboard
- π©Ί Backend System Health Monitoring
BuildFolio converts a GitHub repository into an intelligent knowledge base.
GitHub Repository
β
βΌ
Repository Synchronization
β
βΌ
Source Code Processing
β
βΌ
File Chunking
β
βΌ
Embedding Generation
β
βΌ
PostgreSQL + PGVector
β
βΌ
Semantic Vector Search
β
βΌ
Relevant Code Retrieval
β
βΌ
RAG Pipeline
β
βΌ
AI Model
β
βΌ
Grounded Answer
Developers can ask questions such as:
How does authentication work?
Where is GitHub OAuth implemented?
Explain the repository architecture.
Where is JWT validation handled?
How does repository indexing work?
Which class handles database connections?
Where is the API for creating chat sessions?
What happens when indexing starts?
ποΈ Architecture
βββββββββββββββββββββ
β GitHub β
β OAuth + Repos β
βββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js Frontend β
β β
β Landing Page β
β Authentication β
β Dashboard β
β Repository Management β
β AI Chat β
β Settings β
β β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
REST API / SSE
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Spring Boot Backend β
β β
β GitHub OAuth β
β Authentication β
β Repository Services β
β Repository Indexing β
β Chat Sessions β
β RAG Orchestration β
β AI Integration β
β β
βββββββββββββββββ¬ββββββββββββββββββββββββ¬βββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββ ββββββββββββββββββββ
β PostgreSQL β β AI Services β
β β β β
β Users β β Embeddings β
β Repositories β β LLM β
β Chat Sessions β β RAG β
β Chat Messages β β β
ββββββββββ¬βββββββββ ββββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β PGVector β
β β
β Vector Storage β
β Similarity β
β Search β
βββββββββββββββββββ
π Application Workflow
User
β
βΌ
BuildFolio Landing
β
βΌ
GitHub Login
β
βΌ
GitHub OAuth
β
βΌ
Dashboard
β
βΌ
Repository Sync
β
βΌ
Repository List
β
βΌ
Start Repository Index
β
βΌ
Fetch Source Files
β
βΌ
Code Chunking
β
βΌ
Generate Embeddings
β
βΌ
PGVector
β
βΌ
Repository READY
β
βΌ
AI Chat
β
βΌ
User Question
β
βΌ
Semantic Retrieval
β
βΌ
Relevant Code Chunks
β
βΌ
RAG Context
β
βΌ
AI Model
β
βΌ
Streaming Response
β
βΌ
Code Citations
π GitHub OAuth
BuildFolio uses GitHub OAuth to authenticate developers.
The authentication flow is:
User
β
βΌ
BuildFolio
β
βΌ
GitHub OAuth
β
βΌ
GitHub Authorization
β
βΌ
OAuth Callback
β
βΌ
Spring Security
β
βΌ
User Account
β
βΌ
BuildFolio Dashboard
The application can access repositories according to the permissions granted through GitHub OAuth.
π¦ Repository Management
BuildFolio synchronizes repositories from the connected GitHub account.
Repository information includes:
Repository name
Repository owner
Full repository name
Visibility
Default branch
Programming language
Description
GitHub URL
Indexing status
File count
Processed files
Chunk count
Indexing timestamp
Error information
Example:
Repository
βββ Owner
βββ Name
βββ Language
βββ Visibility
βββ Default Branch
βββ Files
βββ Processed Files
βββ Chunks
βββ Index Status
π Repository Indexing
BuildFolio processes repository source code and converts it into searchable knowledge.
Repository
β
βΌ
Fetch Files
β
βΌ
Filter Files
β
βΌ
Read Source Code
β
βΌ
Split Into Chunks
β
βΌ
Generate Embeddings
β
βΌ
Store in PGVector
β
βΌ
Index Complete
The indexing system tracks:
Files Total
Files Processed
Chunk Count
Index Status
Indexed At
Error Message
π Indexing Status
Repositories follow an indexing lifecycle:
PENDING
β
βΌ
INDEXING
β
ββββββββββββββββΊ FAILED
β
βΌ
READY
PENDING
The repository is connected but indexing has not started.
INDEXING
Repository files are currently being processed.
READY
The repository has been successfully indexed and is ready for AI chat.
FAILED
An error occurred during indexing.
π§ Retrieval-Augmented Generation
BuildFolio uses RAG to provide answers based on actual repository code.
Instead of sending the complete repository to the AI model, relevant code is retrieved first.
Question
β
βΌ
Embedding
β
βΌ
Vector Search
β
βΌ
Top Relevant Chunks
β
βΌ
Context
β
βΌ
AI Model
β
βΌ
Answer
This improves the ability of the system to answer repository-specific questions while reducing unnecessary context.
π¬ AI Chat
Each repository can have multiple chat sessions.
Repository
β
βββ Chat Session 1
β βββ User Message
β βββ AI Message
β βββ Citations
β
βββ Chat Session 2
β βββ User Message
β βββ AI Message
β βββ Citations
β
βββ Chat Session 3
βββ User Message
βββ AI Message
βββ Citations
Chat sessions contain:
Session title
Repository
User
Messages
Creation timestamp
β‘ Streaming Responses
BuildFolio supports streaming AI responses using Server-Sent Events (SSE).
Instead of waiting for the complete answer, the frontend can receive the response progressively.
User Question
β
βΌ
Backend
β
βΌ
RAG Retrieval
β
βΌ
AI Model
β
βΌ
Token Stream
β
βΌ
Next.js Chat UI
This provides a faster and more interactive chat experience.
π Code Citations
AI responses can reference the source code used to generate the answer.
Example:
SecurityConfig.java
Lines 42 - 86
Citations help developers verify AI-generated explanations against their actual source code.
π₯οΈ Dashboard
BuildFolio provides a developer-focused dashboard.
Overview
The dashboard can provide information such as:
Repositories
Ready Repositories
Indexing Repositories
Indexed Chunks
Recent Activity
Repositories
Developers can:
Search repositories
Filter repositories
View repository information
Start indexing
Monitor indexing
Open repository details
Chat with indexed repositories
Settings
Settings include:
GitHub account information
User profile
GitHub username
Authentication status
Theme settings
Backend health
Logout
π οΈ Tech Stack
Frontend
Next.js
React
TypeScript
Tailwind CSS
React Query
Framer Motion
Lucide React
Server-Sent Events
Backend
Java
Spring Boot
Spring Security
Spring OAuth2 Client
Spring Data JPA
Spring AI
REST APIs
Server-Sent Events
Database
PostgreSQL
PGVector
Flyway
AI
OpenAI
OpenAI Embeddings
Retrieval-Augmented Generation
Vector Similarity Search
Authentication
GitHub OAuth 2.0
Spring Security
Development
Docker
Docker Compose
Maven
npm
Git
GitHub
ποΈ Database Structure
BuildFolio uses PostgreSQL as its primary relational database.
Main tables include:
users
repositories
chat_sessions
chat_messages
vector_store
Users
users
βββ id
βββ github_id
βββ github_username
βββ display_name
βββ avatar_url
βββ access_token
βββ token_scopes
βββ created_at
Repositories
repositories
βββ id
βββ user_id
βββ github_repo_id
βββ owner
βββ name
βββ full_name
βββ is_private
βββ default_branch
βββ language
βββ html_url
βββ description
βββ index_status
βββ indexed_at
βββ chunk_count
βββ files_total
βββ files_processed
βββ error_message
βββ created_at
βββ updated_at
Chat Sessions
chat_sessions
βββ id
βββ user_id
βββ repository_id
βββ title
βββ created_at
Chat Messages
chat_messages
βββ id
βββ session_id
βββ role
βββ content
βββ citations
βββ created_at
π PostgreSQL + PGVector
BuildFolio uses PostgreSQL with the PGVector extension for semantic search.
The local Docker setup uses:
Image:
pgvector/pgvector:pg16
Database:
buildfolio
Host:
localhost
Port:
5433
Check the PostgreSQL container:
docker ps
Example:
buildfolio-postgres
0.0.0.0:5433 -> 5432
π³ Docker PostgreSQL
Example:
docker run -d \
--name buildfolio-postgres \
-p 5433:5432 \
-e POSTGRES_DB=buildfolio \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=your_password \
pgvector/pgvector:pg16
Start the container:
docker start buildfolio-postgres
Stop the container:
docker stop buildfolio-postgres
βοΈ Backend Configuration
The backend uses environment variables for sensitive configuration.
Example PowerShell configuration:
$env:DB_PASSWORD="your-postgres-password"
$env:GITHUB_CLIENT_ID="your-github-client-id"
$env:GITHUB_CLIENT_SECRET="your-github-client-secret"
$env:OPENAI_API_KEY="your-openai-api-key"
$env:TOKEN_ENCRYPTOR_PASSWORD="your-strong-encryption-password"
$env:TOKEN_ENCRYPTOR_SALT="your-strong-encryption-salt"
Never commit real credentials to GitHub.
π GitHub OAuth Configuration
Create a GitHub OAuth application and configure:
Homepage URL
http://localhost:3000
Callback URL:
http://localhost:8080/login/oauth2/code/github
Example configuration:
spring.security.oauth2.client.registration.github.client-id=${GITHUB_CLIENT_ID}
spring.security.oauth2.client.registration.github.client-secret=${GITHUB_CLIENT_SECRET}
spring.security.oauth2.client.registration.github.scope=read:user,user:email,repo
π Application Properties
Example:
spring.application.name=buildfolio-backend
server.port=8080
spring.datasource.url=jdbc:postgresql://localhost:5433/buildfolio
spring.datasource.username=postgres
spring.datasource.password=${DB_PASSWORD}
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.open-in-view=false
spring.flyway.enabled=true
spring.flyway.locations=classpath:db/migration
app.cors.allowed-origins=http://localhost:3000
app.frontend-url=http://localhost:3000
app.token-encryptor-password=${TOKEN_ENCRYPTOR_PASSWORD}
app.token-encryptor-salt=${TOKEN_ENCRYPTOR_SALT}
spring.ai.vectorstore.pgvector.initialize-schema=true
spring.ai.vectorstore.pgvector.table-name=vector_store
spring.ai.vectorstore.pgvector.schema-name=public
βΆοΈ Getting Started
1. Clone the Repository
git clone https://github.com/YOUR_USERNAME/buildfolio.git
cd buildfolio
2. Start PostgreSQL
Make sure Docker is running.
docker ps
If the container already exists:
docker start buildfolio-postgres
3. Configure Environment Variables
PowerShell:
$env:DB_PASSWORD="your-postgres-password"
$env:GITHUB_CLIENT_ID="your-github-client-id"
$env:GITHUB_CLIENT_SECRET="your-github-client-secret"
$env:OPENAI_API_KEY="your-openai-api-key"
$env:TOKEN_ENCRYPTOR_PASSWORD="your-encryption-password"
$env:TOKEN_ENCRYPTOR_SALT="your-encryption-salt"
4. Start the Backend
Open a terminal:
cd backend
Run:
.\mvnw.cmd spring-boot:run
Backend:
http://localhost:8080
5. Start the Frontend
Open another terminal:
cd frontend
Install dependencies:
npm install
Start the development server:
npm run dev
Frontend:
http://localhost:3000
π Project Structure
buildfolio/
β
βββ backend/
β βββ src/
β β βββ main/
β β βββ java/
β β β βββ com/
β β β βββ buildfolio/
β β β
β β βββ resources/
β β βββ db/
β β β βββ migration/
β β βββ application.properties
β β
β βββ pom.xml
β βββ mvnw
β
βββ frontend/
β βββ app/
β β βββ dashboard/
β β βββ chat/
β β βββ login/
β β βββ page.tsx
β β
β βββ components/
β β βββ dashboard/
β β βββ landing/
β β βββ chat/
β β βββ icons/
β β βββ ui/
β β
β βββ hooks/
β βββ lib/
β βββ public/
β βββ package.json
β βββ next.config.ts
β
βββ docker-compose.yml
βββ README.md
π API Overview
Authentication
GET /api/auth/me
POST /api/auth/logout
GitHub login:
GET /oauth2/authorization/github
Repositories
GET /api/repos
GET /api/repos/{id}
POST /api/repos/{id}/index
GET /api/repos/{id}/status
Chat Sessions
POST /api/chat/sessions
GET /api/chat/sessions?repositoryId={repositoryId}
GET /api/chat/sessions/{sessionId}
Chat
POST /api/chat/sessions/{sessionId}/messages
The chat endpoint can stream AI responses using Server-Sent Events.
π‘οΈ Security
BuildFolio follows secure development practices.
Security features include:
GitHub OAuth authentication
Protected dashboard routes
Backend authentication checks
Environment-based secrets
Token encryption
CORS configuration
Repository access through authenticated GitHub accounts
No hard-coded API keys
Never commit:
.env
API keys
GitHub client secrets
Database passwords
OAuth secrets
Encryption passwords
π¨ UI & UX
BuildFolio is designed as a modern developer tool.
The interface provides:
Clean developer dashboard
Responsive layout
Dark and light themes
Repository cards
Repository filters
Indexing status
AI chat interface
Code citations
Streaming responses
Animated landing page
Mobile-friendly navigation
π Future Improvements
Incremental repository indexing
Background indexing jobs
GitHub webhook integration
Pull request analysis
Commit analysis
Branch comparison
Repository file explorer
Code dependency visualization
AI-generated architecture diagrams
Conversation search
Advanced code citations
Team workspaces
Usage analytics
Production deployment
Multi-repository conversations
π§ Development Status
BuildFolio is currently under active development.
Current capabilities include:
β
Next.js frontend
β
React + TypeScript
β
Spring Boot backend
β
GitHub OAuth
β
PostgreSQL
β
PGVector
β
Flyway
β
Repository synchronization
β
Repository indexing
β
Code chunking
β
Vector search
β
RAG architecture
β
Chat sessions
β
AI code Q&A
β
Streaming responses
β
Code citations
β
Dark / Light theme
β
Backend health monitoring
π€ Contributing
Contributions are welcome.
1. Fork the repository
2. Create a feature branch
git checkout -b feature/your-feature
3. Commit your changes
git add .
git commit -m "feat: add your feature"
4. Push your branch
git push origin feature/your-feature
5. Create a Pull Request
π License
This project is currently intended for educational and portfolio purposes.
Add an appropriate open-source license before distributing the project publicly.
π¨βπ» Author
Manish Kumar
Computer Science Engineering Student
Full-Stack Developer | AI/ML Enthusiast
Interests
Java
Spring Boot
React
Next.js
AI/ML
RAG
PostgreSQL
Cloud
DevOps
β Why BuildFolio?
Understanding a large or unfamiliar codebase can take significant time.
BuildFolio combines GitHub, code indexing, vector search, RAG, and AI to create an intelligent development workspace.
GitHub
+
Code Indexing
+
Embeddings
+
Vector Search
+
RAG
+
AI
=
Code Intelligence