How callum-jones19/coralia works
Main Components
• Frontend Application:
• Located under the “src” directory.
• Contains the user interface, React components (organized in folders like “components”, “screens”, “hooks”, etc.), API command definitions (“src/api”), and styling (Tailwind, CSS).
• Manages user interactions, state management, and routing between various screens (Library, Settings, Onboarding, Fullscreen, etc.).
• Backend Application (Tauri/Rust):
• Located under the “src-tauri” directory.
• Contains the Rust code that handles core functionalities like file scanning for local music libraries, audio playback management, native OS media control integration, and data processing (data models such as album.rs, song.rs, library.rs, etc.).
• Assets and Configurations:
• Assets folder contains images and UI assets.
• Configuration files (e.g., package.json, tauri.conf.json, dprint.json, postcss.config.js) provide build, linting, and deployment instructions.
• Additional schema files inside src-tauri/gen/schemas provide structured configuration details for various platform capabilities (e.g., Linux, Windows, macOS).
Relationships and Interactions
• The Frontend communicates with the Backend using API calls (for example, through the “src/api/commands.ts”), which in Tauri are implemented via inter-process communication (IPC).
• On user actions (like playing a song, scanning folders, searching), the frontend triggers an API command that the Tauri backend handles.
• The backend, implemented in Rust, processes the requests by interacting with the local file system (e.g., to read audio metadata, manage libraries) and then returns results to the frontend.
• The UI components (React TSX components residing in “src/components” and “src/screens”) present the data and maintain state for features like queues, searches, and settings.
Architectural Patterns and Design Principles
• Separation of Concerns – the UI (frontend) and business logic (backend) are distinctly separated.
• Full-Stack Application – although it runs locally, it still adheres to a full-stack design, with clear API boundaries between frontend and backend.
• Use of a Modern Framework (Tauri) – this offers cross-platform capabilities and native integration, combined with a modern frontend framework to build a responsive user interface.
• Modular Organization – the codebase is neatly organized into modules (e.g., data models, UI components) to enable maintainability and extensibility.