A modern full-stack web application built with Next.js 15 and Supabase, ready for deployment on Vercel.
- Next.js 15 with App Router and TypeScript
- Supabase for authentication and database
- Tailwind CSS for styling
- Server-side rendering with Supabase SSR
- Environment configuration for secure deployment
- Vercel deployment ready
- Authentication flow with sign up/sign in
- Protected routes and middleware
- Modern UI components
- Node.js 18+ installed
- A Supabase account and project
- A Vercel account (for deployment)
-
Clone the repository
git clone <your-repo-url> cd <your-project-name>
-
Install dependencies
npm install
-
Set up Supabase
- Create a new project at supabase.com
- Go to Settings > API to find your project URL and anon key
- Copy your project URL and anon key
-
Configure environment variables
cp .env.example .env.local
Update
.env.localwith your Supabase credentials:NEXT_PUBLIC_SUPABASE_URL=https://your-project-ref.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key SUPABASE_SERVICE_ROLE_KEY=your-service-role-key DATABASE_URL=postgresql://postgres:[YOUR-PASSWORD]@db.your-project-ref.supabase.co:5432/postgres NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your-secure-random-string
-
Run the development server
npm run dev
Open http://localhost:3000 to see your app.
This starter includes authentication out of the box. For additional database tables:
- Go to your Supabase dashboard
- Navigate to the SQL Editor
- Create your tables and enable Row Level Security (RLS)
- Generate TypeScript types:
npx supabase gen types typescript --project-id YOUR_PROJECT_ID > src/lib/database.types.ts
In your Vercel dashboard, add these environment variables:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYDATABASE_URLNEXTAUTH_URL(your production URL)NEXTAUTH_SECRET
# Connect to Vercel
npx vercel
# Deploy
npx vercel --prodOr connect your GitHub repository to Vercel for automatic deployments.
In your Supabase dashboard:
- Go to Authentication > Settings
- Add your production URL to "Site URL"
- Add your production URL to "Redirect URLs"
src/
├── app/
│ ├── dashboard/ # Protected dashboard page
│ ├── login/ # Authentication page
│ └── page.tsx # Home page
├── components/
│ ├── LogoutButton.tsx # Client component for logout
│ └── UserProfile.tsx # User information display
└── lib/
└── supabase/
├── client.ts # Browser client
├── server.ts # Server client
└── middleware.ts # Auth middleware
- Users can sign up/sign in on
/login - Middleware protects routes and redirects unauthenticated users
- Dashboard at
/dashboardshows user information - Logout functionality clears session and redirects
- Linting:
npm run lint - Build:
npm run build - Start:
npm run start
@supabase/supabase-js- Supabase client@supabase/ssr- Server-side rendering support@supabase/auth-ui-react- Pre-built auth componentsnext- React frameworktailwindcss- Utility-first CSS framework
- Environment variables for sensitive data
- Row Level Security (RLS) ready
- Protected routes with middleware
- Secure cookie handling
- CSRF protection
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is open source and available under the MIT License.