# daniserrano7/jira-clone architecture

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

- Interactive diagram: https://gitdiagram.com/daniserrano7/jira-clone
- Repository: https://github.com/daniserrano7/jira-clone

## Overview

##### Main Layers and Components
- Domain Layer: Represented by the “src/domain” folder. This layer contains the core business logic including entities such as users, projects, categories, issues, comments, and priorities. Model the relationships (e.g., a project can have multiple categories, each category contains issues that have comments and associated users).
- Infrastructure Layer: Found in “src/infrastructure”, this includes the database integration via Prisma (with the SQLite database) along with related database schemas, seeding logic, and query functions.
- Application/UI Layer: Under “src/app” and “src/app/ui”, this layer contains the presentation, routing, components, session handling, and state management for the web interface. Note the Remix routes (server-side rendering), shared UI components (located in “src/app/components”), and routing logic supporting things like login, projects list, and project space.
- External Services and Tools: Include the SQLite database (with Prisma managing migrations and seeds), Tailwind CSS for styling, and third-party libraries such as Radix UI for accessible components. Also, indicate how server-side rendering (SSR) and cookie-based session storage are integrated by Remix.

##### Relationships and Data Flow
- In the Domain layer, list key entities (User, Project, Category, Issue, Comment, Priority) and briefly annotate their relationships (e.g., Projects contain Categories → Categories hold Issues → Issues include Comments, with Users associated at various levels).
- In the Application/UI layer, break it into:
- UI Components (React components found in “src/app/components” and “src/app/ui”) that render interfaces for login, project listing, and project board.
- Routing (Remix routes under “src/app/routes”) that link the UI to server-side logic.
- Session and State Management (session-storage and stores) managing cookie-based user authentication and theme information.

##### Architectural Patterns and Design Principles
- Separation of SSR and Client State: The design leverages Remix Run for SSR, reducing client-side state and using cookies/session stores.
- Component-Based UI: Note the organization of UI components into a modular, reusable structure with clearly defined responsibilities (note usage of Radix and Storybook for component development).

##### Relevant Technologies, Frameworks, and Libraries
- Remix Run for server-side rendering and routing.
- React with Typescript for building the UI.
- Tailwind CSS for styling.
- Prisma to integrate and manage the SQLite database.
- Radix UI components to support accessibility.
- Vitest for testing, ESLint and Prettier for code quality.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Domain Layer
    subgraph "Domain Layer"
        D1["Business Models: Users, Projects, Categories, Issues, Comments, Priorities"]:::domainLayer
    end

    %% Infrastructure Layer
    subgraph "Infrastructure Layer"
        I1["Prisma ORM"]:::infraLayer
        I2["SQLite Database"]:::infraLayer
        I1 -->|"Read/Write/Seed"| I2
    end

    %% Application/UI Layer
    subgraph "Application/UI Layer"
        subgraph "UI & Presentation"
            A1["UI Components (React, Tailwind, Radix)"]:::appLayer
            A2["Login UI"]:::appLayer
            A3["Main UI Layout"]:::appLayer
        end
        subgraph "Routing & Server Logic"
            A4["Remix Routes"]:::appLayer
        end
        subgraph "Session & State Management"
            A5["Session Storage (Cookie-based)"]:::appLayer
        end
    end

    %% Data Flow and Interactions
    A1 -->|"userInteraction"| A4
    A4 -->|"authenticate"| A5
    A4 -->|"triggerDBUpdate"| I1
    A4 -->|"accessBusinessLogic"| D1
    A2 -->|"loginAction"| A5
    I1 -->|"updateData"| D1
    A5 -->|"manageSessions"| A4
    A4 -->|"serveViews"| A1

    %% Architectural Boundaries
    D1 ---|"CleanArchitecture"| I1
    I1 ---|"SeparationOfConcerns"| A1

    %% Click Events
    click D1 "https://github.com/daniserrano7/jira-clone/tree/master/src/domain"
    click I1 "https://github.com/daniserrano7/jira-clone/tree/master/src/infrastructure/db"
    click A1 "https://github.com/daniserrano7/jira-clone/tree/master/src/app/components"
    click A2 "https://github.com/daniserrano7/jira-clone/tree/master/src/app/ui/login"
    click A3 "https://github.com/daniserrano7/jira-clone/tree/master/src/app/ui/main"
    click A4 "https://github.com/daniserrano7/jira-clone/tree/master/src/app/routes"
    click A5 "https://github.com/daniserrano7/jira-clone/tree/master/src/app/session-storage"

    %% Styles
    classDef domainLayer fill:#ffcccb,stroke:#ff0000,stroke-width:2px;
    classDef infraLayer fill:#add8e6,stroke:#00008b,stroke-width:2px;
    classDef appLayer fill:#90ee90,stroke:#006400,stroke-width:2px;
```
