Skip to content
/ tanvex Public template

SaaS starter with TanStack Start + Convex real-time backend, Better Auth, Autumn billing, and Sentry monitoring.

License

Notifications You must be signed in to change notification settings

ramonclaudio/tanvex

Repository files navigation

Tanvex

Use this template License: MIT

SaaS starter with TanStack Start + Convex real-time backend, Better Auth, Autumn billing, and Sentry monitoring.

Tech Stack

Frontend:

Backend:

  • Convex - Real-time serverless backend with database
  • Better Auth - Type-safe authentication
  • Autumn - Stripe billing integration

Monitoring:

  • Sentry - Error tracking and performance monitoring

Deployment:

  • Netlify - Edge hosting with auto-deploys

Developer Experience:


Quick Start

Prerequisites

1. Install HTTPS Certificates

Warning

Better Auth requires HTTPS in development.

brew install mkcert && mkcert -install
mkdir certificates
mkcert -key-file certificates/localhost-key.pem -cert-file certificates/localhost.pem localhost 127.0.0.1 ::1

See docs/SETUP.md for Linux/Windows instructions.

2. Install and Configure

# Clone and install
git clone https://github.com/RMNCLDYO/tanvex.git
cd tanvex
bun install

# Start Convex (auto-fills .env.local)
bunx convex dev

3. Set Environment Variables

In Convex Dashboard → Settings → Environment Variables:

# Required
BETTER_AUTH_SECRET=<openssl rand -base64 32>
AUTUMN_SECRET_KEY=<from https://app.useautumn.com>
VITE_DEV_SITE_URL=https://localhost:3000

See docs/ENVIRONMENT.md for complete variable reference.

4. Start Development

bun run dev  # Opens https://localhost:3000

Optional integrations: GitHub OAuth, CodeRabbit AI reports, Sentry monitoring - see docs/INTEGRATIONS.md


Features

  • Authentication - Email/password with optional GitHub OAuth
  • Billing - Multi-tier subscriptions (Free/Starter/Pro) with Stripe
  • Real-time DB - Live data sync via Convex WebSocket
  • Dark Mode - System preference detection + localStorage persistence
  • Type Safety - End-to-end TypeScript with Zod validation
  • Error Tracking - Sentry integration with correlation IDs
  • Responsive UI - Mobile-first design with Tailwind
  • AI Reports - CodeRabbit code review summaries (optional)

Architecture

graph TB
    Browser[Browser]
    Netlify[Netlify Edge]
    Start[TanStack Start SSR]
    Convex[Convex Cloud]

    Browser --> Netlify
    Netlify --> Start
    Start --> Convex
    Convex --> Auth[Better Auth]
    Convex --> Billing[Autumn/Stripe]
    Convex --> Monitoring[Sentry]
Loading

Key flows:

Authentication
sequenceDiagram
    User->>API: Credentials
    API->>Better Auth: Validate
    Better Auth->>User: Session cookie
    User->>Convex: Request + cookie
    Convex->>Frontend: Authenticated
Loading
Billing
flowchart LR
    User-->Checkout{New?}
    Checkout-->|Yes|URL[Stripe URL]
    Checkout-->|No|Modal[Inline modal]
    URL-->Stripe
    Modal-->Stripe
    Stripe-->Webhook[Convex webhook]
Loading

Development

bun run dev          # Dev server (https://localhost:3000)
bun run build        # Production build
bun run typecheck    # Type checking
bun run lint         # Lint code
bun run format       # Format code
bun run check        # Lint + format + typecheck
bun run test         # Run tests

Deploy to Netlify:

bunx convex deploy   # Deploy backend to Convex
git push origin main # Deploy frontend to Netlify (auto-deploys on push)

See docs/SETUP.md for complete production deployment guide.


Documentation


Common Issues

Problem Solution
Convex deployment not found Run bunx convex dev to initialize
Better Auth errors Verify BETTER_AUTH_SECRET in Convex Dashboard
GitHub OAuth fails Optional feature - set DEV_GITHUB_CLIENT_ID if needed
HTTPS certificate errors Run mkcert -install and regenerate certificates

Full troubleshooting: docs/TROUBLESHOOTING.md


Project Structure

tanvex/
├── app/
│   ├── routes/          # File-based routing
│   ├── components/      # React components
│   └── lib/             # Client utilities
├── convex/
│   ├── schema.ts        # Database schema
│   ├── auth.config.ts   # Better Auth config
│   ├── autumn.ts        # Billing integration
│   └── lib/             # Server utilities
├── docs/                # Documentation
└── public/              # Static assets

Contributing

Contributions welcome! Please open an issue first to discuss changes.


License

MIT © RMNCLDYO


Acknowledgments

Built with amazing open-source tools:

About

SaaS starter with TanStack Start + Convex real-time backend, Better Auth, Autumn billing, and Sentry monitoring.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •