This is a lightweight template for building web applications with Next.js 14, TypeScript, and Supabase.
- Next.js 14 with App Router
- TypeScript for type safety
- Supabase for authentication, database, and storage
- Tailwind CSS for styling
- Basic authentication setup
- Responsive design with Tailwind CSS
- Type-safe database access with your custom database types
- ESLint for code linting
- Node.js 18+ and npm
- Supabase account and project
- Clone this repository:
git clone https://github.com/yourusername/next-template.git
cd next-template- Install dependencies:
npm install- Create a
.env.localfile based on.env.local.example:
cp .env.local.example .env.local-
Update the
.env.localfile with your Supabase credentials. -
Start the development server:
npm run dev- Open http://localhost:3000 in your browser.
This template is designed to work with your custom database schema package. If you have a private database package, you'll need to:
- Configure your
.npmrcfile with the appropriate authentication token:
@your-org:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
- Install your database package:
npm install @your-org/your-db-package- Update the imports in the Supabase client files to use your database types.
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ ├── auth/ # Authentication pages
│ ├── components/ # React components
│ │ ├── auth/ # Authentication components
│ │ └── ui/ # UI components
│ ├── lib/ # Utility functions
│ │ ├── supabase/ # Supabase clients
│ │ └── utils/ # Utility functions
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── types/ # TypeScript type definitions
├── .env.local.example # Example environment variables
├── next.config.js # Next.js configuration
├── package.json # Project dependencies
├── postcss.config.js # PostCSS configuration
├── tailwind.config.ts # Tailwind CSS configuration
└── tsconfig.json # TypeScript configuration
This template can be deployed to any platform that supports Next.js, such as:
This template uses Tailwind CSS for styling. You can customize the design by:
- Updating the
tailwind.config.tsfile - Modifying the CSS variables in
app/globals.css
To use your own database schema:
- Update the Supabase type definitions in
types/supabase.tsor replace with your own type imports - Modify the database queries throughout the application to match your schema
Made with ❤️ by [Your Name or Company]