A production-ready SaaS starter kit with React, FastAPI, Supabase, and Google Cloud Run. Get your SaaS up and running in minutes, not months!
- π Authentication: Google SSO + Email/Password with Supabase Auth
- π₯ User Management: Admin panel, user roles, profile management
- π Multi-language: i18n ready with RTL support
- π³ Payments: Optional Stripe integration for subscriptions
- π Analytics: Google Analytics & Sentry error tracking
- π Production Ready: Docker, CI/CD, monitoring, and scaling
- Frontend: React 18, TypeScript, Vite, Tailwind CSS, Zustand
- Backend: FastAPI, Python 3.11, Async SQLAlchemy, Pydantic
- Database: PostgreSQL via Supabase (free tier friendly)
- Deployment: Google Cloud Run (scales to zero)
- Development: Docker Compose, Hot reload, Pre-commit hooks
- π Rate limiting & CORS protection
- πͺ GDPR-ready cookie consent
- π Privacy Policy & Terms templates
- π‘οΈ JWT authentication with refresh tokens
# Clone the repository
git clone https://github.com/dcschreiber/boiler-project.git
cd boiler-project
# Install dependencies
npm install
# Follow setup wizard
# Complete SETUP_HUMAN_TASKS.md first!
# Run setup validation
npm run setup
# Start development
npm run devYour app will be running at:
- Frontend: http://localhost:5173
- Backend: http://localhost:8000
- API Docs: http://localhost:8000/api/docs
.
βββ frontend/ # React + Vite frontend
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ store/ # Zustand state management
β β βββ locales/ # i18n translations
β βββ public/ # Static assets
βββ backend/ # FastAPI backend
β βββ app/
β β βββ api/ # API endpoints
β β βββ core/ # Core functionality
β β βββ models/ # Database models
β β βββ schemas/ # Pydantic schemas
β βββ tests/ # Backend tests
βββ scripts/ # Automation scripts
βββ docs/ # Documentation
βββ .github/ # GitHub Actions workflows
- Create translation file:
frontend/src/locales/[lang]/common.json - Import in
frontend/src/i18n.ts:
import heTranslations from './locales/he/common.json'
export const resources = {
en: { common: enTranslations },
he: { common: heTranslations }, // Add this
}- The language switcher will appear automatically!
If you don't need payments:
- Set
STRIPE_ENABLED=falsein.env.local - Remove these files:
frontend/src/pages/BillingPage.tsxbackend/app/api/billing.pybackend/app/services/stripe.py
- Remove billing routes from
frontend/src/App.tsx
- Frontend: Create components in
frontend/src/components/ - Backend: Add endpoints in
backend/app/api/ - Database: Use Supabase dashboard or migrations
- State: Use Zustand stores in
frontend/src/store/
# One-time setup
gcloud init
gcloud services enable run.googleapis.com
# Deploy
git push origin main # GitHub Actions handles the rest!Automatic deployment features:
- Builds and deploys on push to main
- Frontend β Cloud Storage + CDN
- Backend β Cloud Run (scales to zero)
- Costs < $5/month for small apps
See .github/workflows/deploy.yml for the deployment steps.
# Run all tests
npm test
# Frontend tests
npm run test:frontend
# Backend tests
npm run test:backend
# E2E tests
npm run test:e2e- For Humans: See SETUP_HUMAN_TASKS.md for setup guide
- For AI: See technical details below
Supabase:
- Free tier includes auth, database, and realtime
- Scales automatically
- Built-in Row Level Security
- No vendor lock-in (it's just Postgres)
FastAPI:
- Modern Python with async support
- Auto-generated API documentation
- Type safety with Pydantic
- High performance
Google Cloud Run:
- Scales to zero (pay only when used)
- Automatic HTTPS
- Simple deployment
- Integrates with GitHub Actions
React + Vite:
- Fast development experience
- Modern tooling
- Large ecosystem
- AI coding tools work well with it
// Zustand store pattern
export const useAuthStore = create<AuthState>((set, get) => ({
user: null,
login: async (email, password) => {
const user = await api.login(email, password)
set({ user })
},
}))@router.post("/users", response_model=User)
async def create_user(
user: UserCreate,
db: Database = Depends(get_db),
current_user: User = Depends(get_current_admin_user)
):
# Admin-only endpoint with automatic validation
return await create_user_in_db(db, user)- User clicks "Login with Google"
- Redirected to Google OAuth
- Google redirects back with code
- Supabase exchanges code for user session
- Frontend stores session, backend validates JWT
-- Managed by Supabase
auth.users (
id uuid primary key,
email text unique,
created_at timestamp
)
-- Custom tables
public.profiles (
id uuid references auth.users primary key,
name text,
is_admin boolean default false,
language text default 'en',
stripe_customer_id text
)
public.subscriptions (
id uuid primary key,
user_id uuid references auth.users,
stripe_subscription_id text,
status text,
current_period_end timestamp
)SUPABASE_URL: Your Supabase project URLSUPABASE_ANON_KEY: Public anonymous keySUPABASE_SERVICE_KEY: Private service keyGOOGLE_CLIENT_ID: OAuth client IDGOOGLE_CLIENT_SECRET: OAuth client secretADMIN_EMAIL: First admin user emailJWT_SECRET: Random 32+ character string
STRIPE_*: Payment configurationGOOGLE_ANALYTICS_ID: Analytics trackingSENTRY_DSN: Error trackingWHITELIST_MODE: Restrict signups
GET /api/health- Health checkPOST /api/auth/login- Email/password loginPOST /api/auth/signup- User registrationPOST /api/auth/reset-password- Password reset
GET /api/users/me- Current user profilePUT /api/users/me- Update profileGET /api/billing/subscription- Current subscription
GET /api/admin/users- List all usersPUT /api/admin/users/:id- Update user roleDELETE /api/admin/users/:id- Delete userGET /api/admin/stats- Dashboard statistics
# Development
npm run dev # Start all services
npm run dev:frontend # Frontend only
npm run dev:backend # Backend only
# Database
npm run setup:database # Create database tables
npm run check:database # Check database status
# Testing
npm test # Run all tests
npm run test:coverage # With coverage
# Code Quality
npm run lint # Lint all code
npm run format # Format all code
# Deployment
npm run build # Build for production
npm run deploy # Deploy to Cloud Run
# Utilities
npm run setup # Complete setup with database
npm run setup:basic # Setup without database
npm run validate-env # Check env vars-
Frontend:
- Code splitting with React.lazy
- Image optimization
- Bundle size monitoring
- CDN for static assets
-
Backend:
- Async database queries
- Redis caching (optional)
- Query optimization
- Rate limiting
-
Database:
- Indexes on foreign keys
- Row Level Security
- Connection pooling
- Query analysis
- Never commit secrets - Use environment variables
- Validate all inputs - Pydantic on backend
- Use HTTPS always - Enforced by Cloud Run
- Rate limit APIs - Configured in backend
- Keep dependencies updated - Dependabot enabled
- Logs: Cloud Run logs in GCP Console
- Errors: Sentry dashboard
- Analytics: Google Analytics
- Performance: Cloud Run metrics
- Database: Supabase dashboard
- Fork the repository
- Create feature branch
- Write tests for new features
- Ensure all tests pass
- Submit pull request
MIT License - use this for anything!
Built with β€οΈ to help developers ship faster.