Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐙 Guthib — GitHub Clone

A modern, full-stack GitHub clone built with React, TypeScript, Node.js, Express, MongoDB Atlas, and Docker.

Features repository management, issue tracking, user profile management, community member search, custom VCS commands, and interactive contribution heatmaps wrapped in a sleek GitHub Dark UI theme.


🚀 Features

  • 🔑 Authentication & Authorization: Secure signup, login, password hashing with bcryptjs, and JWT session tokens.
  • 📦 Repository Management: Create, search, update descriptions, add files/code snippets, toggle Public/Private visibility, and delete repositories.
  • 🐛 Issue Tracking: Create, list, filter by repo, and close/open issues.
  • 👥 User Profiles & Community: View user profile cards, contribution heatmaps, user stats, and search community developers.
  • 🌙 GitHub Dark Design System: Styled according to GitHub's native dark palette (#0d1117, #161b22, #30363d).
  • CLI / Version Control Engine: Custom Node.js CLI script using yargs (init, add, commit, revert, push, pull).
  • 🐳 Docker & Docker Compose Ready: Fully containerized multi-stage build setup for local development and cloud production deployment.

🛠️ Tech Stack

Frontend

  • Framework: React 18 + TypeScript + Vite
  • UI Components: @primer/react, @primer/octicons-react, @uiw/react-heat-map
  • Routing & HTTP: react-router-dom, axios
  • Styling: Vanilla CSS with custom GitHub Design Tokens

Backend

  • Runtime: Node.js + Express
  • Database: MongoDB Atlas (mongodb driver & mongoose)
  • Authentication: bcryptjs + jsonwebtoken
  • Storage & Socket: AWS SDK (S3 integration for commits) + socket.io
  • CLI Utilities: yargs

DevOps & Infrastructure

  • Containerization: Docker, Multi-Stage Nginx Build, Docker Compose

📂 Project Structure

.
├── backend/
│   ├── config/            # AWS & DB configuration
│   ├── controllers/       # Route controllers (user, repo, issue, git CLI)
│   ├── middleware/        # Auth middleware
│   ├── models/            # Mongoose schemas (User, Repository, Issue)
│   ├── routes/            # Express routers
│   ├── index.js           # Express server & yargs CLI entrypoint
│   ├── Dockerfile         # Node.js backend Docker image configuration
│   └── package.json
│
├── frontend/
│   ├── src/
│   │   ├── assets/        # SVGs & static assets
│   │   ├── components/    # React components (auth, dashboard, repo, user)
│   │   ├── AuthContext.tsx# Authentication context provider
│   │   ├── Routes.tsx     # Application router mapping
│   │   ├── index.css      # Global GitHub dark styling system
│   │   └── main.tsx       # Vite React entrypoint
│   ├── Dockerfile         # Multi-stage Nginx build Dockerfile
│   └── package.json
│
├── docker-compose.yaml     # Multi-container orchestration config
├── .env.example           # Environment variables template
└── README.md

⚙️ Environment Configuration

Create a .env file in the root folder (and/or inside /backend & /frontend folders):

# Server Port
PORT=3000

# Database
MONGODB_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net/githubclone?retryWrites=true&w=majority

# JWT Secret
JWT_SECRET_KEY=your_jwt_secret_key

# AWS S3 Config (Optional for S3 commit push/pull)
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=ap-south-1
S3_BUCKET=your_s3_bucket_name

🐳 Quick Start with Docker (Recommended)

Make sure Docker and Docker Compose are installed and running on your system.

  1. Clone the repository:

    git clone https://github.com/your-username/github-clone.git
    cd github-clone
  2. Configure your .env file in the root directory (see template above).

  3. Build and launch containers:

    docker compose up --build -d
  4. Access the application:

  5. Stop containers:

    docker compose down

💻 Manual Local Development (Without Docker)

1. Backend Setup

cd backend
npm install
npm start

The backend server will run at http://localhost:3000.

2. Frontend Setup

Open a new terminal window:

cd frontend
npm install
npm run dev

The frontend application will run at http://localhost:5173.


🔌 API Endpoints Summary

Method Endpoint Description
POST /signup Register a new user
POST /login Authenticate user & return JWT
GET /allUsers Get list of all registered community users
GET /userProfile/:id Fetch specific user profile details
POST /repo/create Create a new repository
GET /repo/all Fetch all public repositories
GET /repo/:id Fetch repository details by ID
GET /repo/user/:userID Fetch repositories owned by a specific user
PUT /repo/update/:id Update repository description or add file content
PATCH /repo/toggle/:id Toggle repository visibility (Public / Private)
DELETE /repo/delete/:id Delete a repository
POST /issue/create Create an issue for a repository
GET /issue/all?repository=:id Fetch all issues for a repository

🖥️ Custom CLI Commands

You can run custom local VCS commands using the backend index.js CLI script:

# Initialize a local repository repository
node index.js init

# Add a file to staging area
node index.js add <filename>

# Commit staged files with a message
node index.js commit <message>

# Revert to a specific commit ID
node index.js revert <commitID>

# Push commits to AWS S3
node index.js push

# Pull commits from AWS S3
node index.js pull

📜 License

This project is licensed under the ISC License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages