Skip to content

chranderson/ca-next-template

Repository files navigation

CA Next Template - WIP

CA NextJS Template 2024

A template for creating new NextJS apps with: TailwindCSS, Typescript, Jest & Playwright

Commands

pnpm i Installs the dependencies
pnpm dev Starts the development server
pnpm build Builds the application for production
pnpm start Starts the production server, only if built
pnpm lint Runs the linter
pnpm test Runs the unit tests
pnpm test:watch Runs the unit tests in watch mode
pnpm test:e2e Runs the end-to-end tests

Open http://localhost:3000 with your browser to see the result.

Environment Variables

Env variables are managed and validated for type safety with @t3-oss/env-nextjs and require configuration in the file @/lib/env.js.

Testing

Unit tests

Jest is used for unit tests. You can run the tests once or in watch mode.

  • pnpm test // runs once
  • pnpm test:watch // runs in watch mode

End-to-end tests

Playwright is used for end-to-end tests. A github action is configured to run the tests on push and pull request.
Includes a smoke test to ensure home page renders.

To run playwright locally, you must build and start the server first.

  1. pnpm build && pnpm start
  2. pnpm test:e2e

CI & Deployment

Includes github action to run E2E test (playwright) on successful deployment of vercel preview.

About

Starter template repo for Next.js apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published