A functional demo of a subscription-based marketing agency platform built with Next.js, TypeScript, Supabase, and shadcn/ui. Besat
- Authentication: Email/password authentication with Supabase Auth
- Role-Based Access: Separate dashboards for clients and admins
- Project Management: Clients can create and manage projects
- Task Management: Clients can create tasks, admins can assign and update task status
- Clean UI: Modern SaaS interface using shadcn/ui components
- Framework: Next.js 16+ with App Router
- Language: TypeScript
- Backend: Supabase (PostgreSQL, Auth, RLS)
- UI: shadcn/ui + Tailwind CSS
- Forms: React Hook Form + Zod validation
- Icons: Lucide React
- Node.js 18+ installed
- A Supabase account and project
npm install- Create a new project at supabase.com
- Go to SQL Editor in your Supabase dashboard
- Run the migration file:
supabase/migrations/001_initial_schema.sql- This creates the
profiles,projects, andtaskstables - Sets up Row Level Security (RLS) policies
- Creates a trigger to auto-create profiles on user signup
- This creates the
-
Copy
.env.local.exampleto.env.local:cp .env.local.example .env.local
-
Add your Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
You can find these in your Supabase project settings under API.
By default, new users are created with the client role. To create an admin:
- Sign up a new user through the app
- Go to Supabase Dashboard → Table Editor →
profiles - Find the user you just created
- Change their
rolefromclienttoadmin
npm run devOpen http://localhost:3000 in your browser.
SBMap/
├── app/
│ ├── (auth)/
│ │ ├── login/ # Login page
│ │ └── signup/ # Signup page
│ ├── (dashboard)/
│ │ └── dashboard/
│ │ ├── client/ # Client dashboard and pages
│ │ └── admin/ # Admin dashboard and pages
│ └── layout.tsx
├── components/
│ ├── ui/ # shadcn/ui components
│ ├── dashboard/ # Dashboard components
│ ├── tasks/ # Task-related components
│ └── projects/ # Project-related components
├── lib/
│ ├── supabase/ # Supabase client utilities
│ ├── auth.ts # Auth helper functions
│ └── validations.ts # Zod schemas
├── types/
│ └── database.ts # TypeScript types for database
└── supabase/
└── migrations/ # SQL migration files
- View dashboard with task statistics
- Create and view projects
- Create and view tasks
- View own tasks and projects only
- View dashboard with all system statistics
- View all projects from all clients
- View all tasks
- Assign tasks to designers
- Update task status
id(UUID, references auth.users)role('client' | 'admin')full_name(text)is_active(boolean)
id(UUID)client_id(UUID, references profiles)name(text)description(text)status(text)created_at(timestamp)
id(UUID)project_id(UUID, references projects)client_id(UUID, references profiles)title(text)content_type(text)platform(text)duration_seconds(integer, nullable)dimensions(text, nullable)brief(text)status('new' | 'accepted' | 'in_progress' | 'completed')assigned_to(UUID, nullable, references profiles)created_at(timestamp)
Row Level Security (RLS) is enabled on all tables:
- Clients can only access their own projects and tasks
- Admins can access all data
- Policies are enforced at the database level
- Designer role is not fully implemented (tasks can be assigned to mock designer IDs)
- Payments and subscriptions are out of scope for this demo
- File uploads/revisions are not included
- Notifications are not implemented
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Lint code
npm run lintThis project is ready for deployment on Vercel. Follow these steps:
Make sure your code is pushed to GitHub (already done if you're reading this).
- Go to vercel.com and sign in with your GitHub account
- Click "Add New Project"
- Import your GitHub repository:
fazla-cloud/thunder-agency-platform - Vercel will automatically detect it's a Next.js project
In the Vercel project settings, add these environment variables:
NEXT_PUBLIC_SUPABASE_URL- Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY- Your Supabase anonymous key
You can find these values in your Supabase project:
- Go to Project Settings → API
- Copy the "Project URL" and "anon public" key
Click "Deploy" and Vercel will:
- Install dependencies
- Build your Next.js application
- Deploy it to a production URL
After deployment:
- Make sure your Supabase database has the schema applied (run
supabase/migrations/001_initial_schema.sql) - Create an admin user by signing up through the deployed app, then updating the role in Supabase Dashboard
The project uses Next.js 16+ with App Router, which Vercel supports out of the box. No additional configuration files are needed.
Note: Make sure your Supabase project allows connections from your Vercel domain. Check Supabase Dashboard → Settings → API → CORS settings if you encounter CORS issues.
This is a demo project for demonstration purposes.