# profesion-checher/professions-checker-front architecture

> Architecture diagram of the GitHub repository profesion-checher/professions-checker-front, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/profesion-checher/professions-checker-front
- Repository: https://github.com/profesion-checher/professions-checker-front

## Overview

##### 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

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser/Client"]:::external
    Browser -->|"loads index.html"| Index["index.html"]:::assets
    click Index "https://github.com/profesion-checher/professions-checker-front/blob/main/index.html"

    subgraph "Public Assets"
        Assets["public/ (Static Assets)"]:::assets
        click Assets "https://github.com/profesion-checher/professions-checker-front/tree/main/public/"
        Styles["src/assets/styles.css"]:::assets
        click Styles "https://github.com/profesion-checher/professions-checker-front/blob/main/src/assets/styles.css"
    end

    Index -->|"serves SPA"| BrowserApp

    subgraph "Vue App"
        direction TB
        App["App.vue"]:::init
        click App "https://github.com/profesion-checher/professions-checker-front/blob/main/src/App.vue"
        Entry["main.js"]:::init
        click Entry "https://github.com/profesion-checher/professions-checker-front/blob/main/src/main.js"
        Router["Vue Router"]:::router
        click Router "https://github.com/profesion-checher/professions-checker-front/blob/main/src/router/index.js"

        subgraph "Pages" 
            direction TB
            Home["Home.vue"]:::pages
            click Home "https://github.com/profesion-checher/professions-checker-front/blob/main/src/pages/Home/Home.vue"
            About["About.vue"]:::pages
            click About "https://github.com/profesion-checher/professions-checker-front/blob/main/src/pages/Home/About.vue"
            ProfList["ProfessionList.vue"]:::pages
            click ProfList "https://github.com/profesion-checher/professions-checker-front/blob/main/src/pages/Professions/ProfessionList.vue"
            ProfDetails["ProfessionDetails.vue"]:::pages
            click ProfDetails "https://github.com/profesion-checher/professions-checker-front/blob/main/src/pages/Professions/ProfessionDetails.vue"
            UserLogin["UserLogin.vue"]:::pages
            click UserLogin "https://github.com/profesion-checher/professions-checker-front/blob/main/src/pages/users/UserLogin.vue"
            UserRegister["UserRegister.vue"]:::pages
            click UserRegister "https://github.com/profesion-checher/professions-checker-front/blob/main/src/pages/users/UserRegister.vue"
            UserProfile["UserProfile.vue"]:::pages
            click UserProfile "https://github.com/profesion-checher/professions-checker-front/blob/main/src/pages/users/UserProfile.vue"
            UserEdit["UserEditProfile.vue"]:::pages
            click UserEdit "https://github.com/profesion-checher/professions-checker-front/blob/main/src/pages/users/UserEditProfile.vue"
        end

        subgraph "Components"
            direction TB
            Header["Header.vue"]:::components
            click Header "https://github.com/profesion-checher/professions-checker-front/blob/main/src/components/Fragments/Header.vue"
            Footer["Footer.vue"]:::components
            click Footer "https://github.com/profesion-checher/professions-checker-front/blob/main/src/components/Fragments/Footer.vue"
            ProfBar["ProfessionBarView.vue"]:::components
            click ProfBar "https://github.com/profesion-checher/professions-checker-front/blob/main/src/components/Professions/ProfessionBarView.vue"
            ProfCard["ProfessionCard.vue"]:::components
            click ProfCard "https://github.com/profesion-checher/professions-checker-front/blob/main/src/components/Professions/ProfessionCard.vue"
            UserCard["UserCard.vue"]:::components
            click UserCard "https://github.com/profesion-checher/professions-checker-front/blob/main/src/components/Users/UserCard.vue"
            UserProfCard["UserProfessionsCard.vue"]:::components
            click UserProfCard "https://github.com/profesion-checher/professions-checker-front/blob/main/src/components/Users/UserProfessionsCard.vue"
        end

        subgraph "Composables"
            direction TB
            Auth["useAuth()"]:::logic
            click Auth "https://github.com/profesion-checher/professions-checker-front/blob/main/src/composables/useAuth.js"
            ProfHook["useProfessions()"]:::logic
            click ProfHook "https://github.com/profesion-checher/professions-checker-front/blob/main/src/composables/useProfessions.js"
        end

        Service["Axios Instance"]:::service
        click Service "https://github.com/profesion-checher/professions-checker-front/blob/main/src/services/axios.js"
    end

    Browser -->|"bootstraps"| Entry
    Entry --> App
    App --> Router
    Router --> Home
    Router --> ProfList
    Router --> ProfDetails
    Router --> UserLogin
    Router --> UserRegister
    Router --> UserProfile
    Router --> UserEdit

    Home --> Header
    Home --> Footer
    ProfList --> ProfBar
    ProfList --> ProfCard
    ProfDetails --> ProfCard
    UserProfile --> UserCard
    UserProfile --> UserProfCard

    Home --> Auth
    ProfList --> ProfHook
    ProfDetails --> ProfHook
    UserLogin --> Auth
    UserRegister --> Auth
    UserProfile --> Auth
    UserEdit --> Auth

    Auth --> Service
    ProfHook --> Service
    Service -->|"HTTP Requests"| Backend
    Backend -->|"Responses"| Service
    Service --> ProfHook
    Service --> Auth

    classDef external fill:#f2f2f2,stroke:#666,stroke-width:1px;
    classDef assets fill:#ccf,stroke:#333,stroke-width:1px;
    classDef init fill:#bbf,stroke:#333,stroke-width:1px;
    classDef router fill:#bbf,stroke:#333,stroke-width:1px;
    classDef pages fill:#add8e6,stroke:#333,stroke-width:1px;
    classDef components fill:#87cefa,stroke:#333,stroke-width:1px;
    classDef logic fill:#cfc,stroke:#333,stroke-width:1px;
    classDef service fill:#fc9,stroke:#333,stroke-width:1px;
    class Backend fill:#ffebcd,stroke:#333,stroke-width:1px;
    Backend["Backend API"]:::external
```
