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.
Prerequisites
| Tool | Version | Needed for |
|---|---|---|
| Git | recent | Cloning |
| Rust | 1.91+ | The API |
pkg-config, C compiler, Perl, OpenSSL headers | API TLS dependencies | |
| Node.js | 22 | The web app |
| pnpm | 9+ | The web app (not npm or yarn) |
| PostgreSQL | 16+, with pgvector and ltree | Running the API |
| Docker | optional | Running PostgreSQL |
Enable pnpm with Corepack (ships with Node.js):
corepack enable
Repositories
| Repository | Contents |
|---|---|
| grengin-oss/grengin-api (opens in a new tab) | The API |
| grengin-oss/grengin (opens in a new tab) | The web app |
Build
-
Clone both
git clone https://github.com/grengin-oss/grengin-api.git git clone https://github.com/grengin-oss/grengin.git -
Build the API Outputs
target/release/grengin-apiandsqlx-mcp(built-in database MCP server).--jobs 2saves memory on small machines.cd grengin-api cargo build --release --locked --workspace --jobs 2 -
Build the web app Outputs
dist/, calling/apion the same origin. For another origin, setVITE_API_BASEat build time.cd grengin pnpm install pnpm buildChecks:
pnpm check,pnpm test.
Run the full stack locally
-
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 -
Configure the API In
grengin-api/, copy the sample, then set at least these. All variables →cp src/sample.env .envDATABASE_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/filesPORT=3000matches the web app’s dev server, which sends/apitohttp://localhost:3000.- Sign-in Register a Google or Entra OAuth app with callback
http://localhost:5173/auth/google/callback(or/auth/azure/callback), then setGOOGLE_CLIENT_*orAZURE_*.
-
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 -
Run the web app In
grengin/, withVITE_API_BASEunset.pnpm dev -
Sign in
http://localhost:5173. First sign-in becomes Super Admin; add keys in Control Hub → AI Engines.
Related
- Configuration Reference Every variable the API reads.
- Install on Your Server Install a release with one command instead.
- Docker The published container images.