This starter project makes creating Apollo Federated subgraphs with Prisma.io and GraphQL Nexus a breeze.
git clone https://github.com/RafaelMLMacedo/federated-nexus-prisma-subgraph-template.git YOUR_FOLDER_NAME
cd YOUR_FOLDER_NAME
yarn install$ cp .env.example .env
$ cp prisma/.env.example prisma/.envStart coding! package.json and entry files are already set up for you, so don't worry about linking to your main file, typings, etc. Just keep those files with the same name.
- Zero-setup. After running
yarn installthings will set up for you 😉 - Postgres database out of the box
- Tests, coverage and interactive watch mode using Jest
- Prettier and TSLint for code formatting and consistency
- Docs automatic generation and deployment to
gh-pages, using TypeDoc - Automatic types
(*.d.ts)file generation docker-compose.ymldeploys a postgres database to persist your development data without hassle.- Using Commitizen and Husky (for the git hooks)
yarn preinstall: Checks if you're using yarn or NPM. If you're using NPM, an error is thrownyarn prepare: Installs (husky hooks)yarn clean: Deletes the./generatedfolderyarn lint: Lints the code to improve consistencyyarn build: Deletes the./generatedfolder, generates Prisma and Nexus typings and executes the TypeScripttscyarn dev: Starts a server on port4001(if no other value forSERVER_PORTis provided on./.envfile)dev:type:check: Checks for TypeScript errors on the fly, watching you're changes.yarn database:compose: Runs thedocker-compose up -dthat deploys thepostgresdatabaseyarn prisma:migrate:dev: Create migrations from your Prisma schema, apply them to the database, generate artifacts (e.g. Prisma Client)yarn prisma:migrate:deploy: If there are any changes locally and the database, prisma will deploy your changes to the database.yarn prisma:migrate:reset: Reset your database and apply all migrationsyarn generate: Generates Prisma artifacts andyarn test: Jest runs your*.(spec|test).(ts|tsx|js)as the chosen suite to develop with confidence.
From now on, you'll need to use npm run commit, which is a convenient way to create conventional commits.
Follow conventional commit messages
There is already set a pre-commit hook for formatting your code with Prettier 💅
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
