Skip to content

Commit f2b9fdd

Browse files
feat: add compose file with redis and pg
1 parent f8e6fde commit f2b9fdd

File tree

10 files changed

+1170
-250
lines changed

10 files changed

+1170
-250
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
NEXT_PUBLIC_APP_URL=http://localhost:3000
55

66
# Database URL (for Prisma)
7-
DATABASE_URL="file:./dev.db"
7+
DATABASE_URL="postgresql://gitproof:gitproof123@localhost:5432/gitproof"
88

99
# Redis URL (for BullMQ job queue)
1010
REDIS_URL=redis://localhost:6379

README-BACKEND.md

Lines changed: 0 additions & 213 deletions
This file was deleted.

README.md

Lines changed: 81 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,54 @@
22

33
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.
44

5-
- [High level architecture](#high-level-architecture)
65
- [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
753

854
## High level architecture
955

@@ -48,21 +94,42 @@ graph TD
4894
end
4995
```
5096

51-
Supported Git providers include:
97+
The backend is built using:
5298

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
59104

60-
## Getting Started
61105

62-
First, run the development server:
106+
## API Endpoints
63107

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
67132

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

Comments
 (0)