Skip to content

marcuwynu23/repohub

Repository files navigation

Repohub

Stars Badge Forks Badge Issues Badge License Badge

Repohub is a lightweight Git repository manager built with Node.js/Express for the backend and React + TailwindCSS for the frontend. It allows you to:

  • Create Git repositories locally.
  • Browse repository files in a tree view.
  • View recent commits for each repository.
  • Manage repositories without using external Git hosting services.

Features

  • Repository Management: Create, list, and view repositories.
  • File Explorer: Browse repository contents with a folder/file tree view.
  • Commits Viewer: See the latest commits of a repository.
  • Lightweight & Local: Runs entirely on your local machine or server.
  • TailwindCSS UI: Clean and responsive frontend.

Tech Stack

  • Backend: Node.js, Express, Simple-Git
  • Frontend: React, TypeScript, TailwindCSS
  • Other: Dotenv, Axios

Getting Started

Prerequisites

  • Node.js v20+
  • Git installed on your machine

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/repohub.git
cd repohub
  1. Install dependencies for backend and frontend:
# Root project
pnpm install
  1. Create a .env file in the backend (apps/backend) with the following:
ROOT_DIR=./data
  1. Start the backend server:
cd apps/backend
pnpm dev
  1. Start the frontend:
cd apps/frontend
pnpm dev
  1. Open your browser at http://localhost:5173

API Endpoints

Repositories

  • GET /api/repos - List all repositories.

  • POST /api/repos - Create a new repository.

    {"name": "repo-name"}
  • GET /api/repos/:name - Get file tree of a repository.

  • GET /api/repos/:name/commits - Get recent commits (returns empty array if no commits).

Example Response: Commits

[
  {
    "hash": "abcd123",
    "message": "Initial commit",
    "author": "John Doe",
    "date": "2025-11-21T05:00:00Z"
  }
]

Frontend Structure

  • Repo List: Left sidebar
  • File Tree: Center
  • Commits: Right sidebar
  • Uses @myapp/ui for FileTree component.

Future Improvements

  • Support multiple branches.
  • Add commit creation directly from the UI.
  • Push/pull from remote repositories.
  • User authentication.

License

MIT License