How profesion-checher/professions-checker-front works
Project Type and Purpose
• This is a Single-Page Application (SPA) front-end built with Vue.js and Vite.
• It provides a user interface for the “Profession Checker” service, consuming a separate backend API.
File-Structure Analysis
• Root: index.html, package.json, vite.config.js → SPA entry, build config.
• public: static assets served as-is.
• src/: application source
• main.js → Vue app bootstrap
• router/index.js → client-side routing (Vue Router)
• composables/ → reusable composition-API hooks (useAuth, useProfessions)
• services/axios.js → Axios instance for API calls
• components/ → UI building blocks, organized by domain
– Fragments: Header, Footer
– Professions: ProfessionBarView, ProfessionCard
– Users: UserCard, UserProfessionsCard
• pages/ → view components mapped to routes (Home, Professions, Users)
• assets/: global styles, images, etc.
• tests/: unit tests for components and pages
Key Architectural Patterns
• SPA with Vue 3 + Composition API
• Layered separation:
• Presentation (pages & components)
• State & logic (composables)
• Data access (services/axios)
• Client-side routing for view navigation
• RESTful API communication via Axios
Main Components
1. Browser/Client – hosts the Vue SPA
2. Vue App – entry point (main.js)
3. Router – resolves URL → page component
4. Pages – high-level views (Home, ProfessionList, ProfessionDetails, UserProfile, etc.)
5. Components – reusable UI fragments (cards, bars, header/footer)
6. Composables – application logic & state hooks (authentication, profession data)
7. Services – Axios instance, handles HTTP to backend
8. Backend API – external REST service (authentication endpoints, professions endpoints, user endpoints)
9. Optional: Public assets and style sheets
Relationships & Data Flow
• Browser loads index.html → bootstraps Vue App
• Vue App uses Router to mount Page components
• Pages import Components and call composables for data/state
• Composables call Services/axios → HTTP requests to Backend API
• Responses flow back into composable state → rendered by components
• User-initiated events (login, register, edit, fetch professions) travel same path in reverse