Sun May 26 2024

This boilerplate is an ongoing project and represents one of my first big solo builds. It provides a strong foundation for SaaS applications with essential features like authentication, role-based access control, payments, AI integration, and a robust admin dashboard. While many core features are implemented, others are still under development.
Features
- Authentication system using Supabase Auth with OAuth and magic links.
- Profile system with avatar uploads and profile management.
- Role-based access control with granular permissions.
- Admin dashboard for managing users, roles, and system settings.
- Activity logging to track user actions and system events.
- Stripe integration for subscription-based payments (coming soon).
- AI/LLM integration with OpenAI and Anthropic APIs (coming soon).
- Reusable UI components with Tailwind CSS.
- PostgreSQL database with type safety using Supabase.
- Optimized for Vercel deployment.
Authentication Features
- Email/password authentication.
- OAuth providers (Google, GitHub coming soon).
- Magic link authentication.
- Email verification flow.
- Password reset functionality.
- Remember me functionality.
- Profile and session management.
- Protected routes with middleware.
Admin Features
- User management with role assignments.
- Role-based permission system.
- Activity monitoring with audit logs.
- System overview dashboard.
Role-Based Access Control
The boilerplate includes a structured RBAC system:
Role Hierarchy
- Super Admin: Full system access.
- Admin: Administrative access.
- User: Standard user access.
Permission Gates
- Component-level access control.
- Route protection based on roles.
- API endpoint authorization.
Role Management
- Dynamic role assignment.
- Role-based UI adaptation.
- Secure role modification.
Environment Setup
Copy the example environment file:
Update .env.local
with your credentials:
Database Setup
The database structure is comprehensive, leveraging Supabase (PostgreSQL) for scalability and security. Given its complexity, only the core setup is listed here. The full schema, including additional tables and policies, is available in the repository.
Create a new project in Supabase and run the following SQL commands:
For a detailed database schema, including organization management, permissions, and audit logs, refer to the documentation in the repository.
Roadmap
Core Features
- Authentication with Supabase.
- User profiles.
- Session management.
- Role-based access control.
- Admin dashboard.
- User activity tracking.
- Analytics foundation.
- Data exports (CSV).
Team Features (In Progress)
- Organization system foundation.
- Create organizations.
- Organization routing.
- Basic organization context.
- Organization dashboard.
- Organization management.
- Role-based organization access.
- Organization creation flow.
- Organization settings.
- Avatar management.
- Slug management.
- Member management.
- Invite system.
- Role assignment.
- Member removal.
- Permission management.
Features Under Development
These features are planned but not yet implemented:
Payment Integration
- Stripe subscriptions.
- Usage-based billing.
- Team billing.
- Invoice management.
- Billing dashboard.
AI/LLM Features
- OpenAI integration.
- Claude/Anthropic setup.
- Prompt management.
- Usage tracking & limits.
- AI playground.
Advanced Features
- System settings panel.
- i18n support.
- Documentation system.
- Blog/CMS integration.
- Email template system.
- Webhook system.
Prerequisites
- Node.js 18+
- pnpm 8+
- Supabase account
- Basic knowledge of TypeScript and React
Quick Start
Clone the repository:
Install dependencies:
Copy the environment variables:
Update .env.local
with your credentials, then start the development server:
Open http://localhost:3000
to see the result.
Contributing
Contributions are welcome. Please refer to the contributing guide for details.
License
This project is licensed under the MIT License.