Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
892c80b
feat(postgraphile)!: upgrade to v5
dargmuesli Feb 16, 2026
8efa844
Merge pull request #10 from maevsi/feat/postgraphile/v5
dargmuesli Feb 20, 2026
34c87df
chore(release): 2.0.0-beta.1 [skip ci]
semantic-release-bot Feb 20, 2026
600aa4c
chore(deps): add maevsi/sqitch v11.0.0-beta.1
dargmuesli Feb 20, 2026
f3f7d82
fix(postgres): readd connection string
dargmuesli Feb 20, 2026
9270ba5
chore(release): 2.0.0-beta.2 [skip ci]
semantic-release-bot Feb 20, 2026
59bf0c5
fix(postgis): update plugin with geojson/srid fix
dargmuesli Feb 24, 2026
6ed597b
chore(release): 2.0.0-beta.3 [skip ci]
semantic-release-bot Feb 24, 2026
369cfe9
fix(grafast): correct context claim value encoding
dargmuesli Feb 24, 2026
dc70e2b
chore(release): 2.0.0-beta.4 [skip ci]
semantic-release-bot Feb 26, 2026
b84ee8c
fix(deps): update postgraphile
dargmuesli Mar 13, 2026
65b70d1
feat(jwt)!: use ecdsa key
dargmuesli Mar 14, 2026
5f3b3be
chore(release): 2.0.0-beta.5 [skip ci]
semantic-release-bot Mar 14, 2026
28afe83
Merge pull request #13 from maevsi/feat/jwt/ecdsa
dargmuesli Mar 14, 2026
05e1b09
chore(release): 2.0.0-beta.6 [skip ci]
semantic-release-bot Mar 14, 2026
d8af90f
chore(deps): upgrade
dargmuesli Apr 2, 2026
0a25782
Merge pull request #14 from maevsi/chore/deps/upgrade
dargmuesli Apr 2, 2026
1db6171
Merge branch 'main' into beta
dargmuesli Apr 2, 2026
aa21ea7
chore(release): 2.0.0-beta.7 [skip ci]
semantic-release-bot Apr 2, 2026
2cee61d
fix(ci): update package version
dargmuesli Apr 2, 2026
652fd00
fix(docker): streamline entrypoint
dargmuesli Apr 2, 2026
8e7f3b4
chore(release): 2.0.0-beta.8 [skip ci]
semantic-release-bot Apr 2, 2026
90ef06f
chore(docker): streamline entrypoint
dargmuesli Apr 2, 2026
8ca4eae
feat(package): update description
dargmuesli Apr 2, 2026
9b730f9
chore(agents): add instructions
dargmuesli Apr 2, 2026
5ee2488
Merge pull request #15 from maevsi/feat/package/description
dargmuesli Apr 2, 2026
e2da9a9
chore(release): 2.0.0-beta.9 [skip ci]
semantic-release-bot Apr 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.eslintcache
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.eslintcache
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}
1 change: 1 addition & 0 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
}
],
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
"@semantic-release/git"
],
Expand Down
3 changes: 1 addition & 2 deletions .renovaterc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>dargmuesli/renovate-config"],
"semanticCommitType": "fix"
"extends": ["github>dargmuesli/renovate-config"]
}
7 changes: 6 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"recommendations": ["editorconfig.editorconfig"]
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"timonwong.shellcheck"
]
}
8 changes: 2 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
"editor.defaultFormatter": "esbenp.prettier-vscode",
"shellcheck.customArgs": ["-x"]
}
24 changes: 24 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
applyTo: '**'
---
# Project Instructions
This project is a PostGraphile v5 server that converts PostgreSQL schemas into a GraphQL API. It defines one of many services of `vibetype`, an event community platform. The PostgreSQL schemas used by this service are applied as SQL migrations by the `sqitch` service.

## Files
- `src/graphile.config.ts` contains the main PostGraphile configuration.
- `src/graphile.ts` contains scripted logic.
- `src/environment.ts` contains type-safe environment variable utilities.

## JWT
- Algorithm: ES256
- Audience, issuer: postgraphile
- PostgreSQL composite type: `vibetype.jwt`

## Workflow
- Lint with `pnpm run lint`.

## General
- Code style
- Sort any elements (imports, object properties, functions, ...), e.g. alphabetically, except when it doesn't make sense.
- Agents
- After making changes to the codebase, ensure AGENTS.md is in sync with your knowledge of the project.
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
## [2.0.0-beta.9](https://github.com/maevsi/postgraphile/compare/2.0.0-beta.8...2.0.0-beta.9) (2026-04-02)

### Features

* **package:** update description ([8ca4eae](https://github.com/maevsi/postgraphile/commit/8ca4eae7077cb47685c8bb0386e8461102b94232))

## [2.0.0-beta.8](https://github.com/maevsi/postgraphile/compare/2.0.0-beta.7...2.0.0-beta.8) (2026-04-02)

### Bug Fixes

* **ci:** update package version ([2cee61d](https://github.com/maevsi/postgraphile/commit/2cee61d162d4be6d14cfe218c013c464f8fe05a8))
* **docker:** streamline entrypoint ([652fd00](https://github.com/maevsi/postgraphile/commit/652fd00895437de3f8be89c025d49381ee356854))

## [2.0.0-beta.7](https://github.com/maevsi/postgraphile/compare/2.0.0-beta.6...2.0.0-beta.7) (2026-04-02)

### Bug Fixes

* schedule release ([65f684f](https://github.com/maevsi/postgraphile/commit/65f684f7db2e3997f68dba3ff36f5b4eb82430f3))
* schedule release ([5f7b799](https://github.com/maevsi/postgraphile/commit/5f7b79993efba96442d7aad7f5e09ca63043e63f))

## [2.0.0-beta.6](https://github.com/maevsi/postgraphile/compare/2.0.0-beta.5...2.0.0-beta.6) (2026-03-14)

### ⚠ BREAKING CHANGES

* **jwt:** use ecdsa key

### Features

* **jwt:** use ecdsa key ([65b70d1](https://github.com/maevsi/postgraphile/commit/65b70d1365b8f5871042fc8e562d09b234116408))

## [2.0.0-beta.5](https://github.com/maevsi/postgraphile/compare/2.0.0-beta.4...2.0.0-beta.5) (2026-03-14)

### Bug Fixes

* **deps:** update postgraphile ([b84ee8c](https://github.com/maevsi/postgraphile/commit/b84ee8cce462bf0573408fc436163934715ae71b))

## [2.0.0-beta.4](https://github.com/maevsi/postgraphile/compare/2.0.0-beta.3...2.0.0-beta.4) (2026-02-26)

### Bug Fixes

* **grafast:** correct context claim value encoding ([369cfe9](https://github.com/maevsi/postgraphile/commit/369cfe9981f87fc85e14f2496af13c94877c6592))

## [2.0.0-beta.3](https://github.com/maevsi/postgraphile/compare/2.0.0-beta.2...2.0.0-beta.3) (2026-02-24)

### Bug Fixes

* **postgis:** update plugin with geojson/srid fix ([59bf0c5](https://github.com/maevsi/postgraphile/commit/59bf0c5415e07617160475d8398e25ecd4d3f2e7))

## [2.0.0-beta.2](https://github.com/maevsi/postgraphile/compare/2.0.0-beta.1...2.0.0-beta.2) (2026-02-20)

### Bug Fixes

* **postgres:** readd connection string ([f3f7d82](https://github.com/maevsi/postgraphile/commit/f3f7d82cbf2dc363c76b2f2c198e2015746dc6f5))

## [2.0.0-beta.1](https://github.com/maevsi/postgraphile/compare/1.0.19...2.0.0-beta.1) (2026-02-20)

### ⚠ BREAKING CHANGES

* **postgraphile:** upgrade to v5

### Features

* **postgraphile:** upgrade to v5 ([892c80b](https://github.com/maevsi/postgraphile/commit/892c80bde0d35725a01f204f87fd8d78159682b8))

## [1.0.21](https://github.com/maevsi/postgraphile/compare/1.0.20...1.0.21) (2026-03-26)

### Bug Fixes
Expand Down
99 changes: 97 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,98 @@
FROM graphile/postgraphile:4.14.1 AS development
# syntax=docker/dockerfile:1

RUN yarn add @graphile/postgis
# <DEPENDENCIES>
FROM ghcr.io/maevsi/sqitch:11.0.0-beta.1
# </DEPENDENCIES>

########################
# Create base.

FROM node:24.13.1-alpine AS base

# The `CI` environment variable must be set for pnpm to run in headless mode
ENV CI=true

WORKDIR /srv/app/

RUN corepack enable


########################
# Serve development.

FROM base AS development

ENV GRAPHILE_ENV=development

RUN mkdir \
/srv/.pnpm-store \
/srv/app/node_modules \
&& chown node:node \
/srv/.pnpm-store \
/srv/app/node_modules
VOLUME /srv/.pnpm-store
VOLUME /srv/app
VOLUME /srv/app/node_modules

USER node
ENTRYPOINT ["/srv/app/docker-entrypoint.sh"]
CMD ["pnpm", "exec", "postgraphile", "--config", "./src/graphile.config.ts", "-n", "0.0.0.0"]
EXPOSE 5678
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD wget -q --spider http://127.0.0.1:5678/ || exit 1


########################
# Prepare environment.

FROM base AS prepare

COPY ./pnpm-lock.yaml ./package.json ./graphile-postgis-v0.2.0.tgz ./

RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
pnpm fetch

COPY ./ ./

RUN pnpm install --offline


########################
# Lint code.

FROM prepare AS lint

RUN pnpm run lint


########################
# Build for production.

FROM prepare AS build

RUN pnpm install --offline --prod


########################
# Collect results.

FROM base AS collect

COPY --from=prepare /srv/app/src ./src
COPY --from=prepare /srv/app/docker-entrypoint.sh /srv/app/package.json ./
COPY --from=build /srv/app/node_modules ./node_modules
COPY --from=lint /srv/app/package.json /dev/null


########################
# Serve production.

FROM collect AS production

ENV NODE_ENV=production

USER node
ENTRYPOINT ["/srv/app/docker-entrypoint.sh"]
CMD ["pnpm", "exec", "postgraphile", "--config", "./src/graphile.config.ts", "-n", "0.0.0.0"]
EXPOSE 5678
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD wget -q --spider http://127.0.0.1:5678/ || exit 1
LABEL org.opencontainers.image.description="PostGraphile GraphQL API for the Vibetype platform; includes @graphile/postgis, Amber preset, Grafast optimizations, and JWT authentication."
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# postgraphile

Vibetype's postgraphile container image amends the default by the `@graphile/postgis` plugin.
PostGraphile GraphQL API for the Vibetype platform; includes @graphile/postgis, Amber preset, Grafast optimizations, and JWT authentication.
38 changes: 38 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh
set -eu

ENVIRONMENT_VARIABLES_PATH="/run/environment-variables"

is_valid_var_name() {
case "$1" in
''|[!a-zA-Z_]*|*[!a-zA-Z0-9_]*) return 1 ;;
*) return 0 ;;
esac
}

load_env_file() {
file="$1"
name=$(basename "$file")
is_valid_var_name "$name" || return 0
value="$(printf '%s' "$(cat "$file")")"
export "$name=$value"
}

load_environment_variables() {
[ -d "$ENVIRONMENT_VARIABLES_PATH" ] || return 0
set -- "$ENVIRONMENT_VARIABLES_PATH"/*
[ -e "$1" ] || return 0

for file in "$ENVIRONMENT_VARIABLES_PATH"/*; do
[ -f "$file" ] && load_env_file "$file"
done
}

load_environment_variables

if [ "$NODE_ENV" != "production" ]; then
pnpm config set store-dir "/srv/.pnpm-store"
pnpm install
fi

exec "$@"
21 changes: 21 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import js from '@eslint/js'
import json from '@eslint/json'
import { defineConfig } from 'eslint/config'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import tseslint from 'typescript-eslint'

export default defineConfig([
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts}'],
plugins: { js },
extends: ['js/recommended'],
},
tseslint.configs.recommended,
{
files: ['**/*.json'],
plugins: { json },
language: 'json/json',
extends: ['json/recommended'],
},
eslintPluginPrettierRecommended,
])
Binary file added graphile-postgis-v0.2.0.tgz
Binary file not shown.
42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"author": "Jonas Thelemann <e-mail+maevsi_postgraphile@jonas-thelemann.de>",
"bugs": {
"url": "https://github.com/maevsi/postgraphile/issues"
},
"dependencies": {
"@graphile/postgis": "file:graphile-postgis-v0.2.0.tgz",
"jose": "6.2.2",
"postgraphile": "5.0.0"
},
"description": "PostGraphile GraphQL API for the Vibetype platform; includes @graphile/postgis, Amber preset, Grafast optimizations, and JWT authentication.",
"devDependencies": {
"@eslint/js": "10.0.1",
"@eslint/json": "1.2.0",
"eslint": "10.1.0",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-prettier": "5.5.5",
"grafserv": "1.0.0",
"graphile": "5.0.0",
"jiti": "2.6.1",
"prettier": "3.8.1",
"typescript": "6.0.2",
"typescript-eslint": "8.58.0"
},
"homepage": "https://github.com/maevsi/postgraphile#readme",
"license": "MIT",
"name": "@maevsi/postgraphile",
"packageManager": "pnpm@10.29.3",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/maevsi/postgraphile.git"
},
"scripts": {
"lint": "pnpm run lint:es && pnpm run lint:ts",
"lint:es": "eslint --cache",
"lint:fix": "pnpm run lint:es --fix",
"lint:ts": "tsc --noEmit"
},
"type": "module",
"version": "2.0.0-beta.9"
}
Loading
Loading