How tsukasa-u/fusou works
Project type and purpose
• This is a polyglot monorepo combining:
• FUSOU-PROXY (Rust-based HTTP/HTTPS proxy services)
• FUSOU-APP (Tauri desktop application using Rust + TypeScript/React)
• FUSOU-WEB (Astro-based web frontend with React/Solid and Supabase/duckDB backend)
• shared-ui (UI component library)
• Purpose:
• Intercept KanColle game HTTP traffic via local proxy
• Parse and expose in-game data in a Tauri desktop viewer
• Optionally upload or sync parsed data to a Supabase-powered online store
• Provide an online portal for exploring aggregated/analyzed data
High-level file-structure analysis
• Top-level directories:
• packages/FUSOU-PROXY – Rust crates for proxy-http and proxy-https
• packages/FUSOU-APP – Tauri front-end (TypeScript/React + Rust CLI & library crates)
• packages/FUSOU-WEB – Static/Astro site with serverless API routes (Supabase auth)
• packages/shared-ui – Storybook and reusable UI components
• FUSOU-APP substructure:
• kc_api – Rust library for parsing KanColle API JSON → tables → interfaces
• register_macro_derive_and_attr & register_trait – Rust proc-macro crates for code generation
• src-tauri – Tauri wrapper & system-level commands (proxy control, Google Drive, Discord, Supabase)
• src – React/TypeScript UI components, pages, Tailwind CSS, Vite config
• FUSOU-WEB substructure:
• Astro configuration, serverless API routes for authentication & data access
• React/Solid chart components, duckDB in-browser, Google Drive integration
Key insights from README
• System is split into local (“in-game viewer”) vs. online (“analyzed data viewer”)
• FUSOU-PROXY relays/records HTTP(S) traffic through a proxy server
• FUSOU-APP is the minimal desktop viewer (Tauri)
• FUSOU-WEB is the web portal for aggregated/analyzed data
• Future plan: collect data from many users, run analytics
Main components
a. Components:
• Game Client (KanColle browser or DMM client)
• Local Proxy Servers (HTTP & HTTPS)
• Tauri Desktop App:
– kc_api Rust library (parsing & database layer)
– register_macro_derive_and_attr & register_trait (proc-macros)
– Tauri runtime (Rust + TypeScript/React UI)
– Local storage (e.g., SQLite or local file)
– Optional upload service (Supabase client)
• Online Service:
– Supabase Authentication & Database
– Serverless API Routes (Astro)
– Web Frontend (Astro + React/Solid)
– In-browser duckDB & Google Drive integration
• shared-ui library (used by both app & web)
b. Relationships & data flows:
1. Game Client → (configured to use) → Local Proxy (HTTP/HTTPS)
2. Proxy → forwards requests to KanColle servers, logs JSON responses
3. Tauri App → reads from Proxy or watches local proxy log port
4. kc_api → parses JSON → domain structs → stores in local DB
5. Desktop UI → reads from local DB → renders tables/charts
6. Desktop App → (optionally) → Supabase client → pushes selected data
7. Web Frontend → Supabase auth → fetches aggregated data → renders charts
8. Web → optional in-browser duckDB for client-side analytics
9. Google Drive integration for additional storage/backup
c. Architectural patterns & principles:
• Hexagonal/Clean architecture in Rust kc_api (database vs. interface vs. core)
• Proc-macro crates for code generation (DRY & maintainable interface definitions)
• Micro-frontend separation: local app vs. web portal
• Serverless functions for auth & data endpoints (Astro + Supabase)
• Shared component library (shared-ui) for consistent design
d. Key technologies & frameworks:
• Rust & Cargo (kc_api, proxy servers, proc-macros, Tauri backend)
• Tauri (desktop shell → Rust + TypeScript bridge)
• TypeScript + React + Vite + Tailwind CSS (desktop UI)
• Astro + React + Solid (web portal)
• Supabase (auth, real-time DB)
• duckDB (in-browser SQL analytics)
• Google Drive API (backup/export)