# erixnpai/front-zyxbotv2 architecture

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

- Interactive diagram: https://gitdiagram.com/erixnpai/front-zyxbotv2
- Repository: https://github.com/erixnpai/front-zyxbotv2

## Overview

##### Project Type and Purpose
- This project is a front-end application built with Angular, focused on providing a virtual assistant (chatbot) interface for students seeking university information in Nicaragua.
- The README indicates it’s called “ZyxBot” with functionalities like chat-based assistance, university search, and personalized recommendations. It serves as an educational assistance platform and incorporates user authentication with registration flows.

##### File Structure for Architectural Clues
- The top-level files (e.g., angular.json, package.json, firebase.json) indicate that this is an Angular project configured for Firebase hosting/deployment.
- The “src” directory contains the main Angular application. Look inside “src/app” for the core application logic.
- The directories are organized by functionality. Notable sections:
- Components: Multiple reusable UI components (e.g., header, footer, various chat components, interactive maps, registration forms) that construct the UI.
- Pages: Different “views” or screens such as homepage, chat, maps, and test pages.
- Auth: Contains login and registration components as well as auth routes and guards; these represent the authentication layer.
- Services: They are grouped by concerns (authentication, chat services, data access, error handling, JWT handling) outlining the business and data logic.
- Guards: Implements route protection logic for user access.
- Utils: Holds shared utilities like validators and dictionaries.
- There are configuration files (app.config.ts, app.routes.ts) which likely define the application’s routing and global settings.

##### Final Recommendations
- Do not oversimplify—capture every logical layer from user interaction (UI) to backend integrations.
- Component is diagrammed with proper relationships; for example, the authentication flow should include login/registration UI, the auth service, and route guards.
- Configuration or utility modules if they play a role in initiating the app (e.g., routing and app configuration).

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"]:::user

    subgraph "Presentation Layer"
        UI["UI Components"]:::ui
        PAGES["Pages/View Modules"]:::ui
    end

    subgraph "Business Logic Layer"
        AUTH_UI["Auth Components"]:::auth
        AUTH_SERVICES["Auth Services"]:::auth
        AUTH_ROUTES["Auth Routes"]:::auth
        AUTH_GUARDS["Route Guards"]:::auth

        CHAT_SERVICES["Chat Services"]:::service
        DATA_ACCESS["Data-Access Service"]:::service
        ERROR_SERVICE["Error Handling"]:::service
        JWT_SERVICE["JWT/Auth Service"]:::service
    end

    subgraph "Configuration & Utilities"
        APP_CONFIG["App Configuration"]:::config
        APP_ROUTING["App Routing"]:::config
        CHAT_ROUTING["Chat Routing"]:::config
    end

    subgraph "External Integration"
        FIREBASE["Firebase Config"]:::external
        TAILWIND["Tailwind Config"]:::external
    end

    User --> UI
    User --> PAGES

    UI -->|"triggers"| CHAT_SERVICES
    UI -->|"styledBy"| TAILWIND

    PAGES -->|"login/register"| AUTH_UI
    PAGES -->|"configuredBy"| APP_ROUTING

    AUTH_UI -->|"definedBy"| AUTH_ROUTES
    AUTH_ROUTES -->|"secures"| AUTH_GUARDS
    AUTH_UI -->|"calls"| AUTH_SERVICES
    AUTH_SERVICES -->|"manages"| JWT_SERVICE
    AUTH_SERVICES -->|"stateMgmt"| DATA_ACCESS

    CHAT_SERVICES -->|"managesData"| DATA_ACCESS
    CHAT_SERVICES -->|"errorHandle"| ERROR_SERVICE

    APP_CONFIG --> APP_ROUTING

    AUTH_SERVICES -->|"FirebaseIntegration"| FIREBASE
    CHAT_SERVICES -->|"FirebaseIntegration"| FIREBASE

    %% Click Events
    click UI "https://github.com/erixnpai/front-zyxbotv2/tree/main/src/app/components"
    click PAGES "https://github.com/erixnpai/front-zyxbotv2/tree/main/src/app/pages"
    click AUTH_UI "https://github.com/erixnpai/front-zyxbotv2/tree/main/src/app/auth"
    click AUTH_SERVICES "https://github.com/erixnpai/front-zyxbotv2/tree/main/src/app/services/login"
    click AUTH_ROUTES "https://github.com/erixnpai/front-zyxbotv2/blob/main/src/app/auth/auth.routes.ts"
    click AUTH_GUARDS "https://github.com/erixnpai/front-zyxbotv2/blob/main/src/app/guards/auth.guard.ts"
    click CHAT_SERVICES "https://github.com/erixnpai/front-zyxbotv2/tree/main/src/app/services/chatservices"
    click DATA_ACCESS "https://github.com/erixnpai/front-zyxbotv2/tree/main/src/app/services/data-access"
    click ERROR_SERVICE "https://github.com/erixnpai/front-zyxbotv2/tree/main/src/app/services/error"
    click JWT_SERVICE "https://github.com/erixnpai/front-zyxbotv2/blob/main/src/app/services/jwtservice.service.ts"
    click APP_CONFIG "https://github.com/erixnpai/front-zyxbotv2/blob/main/src/app/app.config.ts"
    click APP_ROUTING "https://github.com/erixnpai/front-zyxbotv2/blob/main/src/app/app.routes.ts"
    click CHAT_ROUTING "https://github.com/erixnpai/front-zyxbotv2/blob/main/src/app/pages/chat/chat.routes.ts"
    click FIREBASE "https://github.com/erixnpai/front-zyxbotv2/blob/main/firebase.json"
    click TAILWIND "https://github.com/erixnpai/front-zyxbotv2/blob/main/tailwind.config.js"

    %% Styles
    classDef ui fill:#bbdefb,stroke:#1e88e5,stroke-width:2px;
    classDef auth fill:#ffcdd2,stroke:#e53935,stroke-width:2px;
    classDef service fill:#fff9c4,stroke:#fbc02d,stroke-width:2px;
    classDef config fill:#d1c4e9,stroke:#673ab7,stroke-width:2px;
    classDef external fill:#c8e6c9,stroke:#388e3c,stroke-width:2px;
    classDef user fill:#e1bee7,stroke:#8e24aa,stroke-width:2px;
```
