yantene / yantene.net

a personal website crafted with shiitake, tofu, and steamed chicken!
https://stg-www.yantene.net
1 stars 0 forks source link

Minimum Viable Product #70

Open yantene opened 1 year ago

yantene commented 1 year ago

TODO

Backend

Controllers

Use Cases

Repositories

Domain Models

Domain Services

Frontend

TBD

Infra

TBD

yantene commented 1 year ago

Class diagram

classDiagram
  class NotesController {
    +index()
    +show()
  }
  NotesController ..> NotesUseCase

  class NotesUseCase {
    +findNotesByCreatedAt()
    +findNotesByModifiedAt()
    +findNote()
  }
  NotesUseCase ..> NotesRepositoryInterface
  NotesUseCase ..> NotesService
  NotesUseCase ..> Note

  class NotesService {
  }
  NotesService ..> Note
  NotesService ..> NotesRepositoryInterface

  class NotesRepositoryInterface {
    +findByCreatedAt()*
    +findByModifiedAt()*
    +findOne()*
    +findMany()*
    +create()*
    +update()*
    +destroy()*
    +findLinkedNotes()*
    +findBacklinkedNotes()*
  }
  <<interface>> NotesRepositoryInterface
  Note <.. NotesRepositoryInterface

  class Note {
    +id
    +title
    +path
    +createdAt
    +modifiedAt
    +body
    +attachments
    +linkingNoteIds
    +toJSON()
    +toString()
    +equals()
  }

  class NoteId {
    +value
    +toJSON()
    +toString()
    +equals()
  }
  Note *-- NoteId

  class NoteTitle {
    +value
    +toJSON()
    +toString()
    +equals()
  }
  Note *-- NoteTitle

  class NotePath {
    +value
    +toJSON()
    +toString()
    +equals()
  }
  Note *-- NotePath

  class NoteBody {
    +value
    +toJSON()
    +toString()
    +equals()
  }
  Note *-- NoteBody

  class NoteFile {
    +id
    +remoteFile
    +localFile
    +toJSON()
    +toString()
    +equals()
  }
  Note o-- NoteFile

  class NoteFileId {
    +value
    +toJSON()
    +toString()
    +equals()
  }
  NoteFile *-- NoteFileId

  class RemoteFile {
    +uri
    +sha1
    +uploadedAt
    +toJSON()
    +toString()
    +equals()
  }
  NoteFile *-- RemoteFile

  class RemoteFileUri {
    +value
    +toJSON()
    +toString()
    +equals()
  }
  RemoteFile *-- RemoteFileUri

  class LocalFile {
    +path
    +sha1
    +toJSON()
    +toString()
    +equals()
  }
  NoteFile *-- LocalFile

  class Sha1 {
    +value
    +toJSON()
    +toString()
    +equals()
  }
  RemoteFile *-- Sha1
  LocalFile *-- Sha1

  class NotesRepository {
    #prisma
    #noteFilesRepository
    +findByCreatedAt()
    +findByModifiedAt()
    +findOne()
    +findMany()
    +create()
    +update()
    +destroy()
    +findLinkedNotes()
    +findBacklinkedNotes()
    toNoteEntity()$
  }
  NotesRepositoryInterface <|-- NotesRepository : implements

  class NoteFilesRepository {
    #prisma
    #s3
    +findOne()
    +findMany()
    +createMissingOne()
    +createMissingMany()
    -createMany()
    +cleanUp()
    +uploadLocalFile()
    toNoteFileEntity()$
  }
  NoteFilesRepository <.. NotesRepository