How yebinnnnn/moneylover works
Project type and purpose
• This is a front-end, mobile-first web application (“MoneyLover”) built with Vue 3 + Vite. It provides personal finance features: recording income/expenses, visualizing charts, calendar views, budget management, and savings goals. There is no dedicated backend in the repo; a local JSON file (db.json) is likely used with a mock server or will be replaced by a real REST API.
File structure
• Top-level: configuration files (.gitignore, package.json, vite.config.js), a mock database (db.json), and public/index.html.
• src/: the heart of the app
• main.js / App.vue: bootstraps the Vue application and mounts router + Pinia.
• router/index.js: defines client-side routes for pages.
• stores/*.js: Pinia stores (budget, saving, user, counter) hold application state and perform API calls via Axios.
• pages/: grouped by feature (home, charts, plus, saving, login, mypage), each containing view components and subcomponents (e.g., ExpenseChart.vue, IncomeList.vue).
• assets/: CSS, fonts, images for UI.
• utils/: helper functions (hash.js, navigation.js).
• constants/translate.js: static text or i18n keys.
Key technologies & frameworks (from README)
• Vue 3 (core UI), Vue Router (routing), Pinia (state management)
• Axios (HTTP), Day.js (date handling), Chart.js / v-calendar (visuals), SweetAlert2 (alerts), Bootstrap 5 (styling)
• Vite (build tool), Prettier, Font Awesome, Figma (design)
• Browser / Client
• Vue Application
· Router Layer
· View Layer (Pages & Components)
· State Layer (Pinia Stores)
· Service Layer (Axios HTTP client)
· Utility Layer (utils, constants)
• Assets Layer (CSS, fonts, images)
• Mock API / Real API (db.json or external backend)
• External Libraries & Services (Chart.js, Day.js, SweetAlert2)
• User → Browser UI → Router → Page Components
• Components → dispatch/pull from Pinia Store
• Pinia Store ↔ Axios Service → Mock API/Backend
• Store updates → Components re-render → Charts & Calendar libraries consume data
• Utils/Constants are imported by Pages, Stores, or Components
c. Architectural patterns & principles:
• Component-based UI with single responsibility (Vue SFCs)
• Unidirectional data flow: components dispatch actions, stores update state, state propagates back
• Modular folder structure by feature to enforce separation of concerns
• Pluggable service layer (HTTP client) for easy swap of mock vs. real API
• Public/index.html and Vite serve the app; vite.config.js configures the build