How iabacus2024dev/frontend works
Main Components
• Application Entry Point: Represent the “index.html” and “src/main.js” which bootstrap the Vue application.
• UI Layers:
• Vue Components (inside src/components) broken down by feature domains (login, employee, partners, permission, profile, project, searchbar, table, and tree).
• Layouts (src/layouts) that guide the page structure (e.g., DefaultLayout.vue, LoginLayout.vue).
• Views (src/views) that act as pages – each grouping UI components for different application features (HomePage, LoginPage, EmployeePage, etc.).
• Routing & State Management:
• Router (src/router/index.js) which defines the navigation routes between views.
• Stores (src/stores) that manage global state (e.g., counter.js, dialogStore.js, roleStore.js, member.js).
• API & Data Abstraction:
• Adapters (src/adapters/restApiAdapter.js) which act as the central HTTP communication layer.
• API Service Modules (under src/apis) such as authService, classificationService, contractService, etc. that encapsulate domain-specific REST calls.
• Configuration (src/config/restApiConfig.js) that holds API endpoint/environment details.
• Plugins & Utilities:
• Plugins (src/plugins/vuetify.js) that integrate third-party libraries like Vuetify.
• Utility modules (src/utils/MoneyUtils.js) for shared logic or helper functions.
• Development & Build Tools:
• Vite configuration (vite.config.js and vitest.config.js) for bundling and testing, plus configuration files such as .gitignore, eslint.config.js, and Prettier config.
Relationships and Interactions
• The application boots from index.html and runs src/main.js that sets up the Vue instance.
• The Vue router controls which view is rendered based on the URL. Views then compose various components.
• UI components retrieve or update the application state via the stores.
• When a component requires data, it calls the API service modules which use the common REST adapter for HTTP requests.
• The REST adapter uses configurations defined under src/config to know the endpoints.
• Plugins such as Vuetify modify the UI appearance and behavior.
• External services (as hinted by the existence of REST APIs like authService, contractService, etc.) are abstracted behind the API layer.
Important Architectural Patterns
• Separation of Concerns: Notice the clear division between the view layer (components and layouts), the state management (stores), and the data access layer (adapters and API services).
• Modularization: Each domain (employee, partner, project, etc.) has its own set of components and API modules.
• Component-Driven Development: Vue components are organized by functionality ensuring maintainability.
• Configurability: Use of dedicated configuration and utility directories promotes easier modifications and reuse.