# cavargasl/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/cavargasl/portfolio
- Repository: https://github.com/cavargasl/portfolio

## Overview

##### Main Components Identification

The system should be represented in three main layers:
- Domain (Core Business Logic)
- Application (Use Cases)
- Infrastructure (External Interfaces)

##### Component Relationships

- Inward dependencies (Infrastructure → Application → Domain)
- Repository interfaces in the domain layer
- Implementation of repositories in the infrastructure layer
- Service consumption by UI components

##### Specific Implementation Details

Create sections showing:
a) Domain Entities:
**Jobs**
**Projects**
**Skills**
**TechnicalTests**

b) Repository Interfaces:
**JobRepository**
**ProjectRepository**
**TechnicalTestRepository**

c) Infrastructure Implementations:
**LocalJobsRepository**
**LocalProjectsRepository**
**LocalMarkdownTechnicalTestRepository**

##### Additional Elements

Include:
- Language handling (es/en)
- Data flow directions
- External dependencies
- Testing boundaries

##### Architectural Patterns

Highlight:
- Dependency Injection patterns
- Repository pattern implementation
- Service layer pattern
- Clean Architecture boundaries

##### Technical Stack Integration

Integration points for:
- Next.js/Astro frameworks
- React components
- Markdown processing
- Infrastructure utilities

##### Testing Boundaries

Indicate:
- Unit test coverage
- Integration test boundaries
- Mock implementations
- Test utilities

- Clear separation of concerns
- Dependency flow (always inward)
- Interface abstractions
- Clean Architecture principles
- Domain-driven design concepts

Remember to maintain a balance between detail and clarity, focusing on the hexagonal architecture while showing how the portfolio's specific features fit into this pattern.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Domain Layer]:::domain
        L2[Application Layer]:::application
        L3[Infrastructure Layer]:::infrastructure
        L4[Repository]:::repository
        L5[View Component]:::view
    end

    subgraph "Domain Layer"
        Jobs["Jobs Domain"]:::domain
        Projects["Projects Domain"]:::domain
        Skills["Skills Domain"]:::domain
        TechnicalTests["Technical Tests Domain"]:::domain
        Locale["Locale Domain"]:::domain
        Shared["Shared Domain"]:::domain

        JobRepoInterface["Job Repository Interface"]:::domain
        ProjectRepoInterface["Project Repository Interface"]:::domain
        TechnicalTestRepoInterface["Technical Test Repository Interface"]:::domain
    end

    subgraph "Application Layer"
        JobService["Job Service"]:::application
        ProjectService["Project Service"]:::application
        TechnicalTestService["Technical Test Service"]:::application
    end

    subgraph "Infrastructure Layer"
        LocalJobsRepo["Local Jobs Repository"]:::repository
        LocalProjectsRepo["Local Projects Repository"]:::repository
        LocalTechnicalTestRepo["Local Technical Test Repository"]:::repository
        LocalMarkdownTechnicalTestRepo["Local Markdown Technical Test Repository"]:::repository

        NextView["Next.js View"]:::view
        AstroView["Astro View"]:::view

        EnLocale["English Locale"]:::infrastructure
        EsLocale["Spanish Locale"]:::infrastructure

        SharedUtils["Shared Utils"]:::infrastructure
        TechnicalTestUtils["Technical Test Utils"]:::infrastructure
    end

    %% Relationships
    Jobs --> JobRepoInterface
    Projects --> ProjectRepoInterface
    TechnicalTests --> TechnicalTestRepoInterface

    JobService --> Jobs
    ProjectService --> Projects
    TechnicalTestService --> TechnicalTests

    LocalJobsRepo --> JobRepoInterface
    LocalProjectsRepo --> ProjectRepoInterface
    LocalTechnicalTestRepo --> TechnicalTestRepoInterface
    LocalMarkdownTechnicalTestRepo --> TechnicalTestRepoInterface

    NextView --> JobService
    NextView --> ProjectService
    NextView --> TechnicalTestService
    AstroView --> JobService
    AstroView --> ProjectService
    AstroView --> TechnicalTestService

    %% Click Events
    click Jobs "https://github.com/cavargasl/portfolio/tree/main/core/jobs/domain/"
    click Projects "https://github.com/cavargasl/portfolio/tree/main/core/projects/domain/"
    click Skills "https://github.com/cavargasl/portfolio/tree/main/core/skills/domain/"
    click TechnicalTests "https://github.com/cavargasl/portfolio/tree/main/core/technicalTests/domain/"
    click Locale "https://github.com/cavargasl/portfolio/tree/main/core/locale/domain/"
    click Shared "https://github.com/cavargasl/portfolio/tree/main/core/shared/domain/"

    click JobService "https://github.com/cavargasl/portfolio/blob/main/core/jobs/application/jobService.ts"
    click ProjectService "https://github.com/cavargasl/portfolio/blob/main/core/projects/application/projectService.ts"
    click TechnicalTestService "https://github.com/cavargasl/portfolio/blob/main/core/technicalTests/application/technicalTestService.ts"

    click LocalJobsRepo "https://github.com/cavargasl/portfolio/blob/main/core/jobs/infrastructure/localJobs.repository.ts"
    click LocalProjectsRepo "https://github.com/cavargasl/portfolio/blob/main/core/projects/infrastructure/localProjects.repository.ts"
    click LocalTechnicalTestRepo "https://github.com/cavargasl/portfolio/blob/main/core/technicalTests/infrastructure/localTechnicalTest.repository.ts"
    click LocalMarkdownTechnicalTestRepo "https://github.com/cavargasl/portfolio/blob/main/core/technicalTests/infrastructure/localMarkdownTechnicalTest.repository.ts"

    click NextView "https://github.com/cavargasl/portfolio/tree/main/infrastructure/views/next/"
    click AstroView "https://github.com/cavargasl/portfolio/tree/main/infrastructure/views/astro/"

    click EnLocale "https://github.com/cavargasl/portfolio/blob/main/core/locale/messages/en.ts"
    click EsLocale "https://github.com/cavargasl/portfolio/blob/main/core/locale/messages/es.ts"

    click JobRepoInterface "https://github.com/cavargasl/portfolio/blob/main/core/jobs/domain/jobRepository.ts"
    click ProjectRepoInterface "https://github.com/cavargasl/portfolio/blob/main/core/projects/domain/projectRepository.ts"
    click TechnicalTestRepoInterface "https://github.com/cavargasl/portfolio/blob/main/core/technicalTests/domain/technicalTestRepository.ts"

    click SharedUtils "https://github.com/cavargasl/portfolio/tree/main/core/shared/utils/"
    click TechnicalTestUtils "https://github.com/cavargasl/portfolio/tree/main/core/technicalTests/infrastructure/utils/"

    %% Styles
    classDef domain fill:#a8dadc,stroke:#457b9d
    classDef application fill:#90be6d,stroke:#457b9d
    classDef infrastructure fill:#f4a261,stroke:#457b9d
    classDef repository fill:#e9c46a,stroke:#457b9d
    classDef view fill:#e76f51,stroke:#457b9d
```
