# kayomichael/violettrack architecture

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

- Interactive diagram: https://gitdiagram.com/kayomichael/violettrack
- Repository: https://github.com/kayomichael/violettrack

## Overview

##### Main System Components

A. Frontend Layer
- Landing Pages (Public)
- Protected Project Pages
- Authentication Pages
- UI Components

B. Backend Layer
- API Routes
- Authentication Service
- Server Actions
- Database Layer

##### Detailed Component Breakdown

Frontend Architecture:
**Client Layer**
- Public Zone ((landing) route)
- Protected Zone ((project) route)
- Dashboard
- Tickets Management
- Auth Zone
- Sign In
- Sign Up
- Sign Out

Backend Architecture:
**Server Layer**
- API Routes
- Auth API
- Tickets API
- Users API
- NextAuth Integration
- Database (Supabase/PostgreSQL)

##### Technical Details

- JWT token flow
- API endpoint routing
- Database schema relationships
- Server-side rendering paths
- Client-side navigation

##### Implementation Notes

- Use standardized symbols for different components
- Annotations for important technical details
- Version numbers for major dependencies

##### Additional Elements

- Error handling flow
- Loading states
- Data caching strategy
- Authentication state management
- Form validation flow

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Landing["Landing Pages"]
        Project["Protected Project Pages"]
        Auth["Authentication Pages"]
        UI["UI Components"]
        
        subgraph ProjectPages
            Dashboard["Dashboard"]
            Tickets["Tickets Management"]
        end
        
        subgraph UIComponents
            CoreUI["Core UI"]
            Forms["Form Components"]
            Tables["Table Components"]
            LandingUI["Landing Components"]
            NavComponents["Navigation Components"]
        end
        
        Project --> ProjectPages
        UI --> UIComponents
    end
    
    subgraph Server
        API["API Layer"]
        AuthService["Authentication Service"]
        ServerActions["Server Actions"]
        
        subgraph APIRoutes
            TicketsAPI["Tickets API"]
            UsersAPI["Users API"]
            AuthAPI["Auth API"]
        end
        
        API --> APIRoutes
    end
    
    subgraph Database
        Supabase["Supabase/PostgreSQL"]
        PrismaORM["Prisma ORM"]
        Migrations["Database Migrations"]
    end
    
    %% Relationships
    Landing --> API
    Project --> API
    Auth --> AuthService
    AuthService --> APIRoutes
    APIRoutes --> PrismaORM
    PrismaORM --> Supabase
    
    %% Click Events
    click Landing "https://github.com/kayoMichael/VioletTrack/tree/main/app/(landing)/"
    click Project "https://github.com/kayoMichael/VioletTrack/tree/main/app/(project)/"
    click Dashboard "https://github.com/kayoMichael/VioletTrack/tree/main/app/(project)/dashboard/"
    click Tickets "https://github.com/kayoMichael/VioletTrack/tree/main/app/(project)/tickets/"
    click Auth "https://github.com/kayoMichael/VioletTrack/tree/main/app/auth/"
    click AuthService "https://github.com/kayoMichael/VioletTrack/blob/main/app/auth/Provider.tsx"
    click AuthAPI "https://github.com/kayoMichael/VioletTrack/tree/main/app/api/auth/[...nextauth]/"
    click TicketsAPI "https://github.com/kayoMichael/VioletTrack/tree/main/app/api/tickets/"
    click UsersAPI "https://github.com/kayoMichael/VioletTrack/tree/main/app/api/users/"
    click PrismaORM "https://github.com/kayoMichael/VioletTrack/blob/main/prisma/schema.prisma"
    click Migrations "https://github.com/kayoMichael/VioletTrack/tree/main/prisma/migrations/"
    click CoreUI "https://github.com/kayoMichael/VioletTrack/tree/main/components/ui/"
    click Forms "https://github.com/kayoMichael/VioletTrack/tree/main/components/form/"
    click Tables "https://github.com/kayoMichael/VioletTrack/tree/main/components/table/"
    click LandingUI "https://github.com/kayoMichael/VioletTrack/tree/main/components/landing-sections/"
    click NavComponents "https://github.com/kayoMichael/VioletTrack/blob/main/components/general/Navbar.tsx"
    
    %% Styling
    classDef frontend fill:#a8d1ff,stroke:#333
    classDef backend fill:#90EE90,stroke:#333
    classDef database fill:#DDA0DD,stroke:#333
    classDef auth fill:#FFB347,stroke:#333
    
    class Landing,Project,Auth,UI,ProjectPages,UIComponents frontend
    class API,AuthService,ServerActions,APIRoutes backend
    class Supabase,PrismaORM,Migrations database
    class AuthService,Auth auth
```
