思渡AI Logo

系统架构与重构计划

Digital Employee Platform - System Architecture & Refactoring Plan

Date: 2026-01-23 Version: 1.0 Status: In Progress

1. Domain & System Strategy (前店后厂模式)

Adopting a "Dual-Core" architecture to separate Marketing (SEO/Content) from SaaS Application (Functionality/Interactive).

ComponentDomainTech StackResponsibilityNote
Official Portalwww.sdosoft.comNext.js (SSG) / AstroMarketing & Lead Gen: SEO, Products, Solutions, Pricing, Cases.Focused on speed & static content.
AI Consoleai.sdosoft.comNext.js (App Router)SaaS Application: Workspace, Digital Employees, GEO Dashboard, Settings.Heavily interactive, client-side rendering.
API Gatewayapi.sdosoft.comFastAPIBackend Services: Business logic, DB access, AI Agents orchestration.Stateless REST API.
Documentationdocs.sdosoft.comDocusaurus / GitBookDev Support: User manuals, API references.Static site.

2. Monorepo Directory Structure

The project will transition to a structured Monorepo to manage these distinct applications.

e:\DigitalEmployee\
├── apps\
│   ├── web-console\       # [Current] -> Deployed as ai.sdosoft.com
│   │   ├── app\
│   │   │   ├── geo\       # GEO Dashboard
│   │   │   ├── workforce\ # Digital Employee Management
│   │   │   └── ...        # Functionality Modules
│   │   └── ...
│   │
│   ├── official-site\     # [New] -> Deployed as www.sdosoft.com
│   │   ├── app\
│   │   │   ├── solutions\ # Migrated from console
│   │   │   └── landing\   # Migrated from console
│   │   └── ...
│   │
│   └── docs\              # [Future] -> Deployed as docs.sdosoft.com

├── services\
│   ├── digital-brain\     # Core API Service
│   └── rpa-worker\        # Browser Automation Workers

└── shared\                # Shared Resources
    ├── schemas\           # JSON/Pydantic Schemas
    └── ui-kit\            # (Planned) Shared React Components

3. Auth & Session Strategy (Unified Experience)

To ensure seamless transitions between www and ai, we share authentication state via Root Domain Cookies.

  • Cookie Domain: .sdosoft.com (Allows subdomains to access).
  • Token Storage: access_token stored in Cookie (HttpOnly recommended) or Client Storage with domain check.
  • User Flow:
    1. User lands on www.sdosoft.com.
    2. System checks for Token.
      • If present: Header button shows "Enter Console" -> Links to ai.sdosoft.com.
      • If absent: Header button shows "Login / Sign Up".
    3. Login happens on ai.sdosoft.com/login (or centralized auth).
    4. On success, Token is written to .sdosoft.com.

4. Refactoring Roadmap

Phase 1: Preparation (Current)

  • Document Architecture.
  • Initialize apps/official-site structure.
  • Configure apps/web-console as the dedicated AI Console (metadata updates).

Phase 2: Migration

  • Move apps/web-console/app/landing -> apps/official-site/app/page.tsx (Home).
  • Move apps/web-console/app/solution -> apps/official-site/app/solution.
  • Clean up web-console to remove static marketing pages.

Phase 3: Integration

  • Implement Shared Cookie Logic.
  • Unify UI Design System (Colors, Fonts) across apps.