Full-stack modular SaaS platform with Next.js frontend and FastAPI backend. Every file constrained to 200 LOC with meaningful naming and minimal comments.
- Authentication: Supabase Auth with JWT
- Subscriptions: Stripe integration with webhooks
- Customer Management: Admin panel for user management
- Docker Distribution: Secure download tokens for software
- Email Campaigns: Bulk email with segmentation
- Analytics: Real-time metrics and conversion tracking
- Plugin Architecture: Easily add new features as standalone modules
Frontend:
- Next.js 16 (React 19)
- TypeScript
- Tailwind CSS
- Axios for API calls
- Supabase JS client
Backend:
- FastAPI (Python)
- Supabase (PostgreSQL + Auth)
- Redis (caching + event bus)
- Stripe (payments)
- Docker Registry integration
cd backend
pip install -r requirements.txt
cp env.example .env
# Edit .env with your credentials
uvicorn main:app --reloadnpm install
cp env.local.example .env.local
# Edit .env.local with your credentials
npm run dev- Create Supabase project
- Run SQL from
backend/subscriptions/schema.sqlin Supabase SQL editor - Copy Supabase URL and keys to environment files
- Create Stripe account
- Get API keys from Stripe dashboard
- Create products and prices
- Setup webhook endpoint (see backend README)
/backend/ - FastAPI modular backend
/core/ - Plugin system, event bus, database
/auth/ - Authentication module
/subscriptions/ - Stripe integration
/webhooks/ - Secure webhook handlers
/customers/ - Customer management
/docker_registry/ - Software distribution
/campaigns/ - Email campaigns
/analytics/ - Usage tracking
/utils/ - Shared utilities
/app/ - Next.js frontend
/(auth)/ - Login & register pages
/dashboard/ - Customer dashboard
/admin/ - Admin panel
/components/ - Reusable React components
/auth/ - Auth forms
/dashboard/ - Dashboard components
/admin/ - Admin components
/lib/ - Frontend utilities
Each backend module:
- ≤200 LOC per file
- Self-contained with router/service/models
- Auto-discovered by plugin registry
- Communicates via event bus
- No tight coupling
- Create new module directory in
backend/ - Add
router.py,service.py,models.py - Plugin system automatically loads it
- Subscribe to events in service for integration
- Configured via
backend/render.yaml - Includes Redis instance
- Auto-deploys from Git
- Connect GitHub repository
- Auto-detects Next.js
- Set environment variables
- Deploy!
See backend/env.example and env.local.example for required variables.
- Row Level Security (RLS) on all tables
- Stripe webhook signature verification
- JWT token validation
- Rate limiting on auth
- Redis-based idempotency
cd backend
./run_tests.shTests include:
- ✅ Authentication (registration, login, validation)
- ✅ Stripe subscriptions (checkout, management)
- ✅ Webhooks (signature verification, idempotency)
- ✅ Docker downloads (access control, tokens)
See backend/TESTING.md for detailed testing guide.
- All modules have comprehensive mock tests
- Security-critical paths (webhooks) have 95%+ coverage
- Fast execution (< 10 seconds for full suite)
- No external dependencies required
MIT