From 297f4f5e4a28a7a45a4aacb5419e7ccaf36fd37f Mon Sep 17 00:00:00 2001 From: Matiss Jurevics Date: Tue, 3 Mar 2026 16:28:46 +0000 Subject: [PATCH] chore: initialize monorepo wrapper --- .env.example | 25 ++++++++++++ .gitignore | 1 + .gitmodules | 6 +++ POCGraphGen | 1 + POCSite | 1 + README.md | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++ compose.yml | 58 ++++++++++++++++++++++++++++ 7 files changed, 197 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 .gitmodules create mode 160000 POCGraphGen create mode 160000 POCSite create mode 100644 README.md create mode 100644 compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..75dae01 --- /dev/null +++ b/.env.example @@ -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= diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4504de8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "POCGraphGen"] + path = POCGraphGen + url = ./POCGraphGen +[submodule "POCSite"] + path = POCSite + url = ./POCSite diff --git a/POCGraphGen b/POCGraphGen new file mode 160000 index 0000000..2df6663 --- /dev/null +++ b/POCGraphGen @@ -0,0 +1 @@ +Subproject commit 2df6663984812f6dbfaf49c9725e56964cff6e55 diff --git a/POCSite b/POCSite new file mode 160000 index 0000000..71b1696 --- /dev/null +++ b/POCSite @@ -0,0 +1 @@ +Subproject commit 71b1696c52f396a11d65356069fd959a5730ad1d diff --git a/README.md b/README.md new file mode 100644 index 0000000..aab5745 --- /dev/null +++ b/README.md @@ -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. diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..249b09a --- /dev/null +++ b/compose.yml @@ -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