Skip to content
Β 
Β 

Latest commit

Β 

History

8,246 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Logo

Gideon Defender OpenComp

The open-source compliance platform.
Learn more Β»

Website Β· Documentation Β· Issues Β· Roadmap

Github Stars License Commits-per-month

About

AI that handles compliance for you in hours.

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.

Built With

Contact us

Contact our team at info@gideondefender.com to learn more about how we can help you achieve compliance.

Stay Up-to-Date

Get access to the cloud hosted version of OpenComp.

Getting Started

To get a local copy up and running, please follow these simple steps.

Prerequisites

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)

Development

To get the project working locally with all integrations, follow these extended development steps

Setup

Add environment variables and fill them out with your credentials

cp apps/app/.env.example apps/app/.env
cp apps/portal/.env.example apps/portal/.env
cp packages/db/.env.example packages/db/.env

Get code running locally

  1. Clone the repo
git clone https://github.com/gideon-security/opencomp.git
  1. Navigate to the project directory
cd opencomp
  1. Install dependencies using npm
npm install
  1. Get Database Running
cd packages/db
npm run docker:up # Spin up docker container
npm run db:migrate # Run migrations
  1. 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
  1. Run all apps in parallel from the root directory
npm run dev

Environment Setup

Create the following .env files and fill them out with your credentials

  • opencomp/apps/app/.env
  • opencomp/apps/portal/.env
  • opencomp/packages/db/.env

You can copy from the .env.example files:

Linux / macOS

cp apps/app/.env.example apps/app/.env
cp apps/portal/.env.example apps/portal/.env
cp packages/db/.env.example packages/db/.env

Windows (Command Prompt)

copy apps\app\.env.example apps\app\.env
copy apps\portal\.env.example apps\portal\.env
copy packages\db\.env.example packages\db\.env

Windows (PowerShell)

Copy-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\.env

Additionally, 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 .env file. If you're copying from .env.example, it might be missing the last two (NEXT_PUBLIC_PORTAL_URL and REVALIDATION_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).


Cloud & Auth Configuration

1. Google OAuth

  • Go to Google Cloud OAuth Console

  • 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_ID and GOOGLE_SECRET

    • Add them to your .env files
    • If that doesn’t work, hard-code them in:
      opencomp/apps/portal/src/app/lib/auth.ts
      

2. Redis

opencomp/packages/kv/src/index.ts

Database Setup

Start and initialize the PostgreSQL database using Docker:

  1. Start the database:

    cd packages/db
    npm run docker:up
  2. Default credentials:

    • Database name: comp
    • Username: postgres
    • Password: postgres
  3. To change the default password:

    ALTER USER postgres WITH PASSWORD 'new_password';
  4. 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.sql

    Expected output: CREATE FUNCTION

    πŸ’‘ comp is the database name. Make sure to use the correct port and database name for your setup.

  5. 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:seed

Other 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:clean

Start Development

Once everything is configured:

npm run dev

Or 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! πŸš€

Full Stack with Docker Compose

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 down

Services: localstack (S3 emulation), postgres, migrator (Prisma migrate), seeder, api (NestJS), redis, app (Next.js frontend), portal (employee portal).

Deployment

Docker

Steps to deploy OpenComp on Docker are coming soon.

πŸ“¦ Package Publishing

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

Setup

  1. NPM Token: Add your npm token as NPM_TOKEN in GitHub repository secrets
  2. Release Branch: Create and merge PRs into the release branch to trigger publishing
  3. Versioning: Uses conventional commits for automatic version bumping

Usage

# 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'

Development

# Build all packages
npm run build

# Build specific package
npm run build --workspace=@gideon-defender/ui

# Test packages locally
npm run release:packages -- --dry-run

License

OpenComp 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.

About

Open Source compliance assessment portal

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages