Deep dive into TinyShip's enterprise-grade architecture. Designed with modern technologies for ultimate scalability, performance, and exceptional developer experience.

Core Technology Foundation

Enterprise-grade monorepo architecture designed for scalable full-stack development with cutting-edge technologies

Full-Stack Applications

Unique **Dual Framework Support** - Choose React (Next.js) or Vue (Nuxt.js) based on your team's expertise and project requirements. Both share the same core libraries and infrastructure.

Next.js App

React-based full-stack framework

  • • App Router with SSR/SSG
  • • Server & Client Components
  • • API Routes & Middleware
  • • TypeScript integration

Nuxt.js App

Vue-based full-stack framework

  • • Vue 3 Composition API
  • • Universal rendering
  • • Nitro server engine
  • • Auto-imports & modules

Infrastructure & Tools

Styling System

Modern CSS framework & components

  • • Tailwind CSS utility-first
  • • Shadcn/ui components
  • • Magic UI components
  • • Motion animations

Build System

Monorepo management & tooling

  • • Turborepo monorepo
  • • PNPM workspace
  • • Docker containerization

Core Libraries

Shared across all applications with multiple provider support for each service.

Database

Type-safe ORM with PostgreSQL

Drizzle ORMPostgreSQL

Authentication

Multi-provider auth system

Better AuthGoogleGitHub微信登录Email/Password

Payment System

Global payment processing

微信支付StripeCreem支付宝(planned)

Email Service

Multi-provider email delivery

ResendSendGrid (planned)SMTP (planned)

SMS Service

Global SMS delivery

TwilioAliyunMJML Template

Permissions

Fine-grained access control

CASL IntegrationCustom RulesDynamic Policies

Validators

Schema validation system

Zod IntegrationCustom RulesAPI Validation

AI Integration

AI-powered features

Vercel AI SDKOpenAIAnthropic

No Vendor Lock-in Philosophy

TinyShip is designed with provider abstraction layers, giving you the freedom to switch between services without changing your application code. True flexibility for growing businesses.

Provider Flexibility

Email Service

Switch between Resend, SendGrid without code changes

Payment Processing

Support Stripe, WeChat Pay, Creem with unified API

SMS Delivery

Use Twilio globally, Aliyun for China seamlessly

Extensible Architecture

Plugin System

Add new providers by implementing standard interfaces

Configuration Driven

Switch providers via environment variables

Future Proof

Add new services without breaking existing functionality

Cost Optimization

Market-specific Providers

Use cost-effective regional services automatically

Competitive Pricing

Never be locked into expensive service contracts

Scale Efficiency

Choose optimal providers as your business grows

Traditional Approach

Vendor Lock-in Problem

Different APIs for each provider mean rewriting code when switching services.

Stripe Implementation
typescript
// Stripe-specific implementation
import Stripe from 'stripe'
const stripe = new Stripe(apiKey)

const session = await stripe.checkout.sessions.create({
  line_items: [{ price: 'price_123', quantity: 1 }],
  mode: 'subscription',
  success_url: 'https://app.com/success',
  cancel_url: 'https://app.com/cancel'
})
WeChat Pay Implementation
typescript
// WeChat Pay implementation (completely different)
import WechatPay from 'wechatpay-node-v3'
const pay = new WechatPay(config)

const order = await pay.transactions.native({
  appid: 'wx123',
  mchid: 'mch123',
  description: 'Product',
  out_trade_no: 'order_123',
  amount: { total: 100, currency: 'CNY' }
})
TinyShip Solution

Unified API

One consistent interface for all providers. Switch with a single parameter change.

Universal Implementation
All Providers
javascript
import { createPaymentProvider } from '@libs/payment'

// One API for all providers
const provider = createPaymentProvider('stripe') // or 'wechat', 'creem'

const result = await provider.createPayment({
  orderId: 'order_123',
  userId: 'user_123', 
  planId: 'monthly',
  amount: 1000,
  currency: 'USD',
  provider: 'stripe' // Just change this parameter!
})

// Switch providers without code changes:
// const provider = createPaymentProvider('wechat')
// const provider = createPaymentProvider('creem')
1 API
All Providers
0 Rewrites
When Switching

Project Structure

Organized monorepo structure for scalability and maintainability

Directory Structure

tinyship/
apps/# Applications Dual Framework Support
next-app/
nuxt-app/
libs/# Shared libraries
auth/
database/
payment/
email/
i18n/
permissions/
sms/
validators/
ai/

Architecture Benefits

Monorepo Architecture

Unified codebase with shared libraries and consistent tooling across all applications.

Simplified Architecture

Uses lightweight `libs` folder instead of complex packages for easier understanding and maintenance.

Type Safety

End-to-end TypeScript integration ensures type safety from database to UI.

Developer Experience

Hot reload, auto-imports, and intelligent code completion for rapid development.

Scalable Structure

Modular design allows easy addition of new features and applications.

TinyShip is not a low-code rapid deployment platform, but a professional development foundation designed for enterprise-grade applications. Built on production-proven best practices, it provides high-quality, scalable code to help you build stable and reliable commercial products.