How tripeasycompany/frontend works
Project type and purpose
• This is a single-page application (SPA) front-end for “TripEasy,” built with Vue.js (via Vite).
• It provides both public (“front”) user-facing pages (search, home, about) and an admin console (user management, site settings, dashboard).
• It lives as static assets (HTML/CSS/JS) deployed to a GitHub Pages or similar static host and interacts with a separate backend via RESTful APIs.
File structure
• Top-level:
• index.html / public/ – static entry point + assets & redirect rules
• src/ – main application code
• src/router/ – Vue Router setup for front vs. admin routes
• src/stores/ – Pinia (Vue store) modules (userStore.js, counter.js)
• src/views/ – page containers, subdivided into front/ and admin/ (with manage/)
• src/utils/ – api.js (HTTP clients), function.js (helpers)
• Build & deploy config: vite.config.js, static.json, .github/workflows/gh-pages.yml
• CSS/asset pipelines: SCSS/CSS under src/assets
Architectural patterns
• Component-based UI (Vue single-file components)
• Client-side routing (Vue Router) separating front-end and admin sections
• Global state management (Pinia stores) for user session and counters
• Utilities layer (HTTP API client) decouples API calls from components
• Static-site CI/CD pipeline via GitHub Actions → builds & deploys to GitHub Pages or similar
Main components
a. User Browser
b. Static Hosting/CDN (GitHub Pages, Netlify, S3)
c. Vue SPA – App.vue root
• Router Layer (router/index.js)
– Front Routes → HomeView, AboutView, front/searchPage.vue …
– Admin Routes → loginPage, memberPage, manage/dashboardPage.vue …
• State Layer – Pinia stores (userStore, counter)
• Utils Layer – API client (api.js) + helper functions (function.js)
• Assets – SCSS/CSS, images
d. Backend Services (external REST API, authentication service, data store)
e. CI/CD Pipeline (GitHub Actions building via Vite, deploying static files)
Relationships and data flow
• Browser → (HTTP GET) → Static Host → Serves index.html + JS/CSS
• App.vue loads → initializes Pinia and Router
• User navigation → Router resolves view → component tree renders
• Components / stores call api.js → HTTP requests → Backend Services → JSON responses
• CI/CD: GitHub Actions → on push to main/dev → runs npm run build → deploys /dist to Pages
Architectural patterns & design principles
• SPA (MVVM-like): App (ViewModel) binds data from stores to Views (components)
• Separation of concerns: Routing, State, UI, API, Assets each in its own folder
• Module isolation: front vs. admin views live in dedicated subdirectories
• CI/CD as code: workflow .yml orchestrates build and deployment
Essential elements to capture
• Separation of public (front) vs. admin modules
• Client-side routing resolving to different views
• Centralized state (Pinia) feeding multiple components
• API abstraction layer (api.js) decoupled from UI
• Build & deploy process as part of the overall architecture