A production-ready starter template with authentication, database integration, and modern tooling. Built with TanStack Start, Better Auth, and TypeScript for rapid development of secure web applications.
- 🔐 Complete Authentication System - Sign up, login, password reset, email verification, and bot protection with Cloudflare Turnstile
- 🗄️ Database Ready - LibSQL (SQLite) with Kysely, optimized for serverless/edge compatibility. Turso Cloud ready.
- 💳 High-Precision Credit Ledger - Built-in "Wallet" system with unified milli-credits ($0.001 bits), daily grants, and transaction ledgers. Concurrency-safe by design with atomic safeguards.
- 🎨 Clean UI Foundation - MVP.css styling with custom components
- 🧪 Full Testing Suite - Unit tests (Vitest) and E2E tests (Playwright) with email testing
- 📧 Email Integration - Transactional emails with Resend API
- 🚀 Production Ready - Vercel deployment, environment management, TypeScript
- 🛠️ Developer Experience - Hot reload, type safety, comprehensive tooling
- SaaS applications requiring user authentication
- Web apps needing secure user management
- Projects requiring email workflows (verification, notifications)
- Teams wanting a solid foundation without boilerplate setup
- Developers who prefer TypeScript and modern tooling
New to this template? Fork this repository on GitHub first, then follow the setup below.
-
Fork and setup:
- Fork this repository on GitHub and take note of your fork URL
git clone <your-fork-url> cd <project-name> pnpm install
-
Environment setup:
cp .env.example .env # Edit .env with your configuration -
Start development:
pnpm dev
Frontend & Framework
- TanStack Start - Full-stack React framework with file-based routing
- TypeScript - Type-safe development with excellent DX
- Vite - Lightning-fast build tooling and HMR
Authentication & Security
- Better Auth - Comprehensive auth with social providers, 2FA, sessions
- Cloudflare Turnstile - Non-interactive bot protection for the sign-up flow
- Secure by default - CSRF protection, secure headers, input validation, and server-side Turnstile verification
Database & Backend
- Kysely - Type-safe SQL builder for database operations
- LibSQL - Modern SQLite-compatible driver for serverless, edge, and cloud (Turso ready)
- Server-side rendering - SEO-friendly with hydration
Testing & Quality
- Vitest - Fast unit testing with TypeScript support
- Playwright - Reliable E2E testing with email verification
- Mailpit - Local email testing server
Styling & UI
- MVP.css - Semantic HTML styling without classes
- Custom components - Reusable UI elements with TypeScript
- Responsive design - Mobile-first approach
For detailed foundation documentation, see README-STZUSER.md.
pnpm dev # Start development server
pnpm build # Build for production
pnpm typecheck # Check TypeScript types
pnpm test # Run unit tests
pnpm test:e2e # Run E2E testssrc/ # Your application code (routes, components, client logic)
├── routes/ # File-based routing with TanStack Start
├── components/ # Reusable UI components
└── lib/ # Application utilities
stzUser/ # Authentication & user management foundation
├── lib/ # Auth, database, email utilities
├── components/ # Auth-related components
└── test/ # Comprehensive test suite
stzUtils/ # Shared UI utilities and components
public/ # Static assets (favicon, styles, images)
This template eliminates weeks of setup time. Fork it, configure your environment variables, and start building your application immediately. The foundation handles authentication, database operations, email workflows, and testing - so you can focus on your unique features.
Next Steps:
- Fork this repository
- Follow the Quick Start guide above
- Customize the foundation in
stzUser/for your needs - Build your application in
src/ - Deploy to Vercel/Netlify (see Deployment Guide)
Happy building! 🚀
- Update
package.jsonwith your project details - Modify this README with your specific project information
- Start building your application features
- Refer to
README-STZUSER.mdfor foundation-specific documentation
To pull updates from the original foundation repository into your fork:
# Check if upstream already exists
git remote -v
# One-time setup (skip if upstream already exists)
git remote add upstream <original-repo-url>
# If you get "upstream already exists", you can skip this step
# Regular updates
git fetch upstream
git merge upstream/main
git push origin mainBest practices:
- Keep your changes in
src/directory - Avoid modifying
stzUser/andstzUtils/when possible - Test after each update to ensure compatibility
Note: If you've modified files in stzUser/ or stzUtils/, you may need to resolve merge conflicts during updates.