A production-ready, open-source white label monorepo built with Nx, featuring a Go backend with PostgreSQL and a Next.js frontend with shadcn/ui and Tailwind CSS.
white-label-repository/
├── apps/
│ ├── backend/ # Go API server (Gin + PostgreSQL)
│ └── frontend/ # Next.js 14 + shadcn/ui + Tailwind CSS
├── libs/
│ └── shared/
│ ├── types/ # Shared TypeScript type definitions
│ ├── utils/ # Shared utility functions
│ └── config/ # Shared configuration
├── docs/
│ ├── ARCHITECTURE.md # System architecture
│ ├── CUSTOMIZATION.md # White label customization guide
│ └── DEPLOYMENT.md # Deployment guidelines
├── docker-compose.yml # Local development environment
├── nx.json # Nx workspace configuration
└── package.json # Root workspace package
| Layer | Technology |
|---|---|
| Backend | Go 1.21+, Gin, PostgreSQL, pgx |
| Frontend | Next.js 15, React 18, TypeScript 5 |
| UI | shadcn/ui, Tailwind CSS |
| AI Gateway | OpenAI, Anthropic, Google (unified API) |
| Monorepo | Nx 20+ |
| Database | PostgreSQL 16 |
| Testing | Go test + testify, Jest + Testing Library |
| CI/CD | GitHub Actions |
| Container | Docker, Docker Compose |
git clone https://github.com/ssbreno/white-label-repository.git
cd white-label-repository
npm installcp .env.example .env
# Edit .env with your configuration# Start all services (PostgreSQL, Backend, Frontend)
docker-compose up -d
# View logs
docker-compose logs -f# Start PostgreSQL (requires Docker)
docker-compose up postgres -d
# Start backend
npm run dev:backend
# Start frontend (in another terminal)
npm run dev:frontend
# Start all services
npm run devRun make help for the full list. Key commands:
| Command | Description |
|---|---|
make dev |
Run all services in development mode |
make build |
Build all applications |
make test |
Run all tests (backend + frontend) |
make lint |
Lint all projects |
make format |
Format code with Prettier |
make docker-up |
Start Docker services |
make docker-down |
Stop Docker services |
make db-shell |
Open PostgreSQL shell |
make graph |
Visualize Nx dependency graph |
1. Make changes to your code
2. Tests run automatically (with Nx caching)
3. Open PR → CI runs linting, tests, and builds
4. Merge → Deploy to staging/production
This repository is designed as a template for multiple client projects. See docs/CUSTOMIZATION.md for the full guide.
Quick customization:
- Colors & Branding – Edit
apps/frontend/src/app/globals.css(CSS variables) - App Name – Update
APP_NAMEin.envandapps/frontend/src/app/layout.tsx - API Endpoints – Configure
libs/shared/config/src/endpoints.ts - Database Schema – Modify
apps/backend/migrations/
- Architecture Overview
- Customization Guide
- Deployment Guide
- Claude Code Guide
- Contributing Guide
- Code of Conduct
- Backend README
- Frontend README
apps/backend/
├── cmd/server/ # Application entry point
├── internal/
│ ├── ai/ # AI provider gateway (OpenRouter-style)
│ ├── config/ # App configuration
│ ├── database/ # DB connection & migrations
│ ├── handlers/ # HTTP request handlers
│ ├── middleware/ # HTTP middleware (CORS, rate limiting)
│ ├── models/ # Data models
│ ├── mocks/ # Test mocks
│ ├── repositories/ # Data access layer
│ ├── services/ # Business logic
│ └── testutil/ # Test helpers
├── Dockerfile
├── Makefile
├── .golangci.yml # Go linting config
├── go.mod
└── README.md
apps/frontend/
├── src/
│ ├── app/ # Next.js App Router
│ ├── components/
│ │ └── ui/ # shadcn/ui components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities & API client
│ └── types/ # TypeScript types
├── public/ # Static assets
├── components.json # shadcn/ui config
├── tailwind.config.ts
└── README.md
| Library | Description |
|---|---|
shared-types |
TypeScript interfaces & types |
shared-utils |
Date, validation, string helpers |
shared-config |
API endpoints, env schemas |
The backend includes an OpenRouter-style AI gateway that provides a unified API for multiple AI providers.
| Provider | Models |
|---|---|
| OpenAI | GPT-4o, GPT-4o Mini, GPT-4 Turbo, GPT-3.5 |
| Anthropic | Claude Sonnet 4, Claude 3.5 Sonnet/Haiku |
| Gemini 2.0 Flash, Gemini 1.5 Pro/Flash |
POST /api/ai/chat # Chat completion (sync or streaming via SSE)
GET /api/ai/models # List all available models
GET /api/ai/providers # List enabled providers
Providers auto-enable when their API key is configured in .env. Streaming is supported via Server-Sent Events (SSE) by setting "stream": true in the request.
See CONTRIBUTING.md for the full guide.
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit changes:
git commit -m 'feat: add my feature' - Push branch:
git push origin feature/my-feature - Open a Pull Request
GNU General Public License v3.0 - see LICENSE for details.