# kaustuv-karki/artist-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/kaustuv-karki/artist-management-system
- Repository: https://github.com/kaustuv-karki/artist-management-system

## Overview

##### Main Components Identification

The system consists of these primary components:
- Frontend (React/TypeScript application)
- Backend (Node.js/Express application)
- Database (indicated by the db directory in backend)
- File Storage System (for uploads)
- Authentication System

##### Component Relationships

- Frontend → Backend: RESTful API calls
- Backend → Database: Data operations
- Backend → File Storage: Upload/Download operations
- Authentication Flow: User → Frontend → Backend → JWT Generation

##### Specific Implementation Details

- Frontend:
- Redux state management
- Protected routes
- Form components
- Table components
- API interceptors

- Backend:
- JWT verification
- Artist management
- Music management
- User management
- File upload handling

##### Technical Stack Callouts

- Frontend: React, TypeScript, Redux, Tailwind CSS
- Backend: Node.js, Express
- Authentication: JWT
- File Storage: Local file system
- Database: (Specify based on implementation)

##### Security Layer

Security implementations:
- JWT verification middleware
- Protected routes
- API validation
- Access token generation

For this specific project, emphasize:
##### Component hierarchy in the frontend

This will give other developers a clear understanding of both the high-level architecture and the specific implementation details of the Artist Management System.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        UI[UI Components]:::frontend
        Pages[Pages]:::frontend
        Redux[Redux Store]:::frontend
        APIServices[API Services]:::frontend
        AuthGuard[Authentication Guard]:::frontend
        AuthComponents[Authentication Components]:::frontend
        ArtistComponents[Artist Management]:::frontend
        MusicComponents[Music Management]:::frontend
        Interceptors[API Interceptors]:::frontend

        Redux --> UI
        Redux --> Pages
        APIServices --> Redux
        AuthGuard --> Pages
        UI --> Pages
        AuthComponents --> Pages
        ArtistComponents --> Pages
        MusicComponents --> Pages
        Interceptors --> APIServices
    end

    subgraph Backend
        Routes[Routes]:::backend
        Controllers[Controllers]:::backend
        Models[Data Models]:::backend
        MW[Middleware]:::backend
        Validation[Input Validation]:::backend
        Utils[Backend Utilities]:::backend
        JWTAuth[JWT Authentication]:::backend
        TokenGen[Token Generation]:::backend
        APIResponse[API Response Handler]:::backend

        Routes --> Controllers
        Controllers --> Models
        MW --> Routes
        JWTAuth --> Routes
        Validation --> Controllers
        Utils --> Controllers
        TokenGen --> Controllers
        APIResponse --> Controllers
    end

    subgraph DataLayer
        DB[(Database)]:::data
        FileStorage[File Storage System]:::data
        DBConn[Database Connection]:::data

        DBConn --> DB
        Models --> DBConn
        Controllers --> FileStorage
    end

    APIServices --> Routes
    
    %% Click Events
    click UI "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/frontend/src/components"
    click Pages "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/frontend/src/pages"
    click Redux "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/frontend/src/redux"
    click APIServices "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/frontend/src/api"
    click AuthGuard "https://github.com/Kaustuv-Karki/Artist-management-system/blob/main/frontend/src/utils/protectedRoute.tsx"
    click Routes "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/backend/routes"
    click Controllers "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/backend/controllers"
    click Models "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/backend/models"
    click MW "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/backend/middleware"
    click Validation "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/backend/validation"
    click Utils "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/backend/utils"
    click FileStorage "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/backend/uploads"
    click DBConn "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/backend/db"
    click JWTAuth "https://github.com/Kaustuv-Karki/Artist-management-system/blob/main/backend/middleware/verifyJwt.js"
    click TokenGen "https://github.com/Kaustuv-Karki/Artist-management-system/blob/main/backend/utils/generateAccessAndRefreshToken.js"
    click APIResponse "https://github.com/Kaustuv-Karki/Artist-management-system/blob/main/backend/utils/ApiResponse.js"
    click Interceptors "https://github.com/Kaustuv-Karki/Artist-management-system/blob/main/frontend/src/utils/axiosInterceptors.ts"
    click AuthComponents "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/frontend/src/components/LoginComponent"
    click ArtistComponents "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/frontend/src/components/AddArtist"
    click MusicComponents "https://github.com/Kaustuv-Karki/Artist-management-system/tree/main/frontend/src/components/AddSongForm"

    classDef frontend fill:#2196F3,stroke:#1565C0,color:white
    classDef backend fill:#4CAF50,stroke:#2E7D32,color:white
    classDef data fill:#FFC107,stroke:#FFA000,color:black
    
    %% Legend
    subgraph Legend
        Frontend_L[Frontend Component]:::frontend
        Backend_L[Backend Component]:::backend
        Data_L[Data Layer]:::data
    end
```
