How 67au/ornacodex works
PROJECT TYPE & PURPOSE
• This is a front-end, single-page application (SPA) built with Vue.js (using components, plugins, and state management) for a specialized codex.
• Its purpose is to provide a richer experience for browsing and comparing data related to the OrnaRPG codex. It pulls data using an internal API client, integrates with third-party services (such as OrnaGuide), and includes specialized tools for search, comparison, and calculation (e.g., gear quality, guild certificates).
KEY COMPONENTS & ARCHITECTURAL SECTIONS
• Browser / Client: The end user interacts with the application via the web browser.
• Entry Point:
• index.html loads the Vue application.
• main.ts (under src/) bootstraps the app.
• Presentation/UI Layer:
• App.vue (the root component).
• Views: Found in src/views (e.g., HomeView, CodexView, ShareView) that represent different “pages”.
• Layout: MainLayout.vue in src/pages encapsulates common UI structure.
• Components Layer:
• A rich component folder under src/components with subdirectories indicating modularity (Header, Home, CodexEntry, Popup, Utils).
• Each folder (like CodexEntry or Header) groups related components (e.g., AbilityCard, BestialBondCard, AppThemeSwitch, etc.).
• Routing Layer:
• Vue Router configuration in src/router/index.ts.
• Determines how users navigate between views.
• State Management:
• Stores located under src/stores (several files for codex, compare, entriesList, etc.) for maintaining application state.
• Plugins & Utilities:
• Found in src/plugins, which include modules for various functionalities like assess, codex, filters, guide, proof, and extra utilities.
• Global plugins (src/plugins/global.ts) and helper functions unify common actions across components.
• Internationalization (i18n):
• The src/i18n folder manages localization including locale.json and index.ts.
• Styling & Assets:
• Assets in src/assets (including JSON data files).
• Type Declarations & Enums:
• Declarations in files like auto-imports.d.ts, components.d.ts, and src/enums for standardized types.
EXTERNAL DATA & INTEGRATIONS
• Data Sources:
• The codex data comes from the official OrnaRPG Codex and uses tools like Codex Crawler.
• Additional data is fetched via the OrnaGuide API client.
• External Links:
• The README includes references to Official and OrnaGuide websites.
• Tools:
• There’s an inbuilt “YACO 品质查询工具” for gear quality and comparison functions.
ARCHITECTURAL PATTERNS & DESIGN PRINCIPLES
• Component-Based Architecture: The project is organized into small, self-contained Vue components.
• Modularization: Separation of concerns is visible – routes, stores, plugins, views, and components are all isolated.
• Single-Page Application Pattern: Navigation is controlled on the client side using Vue Router.
• Extensibility: The use of plugins and stores facilitates the addition of new features without major rewrites.