# How to Vibe Code Your Own GitLab (and Stop Paying for It)

> The intelligent orchestration platform for DevSecOps

- Site: https://gitlab.com
- Category: Developer Tools & CI/CD
- Platforms: Web app
- Verdict: **Don't bother** (12/100 vibecodeable)
- Estimated effort: 6+ months of full-time work

## Verdict

Keep paying or use self-hosted Gitea/Forgejo; vibecoding a personal GitLab is a massive multi-subsystem sinkhole.

GitLab is an enormous monolithic or modular microservice platform containing millions of lines of code. Replicating even its core loop—Git storage parsing via custom RPC, isolated CI/CD runner execution, merge requests, and security scanning—exceeds what an AI coding agent can assemble into a cohesive, stable architecture. For a personal git-and-pipeline tool, you would spend months wrestling with bare-metal process management, git packfile indexing, and container spawning bugs.

### What you can't replicate

- The exact Gitaly Git storage performance layer
- Secure, isolated, distributed CI/CD runner fleet infrastructure
- Comprehensive enterprise compliance and audit tracking
- GitLab Duo agentic AI platform

## What it does

Comprehensive DevSecOps platform spanning source code management, CI/CD pipelines, issue tracking, security scanning, and AI-driven agentic workflows.

### Core features

- Git repository hosting with HTTP/SSH access
- Issue tracking and kanban boards
- Merge requests and code review comments
- CI/CD pipeline runner execution engine
- Secret detection and basic vulnerability scanning
- Package and container registry

## The business

### Pricing

- Free: $0
- Premium: $29/user/mo
- Ultimate: $99/user/mo

### Funding

$435M raised.
- Series A, B, C (2015-2017)
- Series D ($100M, 2018)
- Series E ($268M, 2019)
Investors: ICONIQ Capital, Goldman Sachs, Y Combinator, Khosla Ventures, GV

Founded 2011.
Team size: ~2,375.

## The hard parts

- Implementing a high-performance Git RPC protocol layer (equivalent to Gitaly)
- Orchestrating isolated, concurrent containerized CI/CD runners securely
- Executing automated static security analysis (SAST) inline with builds
- Managing complex branching models, diff rendering, and atomic git reference updates
- Providing multi-tenant role-based access control (RBAC)

## How to vibe code GitLab

### Prerequisites

- Node.js (free): Required for running the Next.js web application framework and build tools.
- GitHub (free): Where your clone's source code repository will be stored.

### Recommended AI tools

- Claude Code: Best-in-class terminal coding agent capable of handling multi-file architecture scaffolding and complex debugging loops.

### Stack

- Frontend: Next.js with Tailwind CSS
- Backend: Next.js API routes and Node.js process spawning
- Database: PostgreSQL via Neon
- Auth: better-auth
- Payments: None (Personal use clone)
- Other: Simple-Git for repository interactions, Dockerode for local container runner orchestration

### Hosting

- Railway (Hosting the Next.js app, PostgreSQL database, and managing background worker processes for git hooks and CI execution.): ~$5-10/mo

### Build guide

1. **Project Scaffolding and Database Schema** — Initialize the Next.js application with TypeScript, configure Tailwind CSS, set up Neon PostgreSQL connection, and define core database tables for users, projects, issues, and merge requests.

```
Create a new Next.js full-stack application using TypeScript and Tailwind CSS. Configure a Drizzle or Prisma schema connecting to a PostgreSQL database (Neon). Define tables for users, projects (with name and git_storage_path), issues (title, description, author_id, project_id, status), merge_requests (source_branch, target_branch, status), and pipelines (status, commit_sha, logs). Ensure proper foreign key constraints and indexes. Create an initial migration script and verify database connectivity.
```

2. **Authentication and Project Management** — Implement authentication using better-auth and build basic project creation and dashboard views.

```
Integrate better-auth into the Next.js application to handle email/password sign-up and session management. Build a dashboard page where authenticated users can create new projects, view a list of their projects, and navigate to a project detail view. Implement role-based access control checking project membership before allowing access to project settings or code views.
```

3. **Git Repository Local Storage and Cloning** — Implement server-side logic to initialize bare Git repositories on disk and handle file tree exploration.

```
Implement a server-side module using Node.js child_process and simple-git to initialize bare Git repositories under a designated local directory when a project is created. Create API endpoints and UI components that list files and directories for a given commit SHA, read file contents, and render commit histories with author details and timestamps. Handle edge cases where repositories are empty or malformed.
```

4. **Issue Tracking and Kanban Board** — Build an issue tracking system complete with comments and a basic kanban board view.

```
Build an issue tracking system for projects. Implement API routes for creating, updating, and commenting on issues. Create a kanban board frontend component using Tailwind CSS where users can drag or move issues across columns ('Open', 'In Progress', 'Closed'). Add real-time updates or polling so issue changes reflect immediately across open tabs.
```

5. **Merge Requests and Code Review Interface** — Implement merge request creation, diff viewing, and line-by-line comment threads.

```
Implement a merge request workflow allowing users to open a pull/merge request from a source branch to a target branch within a project. Write backend logic using git diff commands to compute code diffs between branches. Build a split and unified code review diff viewer UI that highlights additions and deletions, and allow users to post inline comments tied to specific line numbers in a file.
```

6. **Basic CI/CD Pipeline Runner Engine** — Implement a rudimentary job runner that executes shell commands defined in a YAML configuration file.

```
Build a minimal CI/CD pipeline execution engine. When a commit is pushed or a pipeline is triggered manually, parse a mock .gitlab-ci.yml file from the repository root containing shell script steps. Use Node.js child_process to execute these commands sequentially in a sandboxed temporary directory, capturing stdout and stderr streams in real time. Store the build logs and final status (success/failed) in the PostgreSQL database and display them on a pipeline status page.
```

### Cost vs paying

**Starting costs (one-time):**

- Domain name registration: $12 one-time
- Total: ~$12 one-time

**Ongoing costs (monthly):**

- Railway hosting and database: $5 - $10/mo
- Total: ~$8/mo

- Paying for the SaaS instead: $29 - $99/user/mo
- Build time: 120 - 160 hours
- AI tool credits: $20 (Claude Pro)
- Break-even: N/A (Built for learning/frustration)

## Sources

- [GitLab Home Page](https://gitlab.com)
- [GitLab Pricing & Plan Docs](https://about.gitlab.com/pricing/)
- [Crunchbase News: GitLab Funding & IPO Filings](https://news.crunchbase.com)