A modern Kanban board built with Next.js 15 and Supabase that showcases the TOP 6 SUPABASE FEATURES every developer should know!
πΉ Full YouTube Guide: Youtube link
π X Post: X link
π» Launch Full Stack Product: Github Repo
βοΈ Buy me a coffee: Cafe Latte
π€οΈ Discord: Invite link
- Google OAuth integration
- Session management with real-time auth state
- Secure user context throughout the app
- Code Location:
src/contexts/AuthContext.tsx,src/components/LoginForm.tsx
- Users can only see their own boards, lists, and cards
- Database-level security policies
- Multi-tenant architecture ready
- Code Location:
database.sql(RLS policies)
- Live updates when cards are moved
- Multiple users can collaborate instantly
- No polling needed - uses WebSockets
- Code Location:
src/components/KanbanBoard.tsx(setupRealtimeSubscriptions)
- No backend coding needed
- Full CRUD operations with TypeScript
- Automatic API documentation
- Code Location:
src/lib/supabase.ts,src/components/KanbanBoard.tsx
- Auto-updating timestamps
- Data validation at database level
- Custom business logic in PostgreSQL
- Code Location:
database.sql(update_updated_at_column function)
- Custom server-side logic without managing servers
- Automatic notifications when tasks are completed
- External API integrations (email, Slack, webhooks)
- Code Location:
supabase/functions/task-completion-notification/,src/components/KanbanBoard.tsx(triggerCompletionNotification)
- Frontend: Next.js 15 (App Router)
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth
- Styling: Tailwind CSS
- Drag & Drop: @hello-pangea/dnd
- Icons: Lucide React
- Language: TypeScript
- Node.js 18+
- A Supabase account (free tier works!)
```bash git clone cd supabase-kanban ```
```bash npm install ```
- Go to supabase.com
- Create a new project
- Wait for the database to be ready
- Go to Settings β API
- Copy your Project URL and anon public key
Option 1: Use the setup script (Recommended) ```bash
./create-env.sh
create-env.bat ```
Option 2: Manual setup
- Create a
.env.localfile in the root directory: ```env NEXT_PUBLIC_SUPABASE_URL=your-supabase-url NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key ```
Note: The app will show a configuration warning until you set up your environment variables properly.
- Go to your Supabase dashboard
- Navigate to SQL Editor
- Copy and paste the contents of
database.sql - Run the query
Note: The database schema will create tables and policies. Sample data will be automatically created when you first log in to the app.
- Go to Authentication β Settings
- Add Google as a provider
- Configure OAuth settings
To enable task completion notifications:
```bash
npm install -g supabase
supabase login
supabase link --project-ref your-project-id
supabase functions deploy task-completion-notification ```
```bash npm run dev ```
Open http://localhost:3000 in your browser!
- Create a card in any list
- Drag it to the "Done" list
- Check your browser console for the notification message
- In production, this would send actual emails/notifications
This project is perfect for demonstrating:
- Project setup and dependencies
- Supabase project creation
- Google OAuth configuration
- Authentication flow demonstration
- Database schema explanation
- Row Level Security policies
- How RLS protects user data
- Multi-tenant architecture benefits
- Setting up real-time subscriptions
- WebSocket connections
- Live collaboration demo
- Performance considerations
- Auto-generated APIs
- TypeScript integration
- CRUD operations
- Error handling
- Database functions and triggers
- Drag and drop implementation
- UI/UX best practices
- Deployment tips
```sql -- Three main tables with relationships boards (id, title, description, user_id, timestamps) βββ lists (id, title, board_id, position, timestamps) βββ cards (id, title, description, list_id, position, timestamps) ```
- Drag & Drop: Intuitive card movement between lists
- Real-time Updates: See changes instantly across all devices
- Secure: RLS ensures users only see their own data
- Responsive: Works on desktop and mobile
- Type-safe: Full TypeScript support
- Modern UI: Clean, professional design
- LoginForm: Google OAuth integration
- KanbanBoard: Main board interface
- AuthContext: Global authentication state
- Real-time subscriptions: Live data updates
```env NEXT_PUBLIC_SUPABASE_URL=your-supabase-project-url NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key ```
- Row Level Security: Database-level access control
- JWT Tokens: Secure authentication
- OAuth Integration: No password storage needed
- Real-time Authorization: RLS works with real-time subscriptions
- Optimistic Updates: Instant UI feedback
- Efficient Queries: Only fetch necessary data
- Real-time Subscriptions: WebSocket connections
- TypeScript: Compile-time error checking
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables
- Deploy!
- `NEXT_PUBLIC_SUPABASE_URL`
- `NEXT_PUBLIC_SUPABASE_ANON_KEY`
This project is designed for educational purposes. Feel free to:
- Fork and modify
- Create issues
- Submit pull requests
- Use in your own tutorials
MIT License - use this project however you'd like!
By following this tutorial, you'll understand:
- How to set up Supabase with Next.js
- Database design with PostgreSQL
- Real-time subscriptions
- Row Level Security implementation
- OAuth authentication
- Modern React patterns
- TypeScript best practices
Perfect for intermediate developers wanting to level up their full-stack skills! π
If you see this error, it means your environment variables aren't set up:
- Create
.env.localfile in the root directory - Add your Supabase credentials: ```env NEXT_PUBLIC_SUPABASE_URL=https://your-project-id.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here ```
- Restart your development server
- Or use the setup script:
./create-env.sh(Mac/Linux) orcreate-env.bat(Windows)
- App shows "Configure Supabase First": Environment variables not set
- OAuth not working: Enable Google provider in Supabase dashboard
- Database errors: Run the
database.sqlscript in your SQL Editor - Build errors: Make sure all environment variables are set
- "null value in column user_id" error: This means you're trying to run sample data SQL without authentication. Use the main
database.sqlscript instead - sample data will be created automatically when you first log in.
- Check
SETUP.mdfor detailed setup instructions - Visit Supabase Documentation
- Ensure you're using the correct project URL and anon key