# paulluqueccosi/borrar_2 architecture

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

- Interactive diagram: https://gitdiagram.com/paulluqueccosi/borrar_2
- Repository: https://github.com/paulluqueccosi/borrar_2

## Overview

##### Project Type & Purpose
- Full-stack (front-end heavy) Single-Page Application built with Angular 18
- Purpose: A subscription-based filter tool (“SwiftSelect”) with user authentication, plan management (Stripe), Google Drive integration, and a marketing landing section
- Generated via Angular CLI; deployed as static assets served by Nginx (see `deploy/swiftselect.io.conf`)

##### File Structure
- src/app
– features/…: feature modules (auth, configuration, filter, landing, profile) each with their own routes, components, pages, guards, services
– core/: global services, interceptors, constants, directives, validators and shared utilities used by all features
– shared/: reusable UI components, directives, pipes, layouts
– app.component, app.routes, app.config, bootstrapping (main.ts)
- src/environments: per-environment API URLs, feature flags
- deploy/: static files including service worker and robots/sitemap
- build config: angular.json, tsconfig.json, Tailwind via postcss.config.js

##### README Insights
- Angular CLI workflow: ng serve, ng build → dist/
- Unit tests (Karma), e2e tests
- Deployment scripts reference QA/PM2/LLM-worker (backend LLM microservice)

##### Main Components & Interactions
a. Browser (Client)
– Loads index.html → main.ts → AppModule
– Renders feature modules via Angular Router
– UI components consume core/shared services
b. Angular Application
– Feature Modules (auth, filter, configuration, landing, profile)
– Core Module
- HTTP Interceptors (auth-token, loader, error handling, backend URL override)
- Services (AuthService, StripeService, GDriveService, FilterService, etc.)
- Constants (API endpoints, app constants)
– Shared Module (UI library: reusable components, directives, pipes, layouts)
c. HTTP/API Layer
– Outbound API calls via Angular HttpClient
– Base URL from environment config
– Interceptors append JWT, handle errors, show loader
d. Backend Services (external to this repo)
– Authentication & User Management API
– Filter Engine API (calls LLM Worker via PM2)
– Subscription & Payments API (Stripe Platform)
– Google Drive API
e. External Systems
– Stripe (checkout, sessions)
– Google Drive
– LLM Worker (swiftselectllm-worker.service)
f. Deployment
– Angular CLI build → `dist/` → served by Nginx
– Static assets + service worker (PWA) via `deploy/static` config file

##### Architectural Patterns & Principles
- Modular Angular architecture (feature modules + Core/Shared)
- Dependency injection for services
- Router + lazy loading for feature modules
- HTTP interceptor pipeline
- Environment-based configuration
- PWA service worker integration

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client Browser/UI"
        Browser["Browser"]:::blue
    end
    click Browser "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/index.html"
    click Browser "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/main.ts"

    %% Angular Application Layer
    subgraph "Angular Application"
        AppModule["App Module & Routing"]:::blue
        subgraph "Feature Modules"
            AuthModule["Auth Module"]:::blue
            FilterModule["Filter Module"]:::blue
            ConfigModule["Configuration Module"]:::blue
            LandingModule["Landing Module"]:::blue
            ProfileModule["Profile Module"]:::blue
        end
        subgraph "Core Module"
            InterceptorChain["Interceptor Chain"]:::blue
            AuthTokenInterceptor["AuthToken Interceptor"]:::blue
            LoaderInterceptor["Loader Interceptor"]:::blue
            HttpErrorInterceptor["Error Handler Interceptor"]:::blue
            BackendInterceptor["Backend URL Override Interceptor"]:::blue
            AuthService["AuthService"]:::blue
            StripeService["StripeService"]:::blue
            GDriveService["GDriveService"]:::blue
            CoreFilterService["FilterService"]:::blue
            Constants["Constants & Interfaces"]:::blue
        end
        SharedModule["Shared Module"]:::blue
    end
    click AppModule "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/app.component.ts"
    click AppModule "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/app.routes.ts"
    click AppModule "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/app.config.ts"
    click AppModule "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/app.config.server.ts"
    click AuthModule "https://github.com/paulluqueccosi/borrar_2/tree/develop/src/app/features/auth/"
    click FilterModule "https://github.com/paulluqueccosi/borrar_2/tree/develop/src/app/features/filter/"
    click ConfigModule "https://github.com/paulluqueccosi/borrar_2/tree/develop/src/app/features/configuration/"
    click LandingModule "https://github.com/paulluqueccosi/borrar_2/tree/develop/src/app/features/landing/"
    click ProfileModule "https://github.com/paulluqueccosi/borrar_2/tree/develop/src/app/features/profile/"
    click SharedModule "https://github.com/paulluqueccosi/borrar_2/tree/develop/src/app/shared/"
    click CoreModule "https://github.com/paulluqueccosi/borrar_2/tree/develop/src/app/core/"
    click AuthTokenInterceptor "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/core/interceptors/auth-token.interceptor.ts"
    click LoaderInterceptor "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/core/interceptors/loader.interceptor.ts"
    click HttpErrorInterceptor "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/core/interceptors/http-error.interceptor.ts"
    click BackendInterceptor "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/core/interceptors/backend.interceptor.ts"
    click AuthService "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/core/services/auth.service.ts"
    click StripeService "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/core/services/stripe.service.ts"
    click GDriveService "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/core/services/g-drive.service.ts"
    click CoreFilterService "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/app/features/filter/services/filter.service.ts"
    click Constants "https://github.com/paulluqueccosi/borrar_2/tree/develop/src/app/core/constants/"

    %% API Layer
    subgraph "HTTP / API Layer"
        HttpClient["Angular HttpClient"]:::green
        EnvConfig["Environment Config"]:::green
    end
    click EnvConfig "https://github.com/paulluqueccosi/borrar_2/blob/develop/src/environments/environment.ts"

    %% Backend Services Layer
    subgraph "Backend Microservices"
        AuthAPI["Authentication & User Management API"]:::yellow
        FilterAPI["Filter Engine API"]:::yellow
        SubscriptionAPI["Subscription & Payments API"]:::yellow
        GDriveAPI["Google Drive API"]:::yellow
    end

    %% External Third-Party Services
    subgraph "External Systems"
        StripeCloud["Stripe"]:::gray
        GoogleDriveCloud["Google Drive"]:::gray
        LLMWorkerCloud["LLM Worker"]:::gray
    end

    %% Deployment Layer
    subgraph "Build & Deployment"
        BuildTools["Build & Tooling Config"]:::gray
        NginxServe["Nginx Serve (dist/)"]:::gray
        ServiceWorker["Service Worker & Static"]:::gray
    end
    click BuildTools "https://github.com/paulluqueccosi/borrar_2/blob/develop/angular.json"
    click NginxServe "https://github.com/paulluqueccosi/borrar_2/blob/develop/deploy/swiftselect.io.conf"
    click ServiceWorker "https://github.com/paulluqueccosi/borrar_2/tree/develop/deploy/static/"

    %% Connections
    Browser -->|"loads AppModule"| AppModule
    AppModule -->|"lazyLoads"| AuthModule
    AppModule -->|"lazyLoads"| FilterModule
    AppModule -->|"lazyLoads"| ConfigModule
    AppModule -->|"lazyLoads"| LandingModule
    AppModule -->|"lazyLoads"| ProfileModule
    AuthModule -->|"uses"| AuthService
    FilterModule -->|"uses"| CoreFilterService
    ConfigModule -->|"uses"| StripeService
    LandingModule -->|"uses"| GDriveService
    ProfileModule -->|"uses"| AuthService

    %% Interceptor chain
    HttpClient --> AuthTokenInterceptor --> LoaderInterceptor --> HttpErrorInterceptor --> BackendInterceptor --> HttpClient

    %% Services to API
    AuthService -->|"HTTP"| HttpClient
    CoreFilterService -->|"GET /filters"| HttpClient
    StripeService -->|"POST /stripe"| HttpClient
    GDriveService -->|"GET /gdrive"| HttpClient

    %% Env config
    HttpClient -->|"baseURL from"| EnvConfig

    %% HTTP to Backend
    HttpClient --> AuthAPI
    HttpClient --> FilterAPI
    HttpClient --> SubscriptionAPI
    HttpClient --> GDriveAPI

    %% Backend to External
    SubscriptionAPI -->|"Stripe SDK"| StripeCloud
    GDriveAPI -->|"Google Drive API"| GoogleDriveCloud
    FilterAPI -->|"calls"| LLMWorkerCloud

    %% Deployment flow
    BuildTools -->|"ng build → dist"| NginxServe
    NginxServe -->|"serves"| Browser
    ServiceWorker ---|"PWA"| Browser

    %% Styles
    classDef blue fill:#D0E8FF,stroke:#0366d6,color:#0366d6;
    classDef green fill:#DFF5E1,stroke:#28a745,color:#28a745;
    classDef yellow fill:#FFF4CC,stroke:#FFAB00,color:#806000;
    classDef gray fill:#E2E2E2,stroke:#6a737d,color:#6a737d;
```
