Skip to content

Implement multi-tenant authentication system with Supabase#4

Merged
DTTconnect merged 1 commit into
mainfrom
claude/multi-tenant-sign-in-016Mj1xM6yGtfSXyUaswEzFG
Nov 14, 2025
Merged

Implement multi-tenant authentication system with Supabase#4
DTTconnect merged 1 commit into
mainfrom
claude/multi-tenant-sign-in-016Mj1xM6yGtfSXyUaswEzFG

Conversation

@DTTconnect
Copy link
Copy Markdown
Owner

This commit adds a complete multi-tenant authentication and project management system using Supabase, enabling teams to securely create and manage their projects with proper data isolation.

Features Added:

  • User authentication (email/password sign-up and login)
  • Multi-tenant organization system with role-based access
  • Row Level Security (RLS) for automatic data isolation
  • Project and sandbox tracking in PostgreSQL database
  • User dashboard to view organization projects
  • Authentication middleware for route protection

Database Schema:

  • organizations: Teams/companies
  • organization_members: User-to-organization relationships with roles
  • projects: Project metadata with prompts
  • sandboxes: Daytona sandbox instances linked to projects

Key Components:

  • Supabase client utilities (client-side and server-side)
  • Authentication pages (/auth/login, /auth/signup)
  • Dashboard page with project list and stats
  • Updated API route to require auth and save projects
  • Updated Navbar with auth-aware navigation
  • Middleware for session management

Security:

  • RLS policies ensure users only see their organization's data
  • Server-side authentication checks on all protected routes
  • Automatic organization creation on user signup
  • Role-based access control (owner, admin, member)

Documentation:

  • Comprehensive setup guide (MULTI_TENANT_SETUP.md)
  • SQL migrations with detailed comments
  • Database schema documentation

Technical Details:

  • Uses @supabase/supabase-js and @supabase/ssr
  • Next.js 14 App Router with Server Components
  • PostgreSQL with RLS for data isolation
  • Cookie-based session management

This commit adds a complete multi-tenant authentication and project management
system using Supabase, enabling teams to securely create and manage their
projects with proper data isolation.

Features Added:
- User authentication (email/password sign-up and login)
- Multi-tenant organization system with role-based access
- Row Level Security (RLS) for automatic data isolation
- Project and sandbox tracking in PostgreSQL database
- User dashboard to view organization projects
- Authentication middleware for route protection

Database Schema:
- organizations: Teams/companies
- organization_members: User-to-organization relationships with roles
- projects: Project metadata with prompts
- sandboxes: Daytona sandbox instances linked to projects

Key Components:
- Supabase client utilities (client-side and server-side)
- Authentication pages (/auth/login, /auth/signup)
- Dashboard page with project list and stats
- Updated API route to require auth and save projects
- Updated Navbar with auth-aware navigation
- Middleware for session management

Security:
- RLS policies ensure users only see their organization's data
- Server-side authentication checks on all protected routes
- Automatic organization creation on user signup
- Role-based access control (owner, admin, member)

Documentation:
- Comprehensive setup guide (MULTI_TENANT_SETUP.md)
- SQL migrations with detailed comments
- Database schema documentation

Technical Details:
- Uses @supabase/supabase-js and @supabase/ssr
- Next.js 14 App Router with Server Components
- PostgreSQL with RLS for data isolation
- Cookie-based session management
@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
dtc Error Error Nov 14, 2025 9:11pm

@DTTconnect DTTconnect merged commit b0e58fa into main Nov 14, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants