On this pagePrerequisites

Build from Source

Grengin is open source. Build the API (Rust) and the web app (Svelte, with Node.js and pnpm) yourself, and run the full stack locally.

1 min read v1

Prerequisites

ToolVersionNeeded for
GitrecentCloning
Rust1.91+The API
pkg-config, C compiler, Perl, OpenSSL headersAPI TLS dependencies
Node.js22The web app
pnpm9+The web app (not npm or yarn)
PostgreSQL16+, with pgvector and ltreeRunning the API
DockeroptionalRunning PostgreSQL

Enable pnpm with Corepack (ships with Node.js):

corepack enable

Repositories

RepositoryContents
grengin-oss/grengin-api (opens in a new tab)The API
grengin-oss/grengin (opens in a new tab)The web app

Build

  1. Clone both

    git clone https://github.com/grengin-oss/grengin-api.git
    git clone https://github.com/grengin-oss/grengin.git
    
  2. Build the API Outputs target/release/grengin-api and sqlx-mcp (built-in database MCP server). --jobs 2 saves memory on small machines.

    cd grengin-api
    cargo build --release --locked --workspace --jobs 2
    
  3. Build the web app Outputs dist/, calling /api on the same origin. For another origin, set VITE_API_BASE at build time.

    cd grengin
    pnpm install
    pnpm build
    

    Checks: pnpm check, pnpm test.

Run the full stack locally

  1. Start PostgreSQL with pgvector

    docker run -d --name grengin-postgres \
      -e POSTGRES_USER=grengin \
      -e POSTGRES_PASSWORD=grengin \
      -e POSTGRES_DB=grengin \
      -p 5432:5432 \
      pgvector/pgvector:pg16
    
  2. Configure the API In grengin-api/, copy the sample, then set at least these. All variables →

    cp src/sample.env .env
    
    DATABASE_URL=postgres://grengin:grengin@localhost:5432/grengin
    JWT_SECRET=<output of: openssl rand -hex 32>
    APP_KEY=<output of: openssl rand -base64 32>
    REDIRECT_URL=http://localhost:5173
    HOST=127.0.0.1
    PORT=3000
    FILE_STORAGE_ROOT=/tmp/grengin/files
    
    • PORT=3000 matches the web app’s dev server, which sends /api to http://localhost:3000.
    • Sign-in Register a Google or Entra OAuth app with callback http://localhost:5173/auth/google/callback (or /auth/azure/callback), then set GOOGLE_CLIENT_* or AZURE_*.
  3. Run the API Load the settings into your shell, then start it. Migrations run at startup. API on http://localhost:3000/, Swagger UI at /swagger-ui.

    set -a; . ./.env; set +a
    export SWAGGER_UI_OVERWRITE_FOLDER="$PWD/swagger-overrides"
    cargo run --locked
    
  4. Run the web app In grengin/, with VITE_API_BASE unset.

    pnpm dev
    
  5. Sign in http://localhost:5173. First sign-in becomes Super Admin; add keys in Control Hub → AI Engines.

Was this page helpful?
GitHub (opens in a new tab)