How projeto-pw-402/back-office works
Project Type and Purpose
• This is a front-end SPA built with Vue 3, using Vite as bundler/dev server.
• It serves as a “Back-Office” admin interface (dashboards, CRUD pages) that communicates with one or more backend REST APIs.
File Structure
• src/main.ts: Application entry point — mounts the Vue app.
• src/router/index.ts: Controls navigation between pages.
• src/pages & src/subpages: Top-level views (Dashboard, Login, Materiais, etc.) and modal/detail subviews.
• src/components: Reusable UI pieces (Navbar, charts, statistics).
• src/services: HTTP client modules (auditoriasService, materialService, userService) that wrap calls to external APIs.
• src/models: TypeScript interfaces/classes for domain entities (User, Material, Auditoria).
• public & index.html: Static assets and HTML container.
• Configuration: vite.config.ts, tsconfig*.json, eslint.config.ts.
README for Insights
• Reinforces that this is a Vue 3 + Vite template.
• No built-in backend — all data flows via services to external endpoints.
• Uses pnpm, ESLint, Volar for TypeScript support.
Main Components and Their Relationships
a. Browser/User
– Initiates the SPA by loading index.html.
b. Vite Dev/Build Pipeline
– Dev server serves modules, supports HMR.
– Build process bundles and outputs static assets.
c. SPA Layer
– main.ts: bootstraps Vue app.
– Router: client-side routing between pages/subpages.
– Pages & Subpages: view components representing screens and dialogs.
– Components: UI building blocks used across pages.
– Services: abstraction layer for all HTTP interactions.
– Models: Type definitions ensuring type safety end-to-end.
d. External Backend API(s)
– REST endpoints for users, materials, auditorias, etc.
– Services call these endpoints, parse JSON into Models, surface results to components.
Architectural Patterns & Principles
• Component-based UI (Vue).
• Separation of concerns:
• Presentation (components/pages)
• Routing (router)
• Data access (services)
• Domain (models)
• Typed contracts between layers (TypeScript interfaces).
• Config-driven build/dev (Vite + tsconfig + eslint).