|
2 | 2 |
|
3 | 3 | GitProof is a Next.js application designed to provide a robust, centralized system for managing Git repositories across multiple providers. It ensures that developers can push their changes to a local repository, which then synchronizes with various remote Git providers, maintaining consistency and reliability. |
4 | 4 |
|
5 | | -- [High level architecture](#high-level-architecture) |
6 | 5 | - [Getting Started](#getting-started) |
| 6 | + - [Environment Setup](#environment-setup) |
| 7 | + - [Database Setup](#database-setup) |
| 8 | + - [Start Development Server](#start-development-server) |
| 9 | +- [High level architecture](#high-level-architecture) |
| 10 | +- [API Endpoints](#api-endpoints) |
| 11 | + - [Dashboard](#dashboard) |
| 12 | + - [Providers](#providers) |
| 13 | + - [Sync Queue](#sync-queue) |
| 14 | + - [Failover](#failover) |
| 15 | + - [Backup](#backup) |
| 16 | + |
| 17 | + |
| 18 | +## Getting Started |
| 19 | + |
| 20 | +### Environment Setup |
| 21 | + |
| 22 | +```bash |
| 23 | +cp .env.example .env |
| 24 | +``` |
| 25 | + |
| 26 | +Edit `.env` with your configuration. |
| 27 | + |
| 28 | +### Database Setup |
| 29 | + |
| 30 | +```bash |
| 31 | +# Generate Prisma client |
| 32 | +pnpm run db:generate |
| 33 | + |
| 34 | +# Run migrations |
| 35 | +pnpm run db:migrate |
| 36 | + |
| 37 | +# Seed database with sample data |
| 38 | +pnpm run db:seed |
| 39 | +``` |
| 40 | + |
| 41 | +### Start Development Server |
| 42 | + |
| 43 | +```bash |
| 44 | +pnpm run dev |
| 45 | +``` |
| 46 | + |
| 47 | +Three web applications will be available: |
| 48 | +- **GitProof Dashboard**: The main application interface: http://localhost:3000 |
| 49 | +- **pgAdmin**: PostgreSQL administration interface: http://localhost:8080 |
| 50 | + - **Email**: admin |
| 51 | + - **Password**: admin |
| 52 | +- **Redis Commander**: Redis administration interface: http://localhost:8081 |
7 | 53 |
|
8 | 54 | ## High level architecture |
9 | 55 |
|
@@ -48,21 +94,42 @@ graph TD |
48 | 94 | end |
49 | 95 | ``` |
50 | 96 |
|
51 | | -Supported Git providers include: |
| 97 | +The backend is built using: |
52 | 98 |
|
53 | | -- GitHub |
54 | | -- GitLab |
55 | | -- Codeberg |
56 | | -- Self-hosted GitLab |
57 | | -- Self-hosted Forgejo |
58 | | -- Self-hosted Gitea |
| 99 | +- **Next.js API Routes** - RESTful API endpoints |
| 100 | +- **Prisma ORM** - Type-safe database access |
| 101 | +- **SQLite** - Development database (easily swappable to PostgreSQL) |
| 102 | +- **BullMQ** - Job queue for asynchronous operations |
| 103 | +- **TypeScript** - Type safety throughout the codebase |
59 | 104 |
|
60 | | -## Getting Started |
61 | 105 |
|
62 | | -First, run the development server: |
| 106 | +## API Endpoints |
63 | 107 |
|
64 | | -```bash |
65 | | -pnpm dev |
66 | | -``` |
| 108 | +### Dashboard |
| 109 | +- `GET /api/dashboard/stats` - Get system statistics |
| 110 | +- `GET /api/dashboard/activity` - Get recent activity |
| 111 | + |
| 112 | +### Providers |
| 113 | +- `GET /api/providers` - List all providers |
| 114 | +- `POST /api/providers` - Create a new provider |
| 115 | +- `GET /api/providers/[id]` - Get provider details |
| 116 | +- `PUT /api/providers/[id]` - Update provider |
| 117 | +- `DELETE /api/providers/[id]` - Delete provider |
| 118 | +- `POST /api/providers/[id]/test` - Test provider connection |
| 119 | + |
| 120 | +### Sync Queue |
| 121 | +- `GET /api/sync-queue` - List sync jobs (with filters) |
| 122 | +- `POST /api/sync-queue` - Create new sync job |
| 123 | +- `GET /api/sync-queue/stats` - Get queue statistics |
| 124 | +- `PUT /api/sync-queue/[id]/priority` - Update job priority |
| 125 | +- `DELETE /api/sync-queue/[id]` - Cancel sync job |
| 126 | + |
| 127 | +### Failover |
| 128 | +- `GET /api/failover/events` - List failover events |
| 129 | +- `POST /api/failover/events` - Create failover event |
| 130 | +- `GET /api/failover/rules` - Get failover rules |
| 131 | +- `PUT /api/failover/rules` - Update failover rules |
67 | 132 |
|
68 | | -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
| 133 | +### Backup |
| 134 | +- `GET /api/backup/status` - Get backup status |
| 135 | +- `POST /api/backup/status` - Trigger manual backup |
0 commit comments