added docs
This commit is contained in:
164
docs/architecture-class-diagram.puml
Normal file
164
docs/architecture-class-diagram.puml
Normal file
@@ -0,0 +1,164 @@
|
||||
@startuml "Backend Klassendiagramm"
|
||||
|
||||
skinparam packageStyle rectangle
|
||||
skinparam classAttributeIconSize 0
|
||||
skinparam classFontSize 11
|
||||
skinparam defaultFontSize 10
|
||||
|
||||
top to bottom direction
|
||||
|
||||
title Backend Architektur - Klassendiagramm
|
||||
|
||||
package "Controller Layer" #ADD8E6 {
|
||||
class AuthController {
|
||||
' +login()
|
||||
' +register()
|
||||
' +refresh()
|
||||
' +logout()
|
||||
}
|
||||
|
||||
class ChatController {
|
||||
' +sendMessage()
|
||||
' +confirmEvent()
|
||||
' +rejectEvent()
|
||||
' +getConversations()
|
||||
}
|
||||
|
||||
class EventController {
|
||||
' +create()
|
||||
' +getAll()
|
||||
' +getByDateRange()
|
||||
' +update()
|
||||
' +delete()
|
||||
}
|
||||
|
||||
class AuthMiddleware {
|
||||
' +authenticate()
|
||||
}
|
||||
}
|
||||
|
||||
package "Service Layer" #90EE90 {
|
||||
package "Interfaces" {
|
||||
interface AIProvider {
|
||||
' +processMessage()
|
||||
}
|
||||
|
||||
interface UserRepository {
|
||||
' +findById()
|
||||
' +findByEmail()
|
||||
' +create()
|
||||
}
|
||||
|
||||
interface EventRepository {
|
||||
' +findById()
|
||||
' +findByUserId()
|
||||
' +findByDateRange()
|
||||
' +create()
|
||||
' +update()
|
||||
' +delete()
|
||||
}
|
||||
|
||||
interface ChatRepository {
|
||||
' +getHistory()
|
||||
' +create()
|
||||
}
|
||||
}
|
||||
|
||||
class AuthService {
|
||||
' -userRepo: UserRepository
|
||||
' +login()
|
||||
' +register()
|
||||
}
|
||||
|
||||
class ChatService {
|
||||
' -chatRepo: ChatRepository
|
||||
' -eventRepo: EventRepository
|
||||
' -aiProvider: AIProvider
|
||||
' +processMessage()
|
||||
' +confirmEvent()
|
||||
}
|
||||
|
||||
class EventService {
|
||||
' -eventRepo: EventRepository
|
||||
' +create()
|
||||
' +getByDateRange()
|
||||
' +update()
|
||||
' +delete()
|
||||
}
|
||||
}
|
||||
|
||||
package "AI Layer" #FFA07A {
|
||||
class ClaudeAdapter implements AIProvider {
|
||||
' -apiKey: string
|
||||
' +processMessage()
|
||||
}
|
||||
}
|
||||
|
||||
package "Data Access Layer" #FFD700 {
|
||||
class MongoUserRepository implements UserRepository {
|
||||
' -model: UserModel
|
||||
}
|
||||
|
||||
class MongoEventRepository implements EventRepository {
|
||||
' -model: EventModel
|
||||
}
|
||||
|
||||
class MongoChatRepository implements ChatRepository {
|
||||
' -model: ChatModel
|
||||
}
|
||||
}
|
||||
|
||||
package "Models" #D3D3D3 {
|
||||
class User <<Entity>> {
|
||||
' +id: string
|
||||
' +email: string
|
||||
' +displayName: string
|
||||
}
|
||||
|
||||
class CalendarEvent <<Entity>> {
|
||||
' +id: string
|
||||
' +userId: string
|
||||
' +title: string
|
||||
' +startTime: Date
|
||||
' +endTime: Date
|
||||
' +note?: string
|
||||
}
|
||||
|
||||
class ChatMessage <<Entity>> {
|
||||
' +id: string
|
||||
' +sender: string
|
||||
' +content: string
|
||||
' +proposedEvent?: ProposedEvent
|
||||
}
|
||||
}
|
||||
|
||||
package "Utils" #DDA0DD {
|
||||
class JWT {
|
||||
' +signToken()
|
||||
' +verifyToken()
|
||||
}
|
||||
|
||||
class Password {
|
||||
' +hash()
|
||||
' +compare()
|
||||
}
|
||||
}
|
||||
|
||||
' Controller -> Service
|
||||
AuthController --> AuthService
|
||||
ChatController --> ChatService
|
||||
EventController --> EventService
|
||||
AuthMiddleware --> JWT
|
||||
|
||||
' Service -> Interfaces (intern)
|
||||
AuthService --> UserRepository
|
||||
ChatService --> ChatRepository
|
||||
ChatService --> EventRepository
|
||||
ChatService --> AIProvider
|
||||
EventService --> EventRepository
|
||||
|
||||
' Auth uses Utils
|
||||
AuthService --> JWT
|
||||
AuthService --> Password
|
||||
|
||||
@enduml
|
||||
Reference in New Issue
Block a user