$ show tianxingleo/ACGTI
ACGTI (ACG Type Indicator) is a production-grade, open-source web application that delivers a personality quiz matching users to anime characters based on MBTI dimensions. The frontend is a Vue 3 SPA with TypeScript, Vite, and vue-router, featuring 39 Likert-scale questions, 8 archetypes, and over 100 curated characters with multilingual support (zh-CN, zh-TW, en, ja). The backend runs on Cloudflare Pages Functions with D1 database for anonymous statistics collection, AI-generated insights via Workers AI, and a cron worker for periodic stats snapshots. The codebase includes extensive offline analysis scripts (Python and Node.js) for weight calibration, probability simulation, and data validation, demonstrating a hybrid character with strong data engineering practices. The architecture is clean: frontend scoring engine is decoupled from backend, i18n is well-structured, and CI/CD pipelines enforce data integrity. While the project is actively maintained and uses modern tooling, some manual synchronization points (e.g., count constants, duplicate data sources) introduce minor fragility.
The LLM identified 5 files worth highlighting for reuse:
Implements the core MBTI scoring algorithm: computes four dimension scores from 39 weighted answers, maps to archetypes, ranks characters by vector similarity with tie-breaking rules. Pure TypeScript with no framework dependencies, making it extractable for any quiz or recommendation system.
Provides color conversion (hex to RGB/HSL), relative luminance calculation, and readable text color selection based on background contrast. Self-contained and reusable for any web project needing dynamic color theming with accessibility guarantees.
Encapsulates localStorage operations with JSON serialization, error handling for quota exceeded or corrupted data, and a simple key-value API. Can be extracted as a lightweight persistence utility for any browser-based application.
A standalone Node.js script that validates the entire character dataset: checks image asset existence, question ID references, weight synchronization between engine and audit files, i18n completeness, and bidirectional consistency between source files and aggregated JSON. Demonstrates a robust validation pattern applicable to any data-heavy project.
Manages quiz state (current question, answers, progress persistence, result calculation) using Vue 3 composable pattern. Handles asynchronous data loading, localStorage recovery, and integration with the scoring engine. While Vue-specific, the state machine and persistence logic are reusable patterns for any quiz or survey application.