T
TurbocampDocs
Getting started

Next-Forge Comparison

Key differences between Turbocamp and next-forge

Turbocamp is built on top of next-forge, maintaining compatibility while making opinionated changes for specific use cases. This document outlines the key differences.

Quick Comparison

FeatureTurbocampnext-forge
AuthenticationBetter AuthClerk
Package StructureCombined security packageSeparate rate-limit package
Package Naming@packages/*@repo/*
Design System@packages/base@repo/design-system
Tooling Locationtooling/*packages/*

Authentication: Better Auth vs Clerk

The most significant difference is the authentication system.

Why Better Auth?

  • Self-hosted - Full control over user data and authentication flow
  • No vendor lock-in - Open source with no per-user pricing
  • Database-driven - Sessions stored in your PostgreSQL database
  • Cross-domain support - Built-in support for multi-app authentication
  • Customizable - Full control over auth UI and flow

Architecture Difference

next-forge (Clerk):
├── Clerk handles all auth
├── External session management
└── Webhook-based sync to database

Turbocamp (Better Auth):
├── API app is primary auth server (localhost:3002)
├── Sessions stored in PostgreSQL
├── Cross-domain cookies for multi-app auth
└── Direct database integration

Auth Package Structure

// Turbocamp auth package exports
@packages/auth/client     // Client-side auth utilities
@packages/auth/server     // Server-side session handling
@packages/auth/middleware // Auth middleware
@packages/auth/handlers   // API route handlers
@packages/auth/provider   // React context provider

See the Authentication Setup guide for detailed configuration.

Package Organization

Naming Convention

Turbocampnext-forgePurpose
@packages/base@repo/design-systemshadcn/ui components
@packages/db@repo/databasePrisma client
@packages/authUses Clerk SDKAuthentication
@packages/security@repo/security + @repo/rate-limitSecurity + rate limiting
@tooling/*@repo/*Build tooling

Combined Security Package

Turbocamp combines security features into a single package:

// @packages/security includes:
import { securityHeaders } from '@packages/security/middleware';
import { createRateLimiter, slidingWindow } from '@packages/security/rate-limit';

next-forge separates these:

// next-forge has separate packages:
import { secure } from '@repo/security';
import { ratelimit } from '@repo/rate-limit';

Tooling Directory

Build configuration lives in tooling/ instead of packages/:

turbocamp/
├── packages/          # Runtime packages
│   ├── auth/
│   ├── db/
│   └── ...
└── tooling/           # Build-time tooling
    ├── next-config/
    └── typescript-config/

next-forge/
└── packages/          # Everything together
    ├── next-config/
    ├── typescript-config/
    └── ...

Database: Prisma 7

Turbocamp uses Prisma 7 with the new driver adapter pattern:

// packages/db/index.ts
import { PrismaNeon } from '@prisma/adapter-neon';

const adapter = new PrismaNeon({ connectionString: keys().DATABASE_URL });
export const database = new PrismaClient({ adapter });

Schema Differences

// Turbocamp schema
generator client {
  provider = "prisma-client"
  output   = "../generated"
}

datasource db {
  provider     = "postgresql"
  relationMode = "prisma"
}

Packages We Don't Have

next-forge includes some packages that Turbocamp doesn't have (yet):

PackagePurposeStatus in Turbocamp
collaborationReal-time collaborationNot included
notificationsPush notificationsNot included
observabilityOpenTelemetry tracingUses Sentry instead
webhooksWebhook handlingNot included

These packages can be added as needed. The core architecture supports them.

Version Differences

Current versions in Turbocamp:

PackageVersion
Next.js15.3.x
React19.2.x
TypeScript5.9.x
Prisma7.x
Tailwind CSS4.x

Subpath Imports

Both use subpath imports for better tree-shaking:

// Import specific modules, not barrel exports
import { auth } from '@packages/auth/server';
import { createMetadata } from '@packages/seo/metadata';
import { parseError } from '@packages/logging/error';

This pattern avoids importing unused code and improves bundle size.

Environment Variables

# Turbocamp (Better Auth)
BETTER_AUTH_SECRET=""
BETTER_AUTH_URL=""
AUTH_API_URL=""
NEXT_PUBLIC_AUTH_API_URL=""

# next-forge (Clerk)
CLERK_SECRET_KEY=""
CLERK_WEBHOOK_SECRET=""
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=""

Rate Limiting (Same)

# Both use Upstash
UPSTASH_REDIS_REST_URL=""
UPSTASH_REDIS_REST_TOKEN=""

Migration from next-forge

If migrating from next-forge to Turbocamp:

  1. Update imports - Change @repo/* to @packages/*
  2. Replace Clerk - Migrate to Better Auth (see auth setup guide)
  3. Update Prisma - Use new v7 adapter pattern
  4. Combine packages - Rate limiting is now in @packages/security
  5. Move tooling - Build configs go in tooling/ directory

When to Choose Turbocamp

Choose Turbocamp if you need:

  • Self-hosted authentication
  • No per-user pricing for auth
  • Full control over user data
  • Multi-app authentication with shared sessions
  • PostgreSQL-based session storage

Choose next-forge if you prefer:

  • Managed authentication (Clerk)
  • Faster initial setup
  • Less infrastructure to manage
  • Clerk's built-in UI components

Contributing

Found a difference not documented here? Please open an issue or PR to help keep this comparison up to date.