# itsmarcsk/kenpoapp architecture

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

- Interactive diagram: https://gitdiagram.com/itsmarcsk/kenpoapp
- Repository: https://github.com/itsmarcsk/kenpoapp

## Overview

##### Project type and purpose
- This is a single-page front-end application built with Angular (v18) named “KenpoApp.”
- It serves as the UI for a martial-arts ecommerce/community platform (shopping cart, events, profile, login/register, etc.).
- There is no in-repo backend; it relies on external REST APIs.

##### File structure
- Top-level files: Dockerfile, angular.json, package.json, README.md
- “public/” holds static assets (videos, images).
- “src/” contains the Angular application:
- app/ – the root module and sub-folders for each feature component (home, login, register, tienda, cesta, eventos, perfil, etc.)
- app/models – TypeScript interfaces/models for domain objects
- app/services – Angular services that wrap HTTP calls to back-end endpoints
- app/app.routes.ts – sets up the router configuration
- app/app.config.ts – central place for environment or API base-URL constants
- main.ts, index.html, styles.css – standard Angular bootstrap files
- Test specs (“*.spec.ts”), TypeScript configs, and editor configs are present.
- Dockerfile builds a production image of the compiled Angular app and serves it on port 4200 (mapped to 4201 locally).

##### README for additional insights
- Confirms CLI commands (ng serve, build, test).
- Provides Docker build/run steps, indicating a containerized static front-end.
- No mention of back-end in this repo; back-end is a separate service.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Users and browser
    User["User"]:::external
    Browser["Browser"]:::external

    User -->|interacts via| Browser

    %% Docker container / Hosting
    subgraph "Docker Container (port 4200)" 
        direction TB
        ContainerWeb["Nginx/HTTP Server"]:::infra

        %% Angular App Structure
        subgraph "KenpoApp (Angular SPA)"
            direction TB
            AppComponent["AppComponent"]:::component
            click AppComponent "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/app.component.ts"

            RoutingModule["Routing Module"]:::component
            click RoutingModule "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/app.routes.ts"

            Config["App Config (API Base URLs)"]:::component
            click Config "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/app.config.ts"

            subgraph "Feature Components"
                direction TB
                HomeComponent["HomeComponent"]:::component
                click HomeComponent "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/home/home.component.ts"

                EventosComponent["EventosComponent"]:::component
                click EventosComponent "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/eventos/eventos.component.ts"

                TiendaComponent["TiendaComponent"]:::component
                click TiendaComponent "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/tienda/tienda.component.ts"

                CestaComponent["CestaComponent"]:::component
                click CestaComponent "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/cesta/cesta.component.ts"

                PerfilComponent["PerfilComponent"]:::component
                click PerfilComponent "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/perfil/perfil.component.ts"

                LoginComponent["LoginComponent"]:::component
                click LoginComponent "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/login/login.component.ts"

                RegisterComponent["RegisterComponent"]:::component
                click RegisterComponent "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/register/register.component.ts"

                P404Component["PáginaNoEncontradaComponent"]:::component
                click P404Component "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/paginanoencontrada/paginanoencontrada.component.ts"

                IndexComponent["IndexComponent"]:::component
                click IndexComponent "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/index/index.component.ts"

                InicioComponent["InicioComponent"]:::component
                click InicioComponent "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/inicio/inicio.component.ts"

                UpdatePassComponent["UpdatePasswordComponent"]:::component
                click UpdatePassComponent "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/updatepassword/updatepassword.component.ts"
            end

            subgraph "Services Layer"
                direction TB
                EventosService["EventosService"]:::service
                click EventosService "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/services/eventos.service.ts"

                TiendaService["TiendaService"]:::service
                click TiendaService "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/services/tienda.service.ts"

                CestaService["CestaService"]:::service
                click CestaService "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/services/cesta.service.ts"

                ArtistaService["ArtistaMarcialService"]:::service
                click ArtistaService "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/services/artista-marcial.service.ts"

                EscuelaService["EscuelaService"]:::service
                click EscuelaService "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/services/escuela.service.ts"

                KatasService["KatasTecnicasService"]:::service
                click KatasService "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/services/katas-tecnicas.service.ts"

                MultimediaService["MultimediaService"]:::service
                click MultimediaService "https://github.com/itsmarcsk/kenpoapp/blob/master/src/app/services/multimedia.service.ts"
            end

            subgraph "Models Layer"
                Models["Domain Interfaces (Models)"]:::model
                click Models "https://github.com/itsmarcsk/kenpoapp/tree/master/src/app/models/"
            end

            StaticAssets["Static Assets"]:::infra
            click StaticAssets "https://github.com/itsmarcsk/kenpoapp/tree/master/public/assets/"

            MainEntry["Main Entry (main.ts)"]:::component
            click MainEntry "https://github.com/itsmarcsk/kenpoapp/blob/master/src/main.ts"
            IndexHTML["Root HTML (index.html)"]:::component
            click IndexHTML "https://github.com/itsmarcsk/kenpoapp/blob/master/src/index.html"
            Styles["Global Styles (styles.css)"]:::component
            click Styles "https://github.com/itsmarcsk/kenpoapp/blob/master/src/styles.css"
        end

        Browser -->|loads| ContainerWeb
        ContainerWeb -->|serves| AppComponent

        %% Component-Service-API interactions
        AppComponent -->|uses| RoutingModule
        RoutingModule -->|routes to| HomeComponent
        HomeComponent -->|calls| EventosService
        EventosService -->|HTTP→| API["External REST API"]:::external
        TiendaComponent -->|calls| TiendaService
        TiendaService -->|HTTP→| API
        CestaComponent -->|calls| CestaService
        CestaService -->|HTTP→| API
        PerfilComponent -->|calls| ArtistaService
        ArtistaService -->|HTTP→| API
        EscuelaService -->|HTTP→| API
        KatasService -->|HTTP→| API
        MultimediaService -->|HTTP→| API

        EventosService -->|maps JSON→| Models
        TiendaService -->|maps JSON→| Models
        CestaService -->|maps JSON→| Models

        %% Build and Deployment Pipeline
        subgraph "Build & Deploy Pipeline"
            direction TB
            Source["Source Code (src/, angular.json, Dockerfile)"]:::pipeline
            AngularCLI["Angular CLI (ng build)"]:::pipeline
            Artifacts["Build Artifacts"]:::pipeline
            DockerfileNode["Dockerfile"]:::pipeline
            DockerImage["Docker Image"]:::infra
            DockerImage --> ContainerWeb
        end

        Source --> AngularCLI --> Artifacts --> DockerfileNode --> DockerImage
    end

    Browser -->|interacts with| AppComponent

    API -->|responds| Services

    %% Styles
    classDef component fill:#cce5ff,stroke:#007bff;
    classDef service fill:#d4edda,stroke:#28a745;
    classDef model fill:#e2e3e5,stroke:#6c757d;
    classDef external fill:#fff3cd,stroke:#fd7e14;
    classDef infra fill:#f5e6ff,stroke:#6f42c1;
    classDef pipeline fill:#ffe8e8,stroke:#dc3545;
```
