prisma-cms / nextjs-nexus

@prisma-cms + nexus + prisma-2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@prisma-cms/nextjs Typescript Boilerplate

Based on

Bootstrap a developer-friendly NextJS app configured with:

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

# Clone project
git clone https://github.com/prisma-cms/nextjs-nexus.git

# Install dependencies
yarn install

# Clone and edit .env file
cp .env.sample .env

# Deploy database migrations (set MySQL connection credentioals in .env file)
yarn prisma:deploy

# Build bundles
yarn build

# Start bundled project
yarn start

Development

  1. Edit prisma shema in prisma/schema.prisma

  2. Push change to database

yarn prisma:db:push
  1. Create migration
yarn prisma:migrate:create --name migration_name
  1. Generate front GraphQL schema and types
yarn generate:types
  1. Start server in development mode
yarn dev

Tests

Eslint

yarn lint

Typescript types checking

yarn types

Jest unit tests

yarn test

Test code coverage

yarn test --coverage

Jest unit tests real API

Attension! For unit tests with real API started server required.

Build

  1. Generate schemas if changed
yarn generate
  1. Build bundles
# Build bundles
yarn build

# Start bundled project
yarn start

After this open yet another terminal and run tests

yarn test:api

Run all test

yarn test:all

Analyze bundles

yarn build:analyze

Storybook

dev

yarn storybook

build storybook

yarn build:storybook

Deploy it to the cloud with Vercel (Documentation).

About

@prisma-cms + nexus + prisma-2


Languages

Language:TypeScript 93.8%Language:JavaScript 5.8%Language:Dockerfile 0.4%