{"id":51151208,"url":"https://github.com/zeepkist/postgraphile","last_synced_at":"2026-06-26T06:03:52.743Z","repository":{"id":279128778,"uuid":"937799154","full_name":"zeepkist/postgraphile","owner":"zeepkist","description":"Custom PostGraphile Docker image for zeepki.st's GraphQL API","archived":false,"fork":false,"pushed_at":"2026-06-13T16:13:44.000Z","size":618,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2026-06-13T18:15:24.634Z","etag":null,"topics":["docker","docker-image","dockerfile","zeepkist"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeepkist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-23T22:55:12.000Z","updated_at":"2026-04-19T15:31:12.000Z","dependencies_parsed_at":"2025-02-24T00:18:34.420Z","dependency_job_id":"b6c5ec19-1eca-425e-9ac4-4dc2e7bd9684","html_url":"https://github.com/zeepkist/postgraphile","commit_stats":null,"previous_names":["zeepkist/postgraphile"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zeepkist/postgraphile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeepkist%2Fpostgraphile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeepkist%2Fpostgraphile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeepkist%2Fpostgraphile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeepkist%2Fpostgraphile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeepkist","download_url":"https://codeload.github.com/zeepkist/postgraphile/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeepkist%2Fpostgraphile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34805099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-image","dockerfile","zeepkist"],"created_at":"2026-06-26T06:03:51.825Z","updated_at":"2026-06-26T06:03:52.714Z","avatar_url":"https://github.com/zeepkist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostGraphile GraphQL API\n\nThis repository provides the **GraphQL API** for the [Zeepkist Community Hub], powering [ZeepCentral], the [GTR mod], and other community services. It exposes a flexible, high-performance GraphQL endpoint backed by PostgreSQL, with custom plugins and observability features.\n\n## Features\n\n- **GraphQL API** for querying and mutating data from the Zeepkist Community Hub [backend](https://github.com/zeepkist/backend)\n- Custom PostGraphile plugins\n- OpenTelemetry integration for distributed tracing and metrics\n- Query cost analysis and enforcement to prevent expensive queries\n- CORS support and request logging\n- Dockerized for easy deployment\n\n## Requirements\n\n- Node.js 18+ (Node 22 recommended)\n- PostgreSQL database\n- Docker (optional, for containerised deployment)\n\n## Getting Started\n\n1. **Clone the repository:**\n    ```sh\n    git clone https://github.com/zeepkist/postgraphile.git\n    cd postgraphile\n    ```\n\n2. **Install dependencies:**\n    ```sh\n    yarn install\n    ```\n\n3. **Configure environment:**\n    - Copy `.env.example` to `.env` and fill in the required values for your database and OpenTelemetry setup.\n\n4. **Start the server:**\n    ```sh\n    yarn start\n    ```\n\n5. **Access GraphiQL:**\n    - Open [http://localhost:5000/](http://localhost:5000/) in your browser for the Ruru GraphiQL interface.\n\n### Docker Deployment\n\nTo build and run the service with Docker:\n\n```sh\ndocker build -t zeepkist/postgraphile .\ndocker run --env-file .env -p 5000:5000 zeepkist/postgraphile\n```\n\n## Structure\n\nThe repository is organized for clarity and extensibility:\n\n```sh\n./\n├── src/\n│   ├── middleware/   # Koa middleware (query cost, metrics, GraphiQL, etc.)\n│   ├── plugins/      # Custom PostGraphile plugins (inflectors, tracing, etc.)\n│   ├── otel.js       # OpenTelemetry setup\n│   └── server.js     # Koa server and PostGraphile integration\n└── Dockerfile        # Docker build instructions\n```\n\n## Custom Plugins\n\n- [`src/plugins/TracePlugin.js`](src/plugins/TracePlugin.js): Adds OpenTelemetry tracing to GraphQL field resolvers.\n- [`src/plugins/PaginationLimitsPlugin.js`](src/plugins/PaginationLimitsPlugin.js): Enforces sensible pagination limits.\n- [`src/plugins/FixForeignKeyNamesPlugin.js`](src/plugins/FixForeignKeyNamesPlugin.js): Customises foreign key field naming.\n- [`src/plugins/ManyToManyInflectorsPlugin.js`](src/plugins/ManyToManyInflectorsPlugin.js): Improves many-to-many relation field names.\n- [`src/plugins/OrderByRelatedInflectorsPlugin.js`](src/plugins/OrderByRelatedInflectorsPlugin.js): Enhances order-by inflection for related tables.\n- [`src/plugins/AddCdnToUrlsPlugin.js`](src/plugins/AddCdnToUrlsPlugin.js): Automatically prepends CDN URLs to asset fields.\n- [`src/plugins/SkipByNodeIdFieldsPlugin.js`](src/plugins/SkipByNodeIdFieldsPlugin.js): Removes `ByNodeId` root query fields.\n\n## Observability\n\n- **Tracing:** OpenTelemetry traces are exported via OTLP (see [`src/otel.js`](src/otel.js)).\n- **Metrics:** Selected request and header metrics are collected for monitoring.\n- **Query Cost:** All GraphQL queries are analyzed for cost before execution (see [`src/middleware/createQueryCostMiddleware.js`](src/middleware/createQueryCostMiddleware.js)).\n\n## Contributing\n\nContributions are welcome! Please open issues or submit pull requests for improvements and bug fixes.\n\n## Documentation\n\n- **GraphQL API:** [graphql.zeepki.st](https://graphql.zeepki.st) (production instance)\n- **Plugins:** See [`src/plugins/`](src/plugins/) for custom plugin implementations.\n- **Middleware:** See [`src/middleware/`](src/middleware/) for request handling logic.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n[Zeepkist Community Hub]: https://github.com/zeepkist\n[ZeepCentral]: https://zeepki.st\n[GTR mod]: https://mod.io/g/zeepkist/m/zeepkist-gtr\n[Zeepkist]: https://store.steampowered.com/app/1440670/Zeepkist/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeepkist%2Fpostgraphile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeepkist%2Fpostgraphile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeepkist%2Fpostgraphile/lists"}