/next-ts-graphql-blog

The classic blog project. Built for learning purposes and self practice

Primary LanguageTypeScript

NextJS / React / Typescript / Tailwind / GraphQL / GraphCMS

CI Production Coverage Badge

Description

This project has been build for the purpose of learning and practicing the following technologies:

- Typescript
- Next JS / React
- GraphQL
- GraphCMS

Will also setup some basic tools for CI/CD. Also planning to include cypress e2e tests.

Installation

Clone the repo and run the following commands at the root of the project: Copy the .env.example file to .env and replace the XXXXX values.

    yarn install
    yarn dev
    yarn prepare // Installs the pre-commit hooks

Linting

This project uses Prettier and ESLint in Google Style config to perform static checks on all the code.

TypeScript

This project uses TypeScript to simplify JavaScript allowing to be read and to debug easier.

Husky

This project is using husky to prevent issues while we're trying to push/commit our code to remote.

Husky Checks

- Code Style Standards
- Linting Standards
- Typescript Standards
- Successful build test
- Staged File Checks (-all of the above)

Commands

  • yarn dev: Starts the project in development mode
  • yarn build: Builds the project for production
  • yarn start : Starts the production server
  • yarn check-types : Checks for typescript errors
  • yarn check-format : Checks for code style errors
  • yarn check-lint : Checks for linting errors
  • yarn format : Runs format on all files
  • yarn lint : Runs check-types, check-format and check-lint
  • yarn test : Runs test suites
  • yarn test:coverage : Runs test suites with coverage report generation
  • yarn test-all : Runs all pre-push checks (format, types, lint, test, prod-build)
  • yarn prepare : Installs pre-commit husky hooks