# rtcface/oic-platform architecture

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

- Interactive diagram: https://gitdiagram.com/rtcface/oic-platform
- Repository: https://github.com/rtcface/oic-platform

## Overview

##### Main Components Identification
a. Frontend Angular Application – The central component that delivers all of the client-side features.
b. Feature Modules – Break down the application into its logical modules:
- Authentication Module – Handles user login, registration, password change, and security (guards, interfaces).
- Portal Module – Likely provides the public or user-specific entry point.
- OIC Module – Contains several pages surrounding “datos-generales”, “plan-trabajo”, and others that appear to be a distinct domain within the application.
- Protected/Protected-admin Modules – These modules provide access to administrative or restricted system views (admin home, kpis, users, work plan, etc.), each with its own routing and page components.
- Shared Module – Contains reusable components such as headers, sidebars, menus, cards, and shared services.
- GraphQL Module – Handles GraphQL integration, including constants, interfaces, and services to communicate with backend APIs.
c. Assets and Environments – The assets directory holds style sheets, images, and JSON databases (e.g., entes.json, plan-trabajo.json). Environment files set configurations for development and production.

##### Relationships and Interactions
- The Angular application is the container in which all feature modules operate.
- Routing modules in each feature (e.g., auth-routing, notfound-routing, portal-routing, etc.) define navigation paths and component interactions.
- Authentication interacts with route guards to protect restricted resources.
- The GraphQL module communicates with external backend services (depicted as an API layer) to fetch and update data.
- Firebase configuration files indicate that deployment, hosting, and environment settings are managed through Firebase.
- Shared components get included across various modules to ensure a consistent user interface (e.g., header, footer, sidebar).

##### Architectural Patterns & Design Principles
- Component-based Architecture inherent to Angular.
- Modularization – the separation into feature modules (Auth, OIC, Protected, etc.) that isolating functionalities.
- Use of Route Guards (e.g., auth.guard and type-portal.guard) encapsulate access control logic.
- Separation of concerns – by dividing interfaces, services, pages, and models into distinct directories.
- Integration with external services (GraphQL and Firebase) for data operations and hosting.

##### Relevant Technologies & Frameworks
- Angular Framework (TypeScript, Angular CLI).
- GraphQL for data exchange.
- Firebase for deployment and hosting.
- Testing tools like Karma for unit tests.
- PrimeNG (noted by prime-ng folder) is also incorporated for UI components.
- SCSS for styling.
- Various components use Angular routing, services, and dependency injection.

##### Elements
- Use clear labels for every major component (e.g., "Auth Module", "OIC Module", etc.).
- Data flow from the Angular application to external services (GraphQL API, Firebase).
- Navigation paths between modules, especially how authentication influences route guards.
- Interaction between shared components and feature modules.
- Core modules vs. shared services/components.
- External dependencies (Firebase, GraphQL API) vs. internal application modules.
- Optionally, illustrate configuration files (angular.json, firebase.json) in a separate “DevOps/Configuration” segment to clarify how the build and deployment is managed.

##### Recommendations for Detail
- Don’t hesitate to break modules into subcomponents if they have further subdivisions (for instance, within the Auth module, you have separate pages for login, register, and change-password).
- That the guards (auth.guard, type-portal.guard) and services are clearly indicated as enabling security and data flow control.
- Notes or annotations regarding integration points (e.g., GraphQL services and Firebase configurations).

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Angular Application"]:::app

    subgraph "Feature Modules"
        Auth["Auth Module"]:::module
        Portal["Portal Module"]:::module
        OIC["OIC Module"]:::module
        ProtAdmin["Protected-admin Module"]:::module
        Protected["Protected Module"]:::module
        Shared["Shared Module"]:::module
        GraphQL["GraphQL Module"]:::module
    end

    subgraph "External Services"
        GAPI["GraphQL API Service"]:::external
    end

    subgraph "Static Resources"
        Assets["Assets"]:::external
        Environments["Environments"]:::external
    end

    subgraph "DevOps/Configuration"
        Firebase1["Firebase (.firebaserc)"]:::external
        Firebase2["Firebase (firebase.json)"]:::external
    end

    A -->|"loads"| Auth
    A -->|"loads"| Portal
    A -->|"loads"| OIC
    A -->|"loads"| ProtAdmin
    A -->|"loads"| Protected
    A -->|"loads"| Shared
    A -->|"loads"| GraphQL

    GraphQL -->|"calls"| GAPI

    Auth -->|"uses"| Shared
    Portal -->|"uses"| Shared
    OIC -->|"uses"| Shared
    ProtAdmin -->|"uses"| Shared
    Protected -->|"uses"| Shared

    A -->|"includes"| Assets
    A -->|"includes"| Environments

    A -->|"deployed via"| Firebase1
    A -->|"deployed via"| Firebase2

    click A "https://github.com/rtcface/oic-platform/blob/main/src/app/app.module.ts"
    click Auth "https://github.com/rtcface/oic-platform/tree/main/src/app/auth/"
    click Portal "https://github.com/rtcface/oic-platform/tree/main/src/app/portal/"
    click OIC "https://github.com/rtcface/oic-platform/tree/main/src/app/oic/"
    click ProtAdmin "https://github.com/rtcface/oic-platform/tree/main/src/app/protected-admin/"
    click Protected "https://github.com/rtcface/oic-platform/tree/main/src/app/protected/"
    click Shared "https://github.com/rtcface/oic-platform/tree/main/src/app/shared/"
    click GraphQL "https://github.com/rtcface/oic-platform/tree/main/src/app/graphql/"
    click Assets "https://github.com/rtcface/oic-platform/tree/main/src/assets/"
    click Environments "https://github.com/rtcface/oic-platform/tree/main/src/environments/"
    click Firebase1 "https://github.com/rtcface/oic-platform/blob/main/.firebaserc"
    click Firebase2 "https://github.com/rtcface/oic-platform/blob/main/firebase.json"

    classDef app fill:#6BA5FF,stroke:#333,stroke-width:2px;
    classDef module fill:#F9D423,stroke:#333,stroke-width:2px;
    classDef external fill:#F76C6C,stroke:#333,stroke-width:2px;
```
