chore: initialize monorepo wrapper

This commit is contained in:
2026-03-03 16:28:46 +00:00
commit 297f4f5e4a
7 changed files with 197 additions and 0 deletions

25
.env.example Normal file
View File

@@ -0,0 +1,25 @@
# Root environment for docker compose
# Required by POCSite. Must be a 32-byte hex string.
ENCRYPTION_KEY=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
# Public site URL exposed from the host.
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Postgres service defaults used by compose and Prisma.
POSTGRES_DB=pocdb
POSTGRES_USER=pocuser
POSTGRES_PASSWORD=pocpassword
# Runtime toggle for Prisma migrations on container startup.
RUN_MIGRATIONS=true
# Pipeline service retry behavior.
PIPELINE_RETRY_LIMIT=1
# LLM provider credentials for POCGraphGen.
ANTHROPIC_API_KEY=
OPENAI_API_KEY=
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_ENDPOINT=
GOOGLE_API_KEY=

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.env

6
.gitmodules vendored Normal file
View File

@@ -0,0 +1,6 @@
[submodule "POCGraphGen"]
path = POCGraphGen
url = ./POCGraphGen
[submodule "POCSite"]
path = POCSite
url = ./POCSite

1
POCGraphGen Submodule

Submodule POCGraphGen added at 2df6663984

1
POCSite Submodule

Submodule POCSite added at 71b1696c52

105
README.md Normal file
View File

@@ -0,0 +1,105 @@
# DUBSOFT Monorepo
This repository is a root wrapper around two child applications:
- `POCSite`: Next.js application with Prisma-backed persistence
- `POCGraphGen`: Bun/TypeScript pipeline service
The stack is orchestrated from the root with Docker Compose and runs all services on a shared Docker network:
- `poc-site`: web app on `http://localhost:3000`
- `poc-graph-gen`: pipeline service on `http://localhost:3001`
- `poc-db`: PostgreSQL database on `localhost:5432`
## Repository Layout
```text
.
├── POCGraphGen/
├── POCSite/
├── .env.example
├── .gitmodules
└── compose.yml
```
## Prerequisites
- Docker
- Docker Compose
- Git
## Setup
1. Create a local environment file:
```bash
cp .env.example .env
```
2. Edit `.env` and set at minimum:
- `ENCRYPTION_KEY`
- one LLM provider key for `POCGraphGen` such as `OPENROUTER_API_KEY`, `OPENAI_API_KEY`, or `ANTHROPIC_API_KEY`
3. Start the stack:
```bash
docker compose up --build
```
## Services
### `poc-site`
- Source: `POCSite/`
- Host URL: `http://localhost:3000`
- Connects to Postgres through `DATABASE_URL`
- Calls the pipeline service over the internal Docker network
### `poc-graph-gen`
- Source: `POCGraphGen/`
- Host URL: `http://localhost:3001`
- Internal service URL from other containers: `http://poc-graph-gen:3000`
- Requires at least one configured LLM provider credential
### `poc-db`
- Image: `postgres:16-alpine`
- Host port: `5432`
- Data is persisted in the `poc-db-data` Docker volume
## Common Commands
Start in the foreground:
```bash
docker compose up --build
```
Start in the background:
```bash
docker compose up --build -d
```
Stop the stack:
```bash
docker compose down
```
Stop the stack and remove volumes:
```bash
docker compose down -v
```
## Git Submodules
Both child projects are registered as git submodules from the root repository.
Current note:
- the submodule URLs are local paths right now, so this setup is correct for this machine but not yet portable for fresh clones from another machine
If you later add remotes for `POCSite` and `POCGraphGen`, update `.gitmodules` to point at those repository URLs.

58
compose.yml Normal file
View File

@@ -0,0 +1,58 @@
services:
poc-db:
image: postgres:16-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-pocdb}
POSTGRES_USER: ${POSTGRES_USER:-pocuser}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pocpassword}
ports:
- "5432:5432"
volumes:
- poc-db-data:/var/lib/postgresql/data
networks:
- poc-network
poc-graph-gen:
build:
context: ./POCGraphGen
dockerfile: Dockerfile
environment:
NODE_ENV: production
PORT: 3000
PIPELINE_RETRY_LIMIT: ${PIPELINE_RETRY_LIMIT:-1}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
AZURE_OPENAI_API_KEY: ${AZURE_OPENAI_API_KEY:-}
AZURE_OPENAI_ENDPOINT: ${AZURE_OPENAI_ENDPOINT:-}
GOOGLE_API_KEY: ${GOOGLE_API_KEY:-}
ports:
- "3001:3000"
networks:
- poc-network
poc-site:
build:
context: ./POCSite
dockerfile: Dockerfile
depends_on:
- poc-db
- poc-graph-gen
environment:
PIPELINE_SERVICE_URL: http://poc-graph-gen:3000
DATABASE_URL: postgresql://${POSTGRES_USER:-pocuser}:${POSTGRES_PASSWORD:-pocpassword}@poc-db:5432/${POSTGRES_DB:-pocdb}?schema=public
ENCRYPTION_KEY: ${ENCRYPTION_KEY:?ENCRYPTION_KEY must be set}
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-http://localhost:3000}
HOSTNAME: 0.0.0.0
PORT: 3000
RUN_MIGRATIONS: ${RUN_MIGRATIONS:-true}
ports:
- "3000:3000"
networks:
- poc-network
volumes:
poc-db-data:
networks:
poc-network:
driver: bridge