# sistemasvillaallende/tasa_front architecture

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

- Interactive diagram: https://gitdiagram.com/sistemasvillaallende/tasa_front
- Repository: https://github.com/sistemasvillaallende/tasa_front

## Overview

##### Project Type and Purpose
- This is a front-end single-page application (SPA) built with React and TypeScript, using Vite as the build tool and Tailwind/PostCSS for styling.
- Purpose: “Aplicación de Tasa a la propiedad” – a property-tax management interface (user authentication, listing/consulting “cedulones,” handling payments, reports, etc.).
- All code lives under `src`; there is no in-repo backend. The app likely communicates with external REST endpoints (configured via `.env.prod`) or uses local JSON mocks.

##### File-Structure Analysis
- Top-Level:
- `index.html` + `public/` → static assets entry point
- `vite.config.ts`, `tsconfig*.json`, `tailwind.config.js`, `postcss.config.js` → build/config
- `package.json` → dependencies/devtools
- `.env.prod` → production API endpoints
- `src/`:
- `assets/` → CSS, images, JSON fixtures
- `base-components/` → reusable UI primitives (buttons, form controls, CKEditor wrappers…)
- `components/` → domain-specific components (header, invoice, menus…)
- `layouts/` → page layout wrappers (side menu, top menu, simple menus…)
- `pages/` → route targets, grouped by feature (Tasa, CtasCtes, Deudas…)
- `router/` → React-Router setup
- `stores/` → Redux slices + store configuration
- `context/` → React Context providers (User, Tasa, Cedulones)
- `utils/` + `modules/` → helper functions, API wrappers, secure storage
- `interfaces/` + `types/` → TypeScript models and declarations

##### Key Architectural Patterns
- Component-Based: all UI is broken into base-components → components → pages.
- State Management: hybrid of React Context (for domain-specific state) and Redux Toolkit slices (global UI state like menus, darkMode, checkout).
- Build & Deploy: Vite bundles TSX + CSS into static assets; served by a static host (S3, Netlify, CDN) or by an external web server.
- External Integrations: REST API (env vars), CKEditor, Google Maps loader, third-party CSS/JS libs (TomSelect, TinySlider).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Dev & Build Layer
    subgraph "Dev & Build"
        direction TB
        VITE["vite.config.ts"]:::dev
        TAILWIND["tailwind.config.js"]:::dev
        POSTCSS["postcss.config.js"]:::dev
        ENV[".env.prod"]:::dev
        TSCONFIG["tsconfig.json"]:::dev
        TSCONFIGN["tsconfig.node.json"]:::dev
    end

    %% Static Asset Host
    subgraph "Static Asset Host"
        direction TB
        INDEX["index.html"]:::host
        PUBLIC["public/"]:::host
    end

    %% Browser Client
    subgraph "Browser (Client)"
        direction TB

        subgraph "Routing"
            direction TB
            R["Router\nsrc/router/index.tsx"]:::client
        end

        subgraph "UI Layer"
            direction TB
            PAGES["Pages\nsrc/pages/"]:::client
            DOMAIN["Components\nsrc/components/"]:::client
            BASE["Base-Components\nsrc/base-components/"]:::client
            LAYOUTS["Layouts\nsrc/layouts/"]:::client
        end

        subgraph "State Layer"
            direction TB
            STORE["Store\nsrc/stores/store.ts"]:::client
            HOOKS["Hooks\nsrc/stores/hooks.ts"]:::client
            DARK["darkModeSlice\nsrc/stores/darkModeSlice.ts"]:::client
            COLOR["colorSchemeSlice\nsrc/stores/colorSchemeSlice.ts"]:::client
            SIDE["sideMenuSlice\nsrc/stores/sideMenuSlice.ts"]:::client
            SIMPLE["simpleMenuSlice\nsrc/stores/simpleMenuSlice.ts"]:::client
            TOP["topMenuSlice\nsrc/stores/topMenuSlice.ts"]:::client
            MENUCTAS["menuctasctesAutos\nsrc/stores/menuctasctasAutos.ts"]:::client
            CHECKOUT["CheckOutSlice\nsrc/stores/CheckOutSlice.ts"]:::client
            USER["UserProvider\nsrc/context/UserProvider.tsx"]:::client
            TASA["TasaProvider\nsrc/context/TasaProvider.tsx"]:::client
            CED["CedulonesProvider\nsrc/context/CedulonesProviders.tsx"]:::client
        end

        subgraph "Service Layer"
            direction TB
            SECURE["secureStorage\nsrc/modules/secureStorage.ts"]:::client
            UTIL1["GeneralUtils\nsrc/utils/GeneralUtils.ts"]:::client
            UTIL2["Operaciones\nsrc/utils/Operaciones.ts"]:::client
            UTIL3["tasaUtils\nsrc/utils/tasaUtils.ts"]:::client
            UTIL4["cookieParser\nsrc/utils/cookieParser.ts"]:::client
            JSONM["JSON Mocks\nsrc/assets/json/"]:::client
            USRJSON["usuarios.json\nsrc/assets/json/usuarios.json"]:::client
        end
    end

    %% External Services
    subgraph "External Services"
        direction TB
        REST["REST API Server"]:::ext
        GMAP["Google Maps API"]:::ext
        CKEDITOR["CKEditor CDN"]:::ext
        OAUTH["OAuth Endpoints"]:::ext
    end

    %% Connections
    VITE -->|builds| INDEX
    TAILWIND -->|styles| INDEX
    POSTCSS -->|styles| INDEX
    ENV -->|configures| INDEX
    TSCONFIG -->|compiles| INDEX
    TSCONFIGN -->|compiles| INDEX

    INDEX -->|serves| R
    PUBLIC -->|assets| R

    R -->|routes to| PAGES
    PAGES -->|uses| DOMAIN
    DOMAIN -->|renders| BASE
    PAGES -->|wraps with| LAYOUTS

    PAGES -->|"dispatch action"| STORE
    PAGES -->|"use context"| USER
    PAGES -->|"use context"| TASA
    PAGES -->|"use context"| CED

    STORE -->|"via hooks"| HOOKS
    STORE -->|"reads slices"| DARK
    STORE -->|"reads slices"| COLOR
    STORE -->|"reads slices"| SIDE
    STORE -->|"reads slices"| SIMPLE
    STORE -->|"reads slices"| TOP
    STORE -->|"reads slices"| MENUCTAS
    STORE -->|"reads slices"| CHECKOUT

    PAGES -->|"calls API"| UTIL1
    PAGES -->|"calls API"| UTIL2
    PAGES -->|"calls API"| UTIL3
    PAGES -->|"calls API"| UTIL4
    PAGES -->|"load mocks"| JSONM
    PAGES -->|"load mocks"| USRJSON
    PAGES -->|"secure store"| SECURE

    UTIL1 -->|GET /taxes| REST
    UTIL2 -->|POST /auth| REST
    UTIL3 -->|GET /rates| REST
    UTIL4 -->|parse cookies| SECURE

    REST -->|response| UTIL1
    REST -->|response| UTIL2
    REST -->|response| UTIL3

    UTIL1 -->|update| STORE
    UTIL2 -->|update| USER
    UTIL3 -->|update| TASA

    CKEDITOR -->|loaded by| BASE
    GMAP -->|loaded by| BASE
    OAUTH -->|auth via| PAGES

    %% Click Events
    click VITE "https://github.com/sistemasvillaallende/tasa_front/blob/main/vite.config.ts"
    click TAILWIND "https://github.com/sistemasvillaallende/tasa_front/blob/main/tailwind.config.js"
    click POSTCSS "https://github.com/sistemasvillaallende/tasa_front/blob/main/postcss.config.js"
    click ENV "https://github.com/sistemasvillaallende/tasa_front/blob/main/.env.prod"
    click TSCONFIG "https://github.com/sistemasvillaallende/tasa_front/blob/main/tsconfig.json"
    click TSCONFIGN "https://github.com/sistemasvillaallende/tasa_front/blob/main/tsconfig.node.json"
    click INDEX "https://github.com/sistemasvillaallende/tasa_front/blob/main/index.html"
    click PUBLIC "https://github.com/sistemasvillaallende/tasa_front/tree/main/public/"
    click R "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/router/index.tsx"
    click PAGES "https://github.com/sistemasvillaallende/tasa_front/tree/main/src/pages/"
    click DOMAIN "https://github.com/sistemasvillaallende/tasa_front/tree/main/src/components/"
    click BASE "https://github.com/sistemasvillaallende/tasa_front/tree/main/src/base-components/"
    click LAYOUTS "https://github.com/sistemasvillaallende/tasa_front/tree/main/src/layouts/"
    click STORE "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/stores/store.ts"
    click HOOKS "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/stores/hooks.ts"
    click DARK "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/stores/darkModeSlice.ts"
    click COLOR "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/stores/colorSchemeSlice.ts"
    click SIDE "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/stores/sideMenuSlice.ts"
    click SIMPLE "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/stores/simpleMenuSlice.ts"
    click TOP "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/stores/topMenuSlice.ts"
    click MENUCTAS "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/stores/menuctasctasAutos.ts"
    click CHECKOUT "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/stores/CheckOutSlice.ts"
    click USER "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/context/UserProvider.tsx"
    click TASA "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/context/TasaProvider.tsx"
    click CED "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/context/CedulonesProviders.tsx"
    click SECURE "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/modules/secureStorage.ts"
    click UTIL1 "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/utils/GeneralUtils.ts"
    click UTIL2 "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/utils/Operaciones.ts"
    click UTIL3 "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/utils/tasaUtils.ts"
    click UTIL4 "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/utils/cookieParser.ts"
    click JSONM "https://github.com/sistemasvillaallende/tasa_front/tree/main/src/assets/json/"
    click USRJSON "https://github.com/sistemasvillaallende/tasa_front/blob/main/src/assets/json/usuarios.json"

    %% Styles
    classDef dev fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef host fill:#E0E0E0,stroke:#000,stroke-width:1px
    classDef client fill:#98FB98,stroke:#000,stroke-width:1px
    classDef ext fill:#FFFFE0,stroke:#000,stroke-width:1px
```
