Skip to content

Latest commit

Β 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BuildFolio

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.


✨ Features

  • πŸ” 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

🧠 How BuildFolio Works

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

About

AI-powered GitHub code intelligence platform that indexes repositories and lets developers chat with their code using RAG, Spring Boot, Next.js, PostgreSQL & PGVector.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages