# eric-jy-park/skyst-hackathon architecture

> Architecture diagram of the GitHub repository eric-jy-park/skyst-hackathon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eric-jy-park/skyst-hackathon
- Repository: https://github.com/eric-jy-park/skyst-hackathon

## Overview

##### Project type and purpose
- This is a backend RESTful API built with NestJS (a progressive Node.js framework) in TypeScript.
- Purpose: manage bands, comments, seasons, users, videos, and votes—exposing HTTP endpoints via controllers, coordinating business logic in services, and persisting data with TypeORM entities.

##### File structure
- Top-level config: Dockerfile, docker-compose.yml, GitHub workflows, ESLint, tsconfig, Nest CLI.
- src/app.module.ts + src/main.ts: application root and HTTP server bootstrap.
- src/{bands, comments, seasons, users, videos, votes}: self-contained Nest modules, each with controller, service, DTOs, and entities.
- test/: end-to-end tests.

##### README for additional insights
- Confirms a starter NestJS project, with instructions for running, testing, and deploying.

##### Elements
- Clear labels: “Client (HTTP Request)”, “NestJS HTTP Server”, “BandsController”, “BandsService”, “BandRepository”, “PostgreSQL”
- Client → Controller (HTTP)
- Controller → Service (method calls)
- Service → Repository/EntityManager → Database
- Rectangles for modules
- Rounded rectangles for controllers / services

##### Detailed breakdown for each module
- AppModule
- Imports all feature modules
- Feature Module (e.g., BandsModule)
- Controller: handles routing & validation via DTOs
- Service: business logic, orchestrates calls to repository
- Entity: defines DB schema
- Common Layer
- BaseEntity: shared fields (show as a note, not a direct mapping to every entity)

Summary
- Inside, group by module: Controllers (edge), Services (core), Repositories (near DB).
- Database at the bottom.
- This will give a clear, detailed view of the architecture without over-mapping shared inheritance.

## Diagram (Mermaid)

```mermaid
flowchart TB
    Client["Client (HTTP Requests)"]:::external
    HTTP["NestJS HTTP Server"]:::server
    AppModule["AppModule"]:::module

    Client -->|"HTTP Request"| HTTP
    HTTP --> AppModule

    subgraph Controllers
        direction TB
        BandsController["BandsController"]:::controller
        CommentsController["CommentsController"]:::controller
        SeasonsController["SeasonsController"]:::controller
        UsersController["UsersController"]:::controller
        VideosController["VideosController"]:::controller
        VotesController["VotesController"]:::controller
    end

    subgraph Services
        direction TB
        BandsService["BandsService"]:::service
        CommentsService["CommentsService"]:::service
        SeasonsService["SeasonsService"]:::service
        UsersService["UsersService"]:::service
        VideosService["VideosService"]:::service
        VotesService["VotesService"]:::service
    end

    subgraph Repositories
        direction TB
        BandEntity["BandEntity"]:::entity
        CommentEntity["CommentEntity"]:::entity
        SeasonEntity["SeasonEntity"]:::entity
        UserEntity["UserEntity"]:::entity
        UserSeasonEntity["UserSeasonEntity"]:::entity
        VideoEntity["VideoEntity"]:::entity
        VoteEntity["VoteEntity"]:::entity
    end

    subgraph DTOs
        direction TB
        CreateBandDto["CreateBandDto"]:::dto
        UpdateBandDto["UpdateBandDto"]:::dto
        CreateCommentDto["CreateCommentDto"]:::dto
        UpdateCommentDto["UpdateCommentDto"]:::dto
        CreateSeasonDto["CreateSeasonDto"]:::dto
        UpdateSeasonDto["UpdateSeasonDto"]:::dto
        CreateUserDto["CreateUserDto"]:::dto
        UpdateUserDto["UpdateUserDto"]:::dto
        UpdateUserSeasonDto["UpdateUserSeasonDto"]:::dto
        CreateVideoDto["CreateVideoDto"]:::dto
        UpdateVideoDto["UpdateVideoDto"]:::dto
        CreateVoteDto["CreateVoteDto"]:::dto
        UpdateVoteDto["UpdateVoteDto"]:::dto
    end

    Database["PostgreSQL Database"]:::database

    %% Module wiring
    AppModule --> BandsController
    AppModule --> CommentsController
    AppModule --> SeasonsController
    AppModule --> UsersController
    AppModule --> VideosController
    AppModule --> VotesController

    %% Controller to Service
    BandsController -->|"calls"| BandsService
    CommentsController -->|"calls"| CommentsService
    SeasonsController -->|"calls"| SeasonsService
    UsersController -->|"calls"| UsersService
    VideosController -->|"calls"| VideosService
    VotesController -->|"calls"| VotesService

    %% Service to Repository
    BandsService -->|"uses"| BandEntity
    CommentsService -->|"uses"| CommentEntity
    SeasonsService -->|"uses"| SeasonEntity
    UsersService -->|"uses"| UserEntity
    UsersService -->|"uses"| UserSeasonEntity
    VideosService -->|"uses"| VideoEntity
    VotesService -->|"uses"| VoteEntity

    %% Repository to Database
    BandEntity -->|reads/writes| Database
    CommentEntity -->|reads/writes| Database
    SeasonEntity -->|reads/writes| Database
    UserEntity -->|reads/writes| Database
    UserSeasonEntity -->|reads/writes| Database
    VideoEntity -->|reads/writes| Database
    VoteEntity -->|reads/writes| Database

    %% Controller to DTOs
    BandsController --> CreateBandDto
    BandsController --> UpdateBandDto
    CommentsController --> CreateCommentDto
    CommentsController --> UpdateCommentDto
    SeasonsController --> CreateSeasonDto
    SeasonsController --> UpdateSeasonDto
    UsersController --> CreateUserDto
    UsersController --> UpdateUserDto
    UsersController --> UpdateUserSeasonDto
    VideosController --> CreateVideoDto
    VideosController --> UpdateVideoDto
    VotesController --> CreateVoteDto
    VotesController --> UpdateVoteDto

    click HTTP "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/main.ts"
    click AppModule "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/app.module.ts"
    click BandsController "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/bands/bands.controller.ts"
    click BandsService "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/bands/bands.service.ts"
    click BandEntity "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/bands/entities/band.entity.ts"
    click CreateBandDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/bands/dto/create-band.dto.ts"
    click UpdateBandDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/bands/dto/update-band.dto.ts"
    click CommentsController "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/comments/comments.controller.ts"
    click CommentsService "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/comments/comments.service.ts"
    click CommentEntity "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/comments/entities/comment.entity.ts"
    click CreateCommentDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/comments/dto/create-comment.dto.ts"
    click UpdateCommentDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/comments/dto/update-comment.dto.ts"
    click SeasonsController "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/seasons/seasons.controller.ts"
    click SeasonsService "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/seasons/seasons.service.ts"
    click SeasonEntity "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/seasons/entities/season.entity.ts"
    click CreateSeasonDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/seasons/dto/create-season.dto.ts"
    click UpdateSeasonDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/seasons/dto/update-season.dto.ts"
    click UsersController "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/users/users.controller.ts"
    click UsersService "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/users/users.service.ts"
    click UserEntity "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/users/entities/user.entity.ts"
    click UserSeasonEntity "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/users/entities/user-season.entity.ts"
    click CreateUserDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/users/dto/create-user.dto.ts"
    click UpdateUserDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/users/dto/update-user.dto.ts"
    click UpdateUserSeasonDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/users/dto/update-user-season.dto.ts"
    click VideosController "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/videos/videos.controller.ts"
    click VideosService "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/videos/videos.service.ts"
    click VideoEntity "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/videos/entities/video.entity.ts"
    click CreateVideoDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/videos/dto/create-video.dto.ts"
    click UpdateVideoDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/videos/dto/update-video.dto.ts"
    click VotesController "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/votes/votes.controller.ts"
    click VotesService "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/votes/votes.service.ts"
    click VoteEntity "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/votes/entities/vote.entity.ts"
    click CreateVoteDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/votes/dto/create-vote.dto.ts"
    click UpdateVoteDto "https://github.com/eric-jy-park/skyst-hackathon/blob/main/src/votes/dto/update-vote.dto.ts"
    click Database "https://github.com/eric-jy-park/skyst-hackathon/blob/main/docker-compose.yml"

    classDef external fill:#f9f,stroke:#333,stroke-width:1px
    classDef server fill:#bbf,stroke:#333,stroke-width:1px
    classDef module fill:#bfb,stroke:#333,stroke-width:1px
    classDef controller fill:#def,stroke:#333,stroke-width:1px
    classDef service fill:#dfd,stroke:#333,stroke-width:1px
    classDef entity fill:#eee,stroke:#333,stroke-width:1px
    classDef database fill:#ccc,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef dto fill:#fed,stroke:#333,stroke-width:1px
```
