Steadii Docs

Kiến trúc

Tổng quan kiến trúc hệ thống Steadii

Sơ đồ tổng quan

┌────────────────────────────────────────────┐
│        Cloudflare Pages (CDN)               │
│  steadii.dahodo.com / dudeu.dahodo.com      │
└──────────────────┬─────────────────────────┘
                   │ Static SPA
┌──────────────────▼─────────────────────────┐
│        Frontend (React + Vite)              │
│  TypeScript, TailwindCSS v4, Zustand        │
│  PWA: vite-plugin-pwa + Workbox             │
└──────────────────┬─────────────────────────┘
                   │ HTTPS REST API
┌──────────────────▼─────────────────────────┐
│        Backend (Express.js)                 │
│  api.dahodo.com/steadii/*                   │
│  Auth: Google OAuth 2.0 → JWT               │
│  Payments: LemonSqueezy REST API            │
└──────────────────┬─────────────────────────┘
                   │ pg (node-postgres)
┌──────────────────▼─────────────────────────┐
│        PostgreSQL 16                        │
│  4 tables: users, user_data,                │
│  push_subscriptions, subscriptions          │
└────────────────────────────────────────────┘

Tech Stack

LayerTechnologyVai trò
FrontendReact 18 + TypeScriptUI components
BuildVite 6Bundler + dev server
StylingTailwindCSS 4CSS utility classes
StateZustand 5Global state (persisted localStorage)
RoutingReact Router 6Client-side routing
IconsMaterial Symbols OutlinedVariable icon font
PWAvite-plugin-pwa + WorkboxService worker, offline, install
BackendExpress.js 5REST API server
DatabasePostgreSQL 16Persistent data storage
AuthGoogle OAuth 2.0 + JWT RS256User authentication
PaymentsLemonSqueezy REST APISubscription billing
CDNCloudflare PagesFrontend hosting
VPSDocker Compose + NginxBackend hosting

Cấu trúc thư mục

steadii/
├── frontend/src/
│   ├── pages/         # 8 trang
│   ├── components/    # 14 components
│   ├── hooks/         # useAuth, useSubscription
│   ├── store/         # Zustand store
│   ├── utils/         # API, sync, audio, helpers
│   ├── i18n/          # Translations (en.ts, vi.ts)
│   └── types/         # TypeScript interfaces
├── backend/src/
│   ├── index.js       # Express routes
│   ├── db.js          # PostgreSQL queries
│   ├── auth.js        # Google OAuth verification
│   └── stripe.js      # LemonSqueezy integration
└── steadii-docs/      # Fumadocs (this site)

On this page