https://github.com/jcserv/prisma-graphql-api-template
This template can be used to quickly setup a GraphQL API, using Prisma/Typescript/Apollo/Pothos/Relay
https://github.com/jcserv/prisma-graphql-api-template
apollo codegen graphql node postgres pothos prisma typescript
Last synced: about 2 months ago
JSON representation
This template can be used to quickly setup a GraphQL API, using Prisma/Typescript/Apollo/Pothos/Relay
- Host: GitHub
- URL: https://github.com/jcserv/prisma-graphql-api-template
- Owner: jcserv
- License: gpl-3.0
- Created: 2024-11-19T12:15:34.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-11-29T18:22:20.000Z (6 months ago)
- Last Synced: 2025-01-31T19:13:34.901Z (4 months ago)
- Topics: apollo, codegen, graphql, node, postgres, pothos, prisma, typescript
- Language: TypeScript
- Homepage:
- Size: 544 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prisma-graphql-api-template

this template can be used to quickly setup a prisma + graphql + typescipt project,
with all the required configuration out of the box.## features
- ๐ prisma orm, apollo server, pothos, relay
- ๐ end-to-end type safety via code generation (prisma -> pothos)
- ๐ automagical pagination support via relay
- ๐ฆ automatic query optimization to solve n+1 problem (provided via [prisma](https://pothos-graphql.dev/docs/plugins/prisma/connections))
- ๐งช unit/e2e tests setup
- ๐ dev workflow tools galore (vscode, husky, eslint, prettier, etc)
- โ continuous integration with github workflows## installation
### prerequisites
- [node.js](https://nodejs.org/en)
- [pnpm](https://pnpm.io/installation)
- [docker](https://docs.docker.com/get-started/get-docker/)### using this template
1. create a Github repository, using this template
2. replace all instances of "prisma-graphql-api-template" with ""
3. initialize your .env file (see .env.example)
4. go to your github repo settings and add the following secrets:
- DATABASE_URL
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB### running locally
1. clone this repo
2. run `pnpm i`
3. run `pnpm dev:db`
4. run `pnpm dev`
5. visit http://localhost:4000/graphql in your browser### running tests
1. run `pnpm test:db:down`
2. run `pnpm test:db`
3. run `pnpm test`