How takuyaw-w/vue3-with-todo works
Main Components
• Frontend Application Layer:
• Views: Represent pages (e.g., TodoList, CreateTodo, EditTodo, Error views) where users interact with the application.
• Components: Divided into “atoms” (e.g., NBtn, NTextInput, NBadge) and “organisms” (e.g., NNav, NTodoItems) that follow the atomic design pattern.
• Composables: Utilities encapsulating business logic (e.g., useCreateTodo, useEditTodo, useTodoView) to handle stateful behavior and reusability.
• Router: Contains routing configurations and navigation management (src/router).
• Store: Central state management (todoStore) that holds and updates the TODO data.
• Utilities: Helper functions (e.g., stringsHelper) that support repeated operations.
• Assets & Styling:
• Static assets (CSS, images) collected under “assets” directories.
• Global styles applied to the entire application.
• Configuration & Build:
• Tooling and configuration files (Vite, ESLint, Prettier, TypeScript configs) that enable robust development and testing environments.
• Testing:
• Unit tests under components’ __tests__.
• End-to-end tests using Playwright and Vitest configuration files.
Relationships & Interactions
• Data Flow:
• User interactions in the Views and Components trigger events which, via composable functions, update the central store.
• The Router defines navigation between Views (e.g., editing a TODO or listing them).
• The Store communicates changes back to the UI components ensuring the reactive update of displayed data.
• Architectural Patterns & Design Principles:
• Atomic Design: Components are organized into “atoms” (small, reusable UI elements) and “organisms” (composite groupings forming larger UI sections).
• Separation of Concerns: Clear division of UI, state management, business logic (via composables), and routing.
• Component-driven Architecture: Emphasis on modularity that aids in testing (note the dedicated __tests__ directory).