Skip to content

Repository files navigation

MiniGit 🚀

A high-performance, industry-grade Version Control System (VCS) engine written in pure Java with a modern, glassmorphic Web Dashboard.

Java Build License


🌟 Key Features

  • Content-Addressable Storage Engine: Implements immutable Blob, Tree, and Commit object hierarchies with SHA-1 hashing.
  • Myers O(ND) Diff Algorithm: Industry-standard diff calculation algorithm with unified diff format output (@@ -X,Y +A,B @@).
  • 3-Way Merging: Automated recursive tree comparison with conflict marker injection (<<<<<<< / ======= / >>>>>>>).
  • Pure Java Zero-Dependency Server: Lightweight Web Server using com.sun.net.httpserver with zero external web framework overhead.
  • Real-Time Terminal Streaming (SSE): Server-Sent Events handler enabling real-time terminal output streaming directly to the browser dashboard.
  • Vercel Interactive Demo Mode: Automatic API fallback allowing static showcase deployment on Vercel for resume/portfolio display.

📁 Architecture Overview

MiniGit/
├── .minigit/             # Internal Object Store & Ref Graph
│   ├── objects/          # SHA-1 Blobs & Trees
│   ├── commits/          # Commit metadata objects
│   ├── refs/heads/       # Branch references
│   ├── HEAD              # Active pointer
│   └── index             # Staging area index
├── src/main/java/com/minigit/
│   ├── objects/          # Blob, Tree, Commit primitives
│   ├── repository/       # Repository & Index state management
│   ├── commands/         # Init, Add, Commit, Log, Branch, Checkout, Merge, Diff, Push, Pull
│   ├── utils/            # HashUtil, FileUtil, Myers DiffUtil
│   └── web/              # MiniGitServer, GitService, SseHandler
├── src/main/resources/web/ # Vercel & Web Dashboard UI (HTML5, CSS3, JS)
├── public/               # Static Web Dashboard for Vercel deployment
└── pom.xml               # Maven Build Configuration

🛠️ Quick Start (Local Setup)

Option 1: Using Batch Scripts (No Maven Required)

Double-click or run from PowerShell:

# Run the Interactive Web Dashboard on http://localhost:8080
.\run-server.bat

# Use the CLI tool directly
.\minigit.bat status
.\minigit.bat add .
.\minigit.bat commit -m "First commit"
.\minigit.bat log

Option 2: Using Maven

# Compile and build package
mvn clean package

# Run web dashboard
mvn exec:java -Dexec.mainClass="com.minigit.web.MiniGitServer"

# Run tests & coverage
mvn test jacoco:report

☁️ How to Deploy to Vercel

Since Vercel is a static & serverless hosting platform, we have equipped MiniGit with an Auto-Detecting Demo Mode.

Deployment Steps:

  1. Push to GitHub:

    git add .
    git commit -m "Prepare MiniGit for Vercel deployment"
    git push origin main
  2. Deploy via Vercel Dashboard / CLI:

    • Import your repository into Vercel (https://vercel.com/new).
    • Keep default settings (Output Directory: public).
    • Click Deploy.
  3. How it works on Vercel:

    • Vercel serves the high-end dashboard interface from the public/ directory.
    • The UI automatically detects when it cannot reach the local Java server and enters Demo Mode, serving simulated real-time terminal output, mock branch switching, and commit graph exploration—making it 100% interactive for hiring managers and recruiters to test directly on your live portfolio link!

📜 License

This project is licensed under the MIT License.

About

High-performance, zero-dependency Version Control System engine written in Java 17+. Implements content-addressable storage (Blobs/Trees/Commits), Myers O(ND) diff algorithm, recursive 3-way merging with conflict markers, an embedded SSE HTTP server, and a glassmorphic Web Dashboard with static Vercel fallback mode.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages