A modern, production-ready template for building full-stack web applications with Next.js 15, React 19, Tailwind CSS 4, and Supabase.
There are three ways to use this template:
npm run setup
git clone https://github.com/yourusername/nextjs-fullstack-starter.git my-project
cd my-project
rm -rf .git
git init
npm run setup
For frequent use, you can install the template globally on your system:
Clone the repository:
git clone https://github.com/yourusername/nextjs-fullstack-starter.git
cd nextjs-fullstack-starter
Install the template globally:
npm install -g .
Now you can create new projects from anywhere:
create-nextjs-project my-new-project
The script will copy the template and offer to run the setup script for you.
The setup script will guide you through:
Clone this repository
git clone https://github.com/yourusername/nextjs-fullstack-starter.git my-project
cd my-project
Install dependencies
npm install
Set up environment variables
cp .env.example .env.local
Then edit .env.local to add your Supabase credentials.
Start the development server
npm run dev
This will start the Next.js development server with Turbopack enabled for ultra-fast reloads.
Open your browser Your app will be running at http://localhost:3000
The project structure is organized as follows:
.github/
- GitHub Actions workflows.husky/
- Git hooks.storybook/
- Storybook configurationdocs/
- Documentationpublic/
- Static filesscripts/
- Helper scriptstests/
- Test filessrc/
)app/
)api/
- API routes(auth)/
- Authentication pagesdashboard/
- Dashboard pagescomponents/
)ui/
- UI components (shadcn)layout/
- Layout componentsforms/
- Form componentsshared/
- Shared componentsdesign-system/
- Design systemhooks/
- Custom React hookslib/
- Utility functions and clientsstories/
- Storybook storiestypes/
- TypeScript type definitionsnpm run dev
- Start the development server with Turbopacknpm run build
- Build for productionnpm run start
- Start the production servernpm run lint
- Run ESLintnpm run format
- Format code with Prettiernpm run test
- Run Jest testsnpm run storybook
- Start Storybooknpm run create:page
- Generate a new pagenpm run create:component
- Generate a new componentnpm run setup
- Run the project setup scriptThis starter comes with helper scripts to quickly scaffold pages and components:
# Create a new page at src/app/about/page.tsx
npm run create:page about
# Create a nested page at src/app/blog/posts/page.tsx
npm run create:page blog/posts
# Create a new component with test file at src/components/shared/Button.tsx
npm run create:component Button
This will generate:
src/components/shared/Button.tsx
- The component filesrc/components/shared/Button.test.tsx
- A test file for the componentNext.js 15: The React framework for production.
next.config.ts
Turbopack: Next.js's super fast bundler (dev mode only).
npm run dev
next.config.ts
under the experimental.turbo keyReact 19: The library for web and native user interfaces.
Tailwind CSS 4: A utility-first CSS framework.
tailwind.config.js
shadcn/ui: Re-usable components built with Radix UI and Tailwind CSS.
src/components/ui
Supabase: Open source Firebase alternative.
src/lib/supabase.ts
ESLint: Code linter.
.eslintrc.json
Prettier: Code formatter.
.prettierrc.js
Jest: JavaScript testing framework.
jest.config.js
Husky & lint-staged: Git hooks integration.
.husky
directory and lint-staged.config.js
This project uses the following environment variables:
Variable | Description | Required |
---|---|---|
NEXT_PUBLIC_SUPABASE_URL | Your Supabase project URL | Yes |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Your Supabase anonymous key | Yes |
Add these to your .env.local
file.
You can install shadcn/ui components with:
npx shadcn-ui@latest add button
npx shadcn-ui@latest add card
# etc.
Additional documentation can be found in the docs directory: