A comprehensive, production-ready B2B SaaS starter kit built with modern technologies and best practices.
- Next.js 15 with App Router, React Compiler, and TypeScript
- Tailwind CSS with custom design system
- shadcn/ui components for consistent UI
- ConvexDB for real-time data and live queries
- Drizzle ORM with Turso for admin panel and analytics
- BetterAuth for authentication with OAuth support
- PayloadCMS for content management with Turso database
- Bun as the primary runtime, package manager, and bundler
- Multi-tenant Architecture with company-based isolation
- Role-based Access Control (Admin, User, Owner)
- Real-time Authentication with Google and GitHub OAuth
- Subscription Management with multiple plan tiers
- API Key Management for integrations
- Audit Logging for compliance
- Content Management with PayloadCMS
- File Storage with S3-compatible cloud storage
- ESLint with TypeScript and Next.js rules
- Prettier for consistent code formatting
- Husky for git hooks (pre-commit, pre-push)
- lint-staged for optimized pre-commit linting
- Automatic formatting on every commit
- React Compiler for automatic optimization and better performance
- Optimized Package Imports for faster bundle loading
- Standalone Output for efficient deployment
- Enhanced Security Headers for production safety
- Advanced Image Optimization with remote pattern support
- Webpack Optimizations for better client-side performance
- Ultra-fast Package Installation - 20x faster than npm
- Native TypeScript Support - No compilation step needed
- Built-in Bundler - Faster builds and hot reloads
- Memory Efficient - Lower resource usage
- Compatible APIs - Drop-in replacement for Node.js
- Integrated Testing - Built-in test runner
| Category | Technology |
|---|---|
| Frontend | Next.js 15, React 19, TypeScript |
| Styling | Tailwind CSS, shadcn/ui |
| Real-time DB | ConvexDB (real-time data sync) |
| SQL Database | Turso (LibSQL) + Drizzle ORM |
| ORM | Drizzle ORM (type-safe SQL) |
| Authentication | BetterAuth (OAuth + Email) |
| CMS | PayloadCMS with Turso backend |
| Deployment | Vercel |
| Runtime | Bun (fastest JavaScript runtime) |
| Icons | Lucide React |
| Linting | ESLint + Prettier |
| Git Hooks | Husky + lint-staged |
ByteStack uses a hybrid database approach for optimal performance:
-
ConvexDB - Real-time application data
- Live queries and mutations
- Real-time subscriptions
- Main application data
-
Turso (LibSQL) - Admin operations and analytics
- Admin panel data synchronized from ConvexDB
- Analytics and reporting
- System health monitoring
- Audit logs
-
PayloadCMS - Content management
- Blog posts and media
- Settings and configurations
- SEO management
-
Clone the repository
git clone <your-repo-url> cd bytestack
-
Install dependencies with Bun (20x faster than npm)
bun install
-
Set up environment variables
cp env.example .env.local
Fill in your environment variables:
- ConvexDB configuration
- Turso database credentials
- BetterAuth configuration
- OAuth provider credentials
- Email service configuration
- Cloud storage credentials
-
Initialize Turso Database
# Create a new Turso database turso db create bytestack # Get the database URL and token turso db show bytestack --url turso db tokens create bytestack
Add to
.env.local:TURSO_CONNECTION_URL=libsql://your-db.turso.io TURSO_AUTH_TOKEN=your_auth_token PAYLOAD_TURSO_URL=libsql://your-payload-db.turso.io
-
Initialize ConvexDB
bunx convex dev --configure new
-
Run database migrations
bun run db:push
-
Start the development server (with Bun's ultra-fast hot reload)
bun run dev
Copy env.example to .env.local and configure:
# ConvexDB
NEXT_PUBLIC_CONVEX_URL=your_convex_url
CONVEX_DEPLOY_KEY=your_deploy_key
# Turso Database Configuration
TURSO_CONNECTION_URL=libsql://your-db.turso.io
TURSO_AUTH_TOKEN=your_turso_token
PAYLOAD_TURSO_URL=libsql://your-payload-db.turso.io
# BetterAuth Configuration
BETTER_AUTH_SECRET=your_secret_key
BETTER_AUTH_URL=http://localhost:3000
# OAuth Providers
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
# Email
SMTP_HOST=your_smtp_host
SMTP_USER=your_smtp_user
SMTP_PASS=your_smtp_password
# Cloud Storage
S3_ENDPOINT=your_s3_endpoint
S3_ACCESS_KEY_ID=your_access_key
S3_SECRET_ACCESS_KEY=your_secret_key
S3_BUCKET=your_bucket_name- Create a new Convex project
- Configure authentication providers
- Deploy your schema and functions
- Configure your database connection
- Set up collections and globals
- Configure file storage
bytestack/
โโโ src/
โ โโโ app/ # Next.js App Router
โ โ โโโ layout.tsx # Root layout
โ โ โโโ page.tsx # Home page
โ โโโ components/ # React components
โ โ โโโ ui/ # shadcn/ui components
โ โ โโโ Header.tsx # Navigation header
โ โ โโโ Dashboard.tsx # Main dashboard
โ โ โโโ animations.tsx # Animation components
โ โ โโโ visual-effects.tsx # Visual effects
โ โโโ lib/
โ โโโ utils.ts # Utility functions
โโโ convex/ # ConvexDB functions
โ โโโ schema.ts # Database schema
โ โโโ users.ts # User operations
โ โโโ auth.ts # Authentication config
โโโ collections/ # PayloadCMS collections
โโโ globals/ # PayloadCMS globals
โโโ payload.config.ts # PayloadCMS configuration
โโโ vercel.json # Vercel deployment config
- Connect your repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy automatically on push to main branch
The vercel.json file includes optimized settings for:
- Build commands using Bun (20x faster than npm)
- Environment variable mapping
- Framework detection
- Regional deployment
- Frozen lockfile for consistent builds
# Build the application
bun run build
# Deploy to ConvexDB
bunx convex deploy
# Deploy to Vercel
vercel --prodThe project uses a comprehensive design system with:
- Custom Tailwind configuration
- shadcn/ui components
- Consistent color palette
- Typography scale
- Spacing system
All components are placed in src/components/ for easy organization:
- Reusable UI components
- Business logic components
- Animation components
- Visual effect components
The animation system provides:
- Randomized timing for natural feel
- Multiple animation types
- Staggered animations for lists
- Scroll-triggered animations
- Hover effects
- OAuth with Google and GitHub
- Role-based permissions
- Session management
- User profile management
- Multi-tenant architecture
- Company settings and branding
- User invitation system
- Plan management
- PayloadCMS integration
- Rich text editing
- Media management
- SEO optimization
- Real-time data updates
- Audit logging
- Performance monitoring
- User activity tracking
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Check the documentation
- Review the example configurations
- Payment integration (Stripe)
- Advanced analytics dashboard
- Mobile app support
- API documentation
- Testing suite
- Performance optimization
- Internationalization
- Advanced security features
Built with โค๏ธ using modern web technologies for the next generation of B2B SaaS applications.