How kirakira-douga/kirakira-cerasus works
Main high-level components
• Frontend Application – Represented mainly by the Nuxt 3 app that uses Vue 3 and Vite, configured via nuxt.config.ts.
• Pages & Routing – The “pages” directory implements dynamic routing, error pages, and various site sections (e.g., search, user, video, settings).
• UI Components – The “components” directory contains a wide range of reusable Vue Single File Components (SFCs) that implement UI widgets, dialogs, menus, and custom directives.
• Modules – Modules (in the “modules” directory) such as components-globalized, noscript, theme, and unsupported-browsers add extended or conditional functionality. They encapsulate more advanced behavior and integration patterns.
• Composables & Stores – Located in “composables” and “stores”, these provide reactive data management, API calls (such as for comments, video, user data, danmaku, etc.), state management (using Pinia), and helper functionality for event handling.
• Plugins & Providers – The “plugins” and “providers” directories set up integrations with Nuxt and third-party services (for image hosting, custom directives like ripple and tooltip, and configuration of postcss, vite, etc.).
• Internationalization – With “locales” and enhanced Vue-i18n usage, this area is responsible for handling translations and locale-specific content.
• Server & Environment Setup – Although primarily a client-side project, the “server” directory holds HTTPS certificates (for local development with secure connection) and the “nuxt.config.ts” along with environmental files (pnpm-lock, .npmrc, tsconfig.json) help drive the build/deployment process.
• External Services Integration – The README and environment variables (e.g., VITE_BACKEND_URI) clearly indicate integration with local/online back-ends and external services like Cloudflare for images and streams.
Relationships and Data Flow
• UI Components together as a layer that reuses elements across pages (including the set of specialized components like Player, ComboBox, Login, Menu, etc.).
• Modules and plugins will be connected to both the core Nuxt App (affecting routing, theming, middleware) and the UI Components that are built on top of them.
• Utilities, helpers, and custom directives are shown as foundational libraries that support the application logic across all layers.
Architectural Patterns and Design Principles
• Modular Pattern: Each directory (pages, components, composables, modules, plugins) serves a clear and separated concern, which makes the system highly modular.
• MVC-Inspired Separation: Although the project uses a modern Vue-driven approach, think of pages as “views”, composables/stores as the “model” (data and business logic), and plugins/modules as the “controller” layer that manage interactions.
• Environment-Based Configuration: Emphasize that the application can run in multiple modes (local dev with local backend, with production API endpoints, and even demonstrative modes); use environment variables to indicate configuration differences.
• Custom Directive Use: Note the built-in custom directives for ripple, tooltip, etc., which encapsulate common user interactions, and show how they are part of the UI rendering.
• Responsive design: Because different layouts (error pages, immersive, responsive) are provided in “layouts”, include a block for layout management.
Relevant Technologies
• Nuxt 3, Vue 3, Vite – as central frameworks.
• TypeScript – used throughout (with tsconfig.json, .d.ts files in composables and types).
• Sass and CSS Modules – for styling, as seen with SCSS and styled components.
• Pinia – for state management.
• ESLint, Stylelint, PostCSS – as part of the code quality and build process.
• An annotation for the development workflow (local HTTPS servers, certificate usage, and build commands) to remind developers of the environment’s security nuances.