https://github.com/maevsi/postgraphile
Vibetype's backend interface.
https://github.com/maevsi/postgraphile
Last synced: about 2 months ago
JSON representation
Vibetype's backend interface.
- Host: GitHub
- URL: https://github.com/maevsi/postgraphile
- Owner: maevsi
- License: mit
- Created: 2025-01-22T07:51:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-04-03T06:33:23.000Z (2 months ago)
- Last Synced: 2026-04-03T09:42:19.750Z (2 months ago)
- Language: TypeScript
- Homepage: https://postgraphile.vibetype.app/graphiql
- Size: 263 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: CODEOWNERS
- Agents: AGENTS.md
Awesome Lists containing this project
README
# π @maevsi/postgraphile
> A blazing-fast GraphQL API layer for PostgreSQL, powering the Vibetype event community platform.
## Overview
This is a production-ready **PostGraphile v5** server that automatically generates a powerful GraphQL API directly from your PostgreSQL schema. It's a core service of the [Vibetype](https://github.com/maevsi/vibetype) platform, seamlessly converting database changes into a secure, performant GraphQL interface.
### β¨ Key Features
- **π Auto-Generated GraphQL API**: Full CRUD operations from your PostgreSQL schema
- **π PostGIS Support**: Built-in geospatial capabilities with `@graphile/postgis`
- **π JWT Authentication**: ES256 ECDSA-signed tokens with claim-based authorization
- **β‘ Grafast Optimizations**: Deep SQL query optimization and N+1 prevention
- **π¨ Amber Preset**: Sensible defaults for a modern development experience
- **π¦ TypeScript Ready**: Full type safety from database to API
- **π³ Docker Native**: Containerized with automatic pnpm setup
## Quick Start
### Prerequisites
**Node.js**, **PostgreSQL** with Vibetype schema migrations applied via [sqitch](https://github.com/maevsi/sqitch), and **pnpm**.
### Development
```bash
pnpm install # Install dependencies
pnpm run lint # Lint code
# Docker
docker build -t maevsi/postgraphile .
```
## Architecture
This service is part of the **Vibetype platform**, an event community ecosystem:
```
βββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Nuxt) β
ββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β GraphQL
ββββββββββββββββΌβββββββββββββββββββββββββββββββ
β GraphQL API (PostGraphile) β
ββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β SQL queries and mutations
ββββββββββββββββΌβββββββββββββββββββββββββββββββ
β Database (PostgreSQL) β
ββββββββββββββββ²βββββββββββββββββββββββββββββββ
β SQL schema
ββββββββββββββββ΄βββββββββββββββββββββββββββββββ
β Migrations (Sqitch) β
βββββββββββββββββββββββββββββββββββββββββββββββ
```
See [maevsi/stack](https://github.com/maevsi/stack) for the full Docker setup.
## Project Structure
```
src/
βββ graphile.config.ts # Main PostGraphile configuration
βββ graphile.ts # Scripted logic
βββ environment.ts # Type-safe environment utilities
```
### Authentication
Authentication uses ES256 (ECDSA) for signing JWTs; tokens use `postgraphile` as both issuer and audience and are represented in PostgreSQL by the composite type `vibetype.jwt`.
The signing keys and related secrets are best configured via environment variables in [maevsi/stack](https://github.com/maevsi/stack).
### Docker
The included `docker-entrypoint.sh` automatically:
- Loads environment variables from `/run/environment-variables` (Docker secrets)
- Installs dependencies in development mode
- Passes control to the `postgraphile` command
## Resources
- π [PostGraphile Documentation](https://www.graphile.org/postgraphile/)
- πΊοΈ [PostGIS Reference](https://postgis.net/)
- π [PostgreSQL Docs](https://www.postgresql.org/docs/)
- πͺ [Vibetype Platform](https://github.com/maevsi/vibetype)
- ποΈ [Full Stack (Docker Compose)](https://github.com/maevsi/stack)
---
**Questions or Issues?** [Open an issue](https://github.com/maevsi/postgraphile/issues), we're here to help!