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)
- Postgres with PgVector (Version: >=15.x)
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 npm
npm install- Get Database Running
cd packages/db
npm run docker:up # Spin up docker container
npm run db:migrate # Run migrations- Generate Prisma Types for each app
cd apps/app
npm run db:generate
cd ../portal
npm run db:generate
cd ../api
npm run db:generate- Run all apps in parallel from the root directory
npm run devCreate the following .env files and fill them out with your credentials
opencomp/apps/app/.envopencomp/apps/portal/.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 packages/db/.env.example packages/db/.envcopy apps\app\.env.example apps\app\.env
copy apps\portal\.env.example apps\portal\.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 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"
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).
-
Create an OAuth client:
- Type: Web Application
- Name:
comp_app# You can choose a different name if you prefer!
-
Add these Authorized Redirect URIs:
http://localhost http://localhost:3000 http://localhost:3002 http://localhost:3000/api/auth/callback/google http://localhost:3002/api/auth/callback/google http://localhost:3000/auth http://localhost:3002/auth -
After creating the app, copy the
GOOGLE_IDandGOOGLE_SECRET- Add them to your
.envfiles - If that doesnβt work, hard-code them in:
opencomp/apps/portal/src/app/lib/auth.ts
- Add them to your
opencomp/packages/kv/src/index.ts
Start and initialize the PostgreSQL database using Docker:
-
Start the database:
cd packages/db npm 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
npm run db:generate
# Push the schema to the database
npm run db:push
# Optional: Seed the database with initial data
npm run db:seedOther useful database commands:
# Open Prisma Studio to view/edit data
npm run db:studio
# Run database migrations
npm run db:migrate
# Stop the database container
npm run docker:down
# Remove the database container and volume
npm run docker:cleanOnce everything is configured:
npm run devOr use the Turbo repo script:
npx turbo devπ‘ Make sure you have Turbo installed. If not, you can install it using npm:
npm install -g turboπ 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 + npm. It builds and starts the API, app, and portal along with Postgres, Redis, and LocalStack (AWS S3):
# 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 emulation), postgres, migrator (Prisma migrate), seeder, api (NestJS), redis, app (Next.js frontend), portal (employee portal).
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
npm install @gideon-defender/ui
# Use in your project
import { Button } from '@gideon-defender/ui/button'
import { client } from '@gideon-defender/kv'# Build all packages
npm run build
# Build specific package
npm run build --workspace=@gideon-defender/ui
# Test packages locally
npm 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.