Next.js starter/boilerplate project with the following:
- Tailwind CSS.
- shadcn/ui components and Lucide icons.
- React Hook Form for forms.
- Zod for schema validation.
- Vitest and React Testing Library for unit and component tests.
- Playwright for end-to-end tests.
- Prettier and ESLint with tailored configs.
- Custom VSCode config.
- GitHub Actions for running linter, formatter and tests.
- Great match for your next billion-dollar startup π
The project has a few example pages and route handlers with tests, including a simple AI chat bot example, made with OpenAI Node API Library and Vercel AI SDK. You can delete these if you don't need them.
-
Make sure you have Node.js 20 installed.
-
Install
pnpm
.corepack enable corepack prepare pnpm@latest --activate
-
Create a new project from this template.
pnpm dlx degit IgorKrupenja/nextjs-starter my-billion-dollar-startup
-
Install dependencies.
cd my-billion-dollar-startup pnpm install
-
If you want to use the chat bot example, create
.env.local
file and add your OpenAI API key to that file.touch .env.local echo "OPENAI_API_KEY=your-api-key" >> .env.local
pnpm dev
The starter project aims to have near-100% test coverage. Note that components inside src/components/ui
are created by the external shadcn-ui
library and are thus not in scope for testing. You can run unit tests with:
pnpm test
And to check coverage:
pnpm test:coverage
The project also has Playwright set up for end-to-end tests, run with:
pnpm test:e2e
The project has GitHub Actions set up to run linter, formatter and tests. It runs on pushes to the main
branch and pull requests that are not in draft status.
The easiest way would be to deploy to Vercel. No special configuration is needed except adding your OpenAI API key as a variable there.
Inside the src
folder:
src
βββ app # App layout and homepage with chat bot example
β βββ api
β β βββ chat # Sample route handler for chat bot
β β βββ feedback # Sample route handler for form
β βββ feedback # Sample page with form
βββ components # Components grouped by pages
β βββ chat
β βββ common
β βββ feedback
β βββ ui # Re-usable components from shadcn-ui
βββ declarations # TypeScript declarations, add types for .env variables here
βββ e2e # Playwright end-to-end tests
βββ interfaces
βββ lib # Misc utilities
βββ schemas # Zod schemas used for form and API validation
βββ styles # shadcn-ui base config
βββ test # Vitest setup and utils
- Coming soon: Finish the chat bot example UI.
- Coming soon: Add more tests.
- Add support for Supabase and Supabase Auth (or similar).
- Add support for Stripe. You next billion-dollar startup will need to make money, right? π