The open-source compliance platform.
Learn more »
Website
·
Documentation
·
Issues
·
Roadmap
OpenComp is the fastest way to get compliant with frameworks like SOC 2, ISO 27001, HIPAA and GDPR. OpenComp automates evidence collection, policy management, and control implementation while keeping you in control of your data and infrastructure.
Contact our team at info@gideondefender.com to learn more about how we can help you achieve compliance.
Get access to the cloud hosted version of OpenComp.
To get a local copy up and running, please follow these simple steps.
Here is what you need to be able to run OpenComp.
- Node.js (Version: >=22.x)
- npm (Version: >=10.x)
- Docker (Version: >=24.x) or Podman (Version: >=5.x)
- Postgres with PgVector (Version: >=15.x)
- A Gemini API key (for AI-powered onboarding — free tier works, but has a low daily request cap)
To get the project working locally with all integrations, follow these extended development steps
cp apps/app/.env.example apps/app/.env
cp apps/portal/.env.example apps/portal/.env
cp packages/db/.env.example packages/db/.env- Clone the repo
git clone https://github.com/gideon-security/opencomp.git- Navigate to the project directory
cd opencomp- Install dependencies using pnpm (v10+, managed via
packageManager— corepack activates the pinned version)
pnpm install- Get Database Running
cd packages/db
pnpm run docker:up # Spin up docker container
pnpm run db:migrate # Run migrations- Generate Prisma Types for each app
cd apps/app
pnpm run db:generate
cd ../portal
pnpm run db:generate
cd ../api
pnpm run db:generate- Run all apps in parallel from the root directory
pnpm run devCreate the following .env files and fill them out with your credentials
opencomp/apps/app/.envopencomp/apps/portal/.envopencomp/apps/api/.envopencomp/packages/db/.env
You can copy from the .env.example files:
cp apps/app/.env.example apps/app/.env
cp apps/portal/.env.example apps/portal/.env
cp apps/api/.env.example apps/api/.env
cp packages/db/.env.example packages/db/.envcopy apps\app\.env.example apps\app\.env
copy apps\portal\.env.example apps\portal\.env
copy apps\api\.env.example apps\api\.env
copy packages\db\.env.example packages\db\.envCopy-Item apps\app\.env.example -Destination apps\app\.env
Copy-Item apps\portal\.env.example -Destination apps\portal\.env
Copy-Item apps\api\.env.example -Destination apps\api\.env
Copy-Item packages\db\.env.example -Destination packages\db\.envAdditionally, ensure the following required environment variables are added to .env in opencomp/apps/app/.env:
AUTH_SECRET="" # Use `openssl rand -base64 32` to generate
DATABASE_URL="postgresql://user:password@host:port/database"
REDIS_URL="redis://localhost:6379" # Shared by the kv layer and BullMQ
GOOGLE_GENERATIVE_AI_API_KEY="" # Gemini — powers AI onboarding (https://ai.google.dev/api-keys)
RESEND_API_KEY="" # Resend (https://resend.com/api-keys) - Resend Dashboard -> API Keys
NEXT_PUBLIC_PORTAL_URL="http://localhost:3002"
REVALIDATION_SECRET="" # Use `openssl rand -base64 32` to generate✅ Make sure you have all of these variables in your
.envfile. If you're copying from.env.example, it might be missing the last two (NEXT_PUBLIC_PORTAL_URLandREVALIDATION_SECRET), so be sure to add them manually.
Some environment variables may not load correctly from .env — in such cases, hard-code the values directly in the relevant files (see Hardcoding section below).
Sign-in is handled by the external Gideon identity provider (OIDC) — there is
no per-developer OAuth client setup. Legacy logins (Google/GitHub/Microsoft
social, magic link) were removed; their AUTH_* variables no longer exist.
The API needs a Gideon OIDC client registration (ask the auth team for the
per-environment client ID). Configure it in opencomp/apps/api/.env (see the
documented GIDEON_OIDC_* block in apps/api/.env.example):
GIDEON_OIDC_CLIENT_ID="" # e.g. opencomp-local (registered with auth team)
GIDEON_OIDC_REDIRECT_URI="" # e.g. http://localhost:3333/v1/auth/gideon/callback
# GIDEON_OIDC_CLIENT_SECRET="" # only for confidential apps; public apps use PKCERedis is configured via the REDIS_URL environment variable (regular Redis —
no Upstash required):
REDIS_URL="redis://localhost:6379"
The @gideon-defender/kv package and the local BullMQ trigger runtime both
read this variable. Optional hardening: LOCAL_TRIGGER_REDIS_URL points at a
full-access (comp_service) Redis role for BullMQ, falling back to
REDIS_URL when unset.
The app ships with English and Spanish locales. The locale is resolved from
the NEXT_LOCALE cookie; clear that cookie to fall back to English. All UI
strings live in apps/app/messages/en.json and apps/app/messages/es.json
— keep both files in sync when adding keys.
# App unit tests (Vitest)
cd apps/app && pnpm exec vitest run
# API unit tests (Jest) — loads apps/api/.env automatically
cd apps/api && pnpm exec jest --forceExit
# API e2e tests — needs a local Postgres + migrations applied
cd apps/api && pnpm run test:e2e
# App e2e tests (Playwright) — boots the full stack; see .github/workflows/e2e.yml
cd apps/app && pnpm exec playwright test --project=chromiumStart and initialize the PostgreSQL database using Docker:
-
Start the database:
cd packages/db pnpm run docker:up -
Default credentials:
- Database name:
comp - Username:
postgres - Password:
postgres
- Database name:
-
To change the default password:
ALTER USER postgres WITH PASSWORD 'new_password';
-
If you encounter the following error:
HINT: No function matches the given name and argument types...Run the fix:
psql "postgresql://postgres:<your_password>@localhost:5432/comp" -f ./packages/db/prisma/functionDefinition.sqlExpected output:
CREATE FUNCTION💡
compis the database name. Make sure to use the correct port and database name for your setup. -
Apply schema and seed:
# Generate Prisma client
pnpm run db:generate
# Push the schema to the database
pnpm run db:push
# Optional: Seed the database with initial data
pnpm run db:seedOther useful database commands:
# Open Prisma Studio to view/edit data
pnpm run db:studio
# Run database migrations
pnpm run db:migrate
# Stop the database container
pnpm run docker:down
# Remove the database container and volume
pnpm run docker:cleanOnce everything is configured:
pnpm run devOr use the Turbo repo script (turbo is a root devDependency, no global install needed):
pnpm exec turbo dev🎉 Yay! You now have a working local instance of Gideon Defender OpenComp! 🚀
The monorepo ships a Docker-based local stack that runs everything with node:22 + pnpm. It builds and starts the API, app, and portal along with Postgres, Redis, and LocalStack (AWS S3). Podman works too (alias docker=podman, or podman-compose):
# Build and start the whole stack (app on :3000, portal on :3002, api on :3333)
docker-compose up -d --build
# Run database migrations and seed data
docker-compose run --rm migrator
docker-compose run --rm seeder
# Tail logs for a service (e.g. the app)
docker-compose logs -f app
# Stop everything
docker-compose downServices: localstack (S3/SES emulation), postgres (pgvector), migrator (Prisma migrate), seeder, api (NestJS), redis, app (Next.js frontend), portal (employee portal), email-worker (SQS email consumer), embeddings (self-hosted BAAI/bge-m3 via Ollama).
💡 Note: each service's container env overrides the matching
.envfile entries for in-container hostnames (e.g. the portal getsDATABASE_URL=…@postgres:5432while host-side tooling useslocalhost:5432).
Steps to deploy OpenComp on Docker are coming soon.
This repository uses semantic-release to automatically publish packages to npm when merging to the release branch. The following packages are published:
@gideon-defender/db- Database utilities with Prisma client@gideon-defender/email- Email templates and components@gideon-defender/kv- Key-value store utilities using Redis@gideon-defender/ui- UI component library with Tailwind CSS
- NPM Token: Add your npm token as
NPM_TOKENin GitHub repository secrets - Release Branch: Create and merge PRs into the
releasebranch to trigger publishing - Versioning: Uses conventional commits for automatic version bumping
# Install a published package
pnpm add @gideon-defender/ui
# Use in your project
import { Button } from '@gideon-defender/ui/button'
import { client } from '@gideon-defender/kv'# Build all packages
pnpm run build
# Build specific package
pnpm --filter=@gideon-defender/ui run build
# Test packages locally
pnpm run release:packages -- --dry-runOpenComp is an open-source software, licensed under AGPLv3
Tip
We work closely with the community and always invite feedback about what should be open and what is fine to be commercial. This list is not set and stone and we have moved things from commercial to open in the past. Please open a discussion if you feel like something is wrong.