Skip to content

entity diagram

%%{init: { 'logLevel': 'debug', 'theme': 'default' } }%%
classDiagram
    direction LR
    class Book {
        +String isbn
        +String title
        +int yearOfPublication
        +String status
        +List<String> authors
        +Location location
        +List<Tag> tags
        +List<Rating> ratings
    }

    class Borrow {
        +UUID uuid
        +String idUser
        +String serverID
        +String isbn
        +String status
        +String date
    }

    class Collection {
        +UUID uuid
        +String sharedUrl
        +String name
        +List<Book> books
    }

    class Location {
        +UUID uuid
        +String place
        +String shelf
        +String room
    }

    class Rating {
        +UUID uuid
        +UUID userId
        +String isbn
        +int note
    }

    class Tag {
        +String label
    }

    class User {
        +UUID uuid
        +String pseudo
        +String password
        +Role role
        +List<Collection> collections
    }
    
    Collection "1" --> "*" Book : contains
    User "1" --> "*" Collection : owns
    Rating "1" --> "1" User : given_by
    Rating "1" --> "1" Book : rated
    Borrow "1" --> "1" User : borrowed_by
    Borrow "1" --> "1" Book : references
    Book "*" --> "1" Location : has
    Book "*" --> "*" Tag : has
    Book "*" --> "*" Rating : has

%%{init: { 'logLevel': 'debug', 'theme': 'default' } }%%
erDiagram
    BOOK {
        STRING isbn PK
        STRING title
        INT yearOfPublication
        STRING status
    }
    BOOK ||--o{ STRING : authors
    BOOK ||--o| LOCATION : has
    BOOK ||--o{ TAG : has
    BOOK ||--o{ RATING : has

    BORROW {
        UUID uuid PK
        STRING idUser
        STRING serverID
        STRING isbn FK
        STRING status
        STRING date
    }
    BORROW }|--|| BOOK : references
    BORROW }|--|| USER : borrowed_by

    COLLECTION {
        UUID uuid PK
        STRING sharedUrl
        STRING name
    }
    COLLECTION ||--o{ BOOK : contains
    USER ||--o{ COLLECTION : owns

    LOCATION {
        UUID uuid PK
        STRING place
        STRING shelf
        STRING room
    }

    RATING {
        UUID uuid PK
        UUID userId FK
        STRING isbn FK
        INT note
    }
    RATING }|--|| USER : given_by
    RATING }|--|| BOOK : rated

    TAG {
        STRING label PK
    }
    TAG ||--|{ BOOK : tagged_to

    USER {
        UUID uuid PK
        STRING pseudo
        STRING password
        STRING role
    }
    USER ||--o{ COLLECTION : owns
    USER ||--o{ BORROW : borrows
Edited by Steve Durand NOUYEP NOUNDJIO