- Add CaldavService with tsdav/ical.js for CalDAV server communication - Add CaldavController, CaldavRepository, and caldav routes - Add client-side CaldavConfigService with sync(), config CRUD - Add CalDAV settings UI with config load/save in settings screen - Sync on login, auto-login (AuthGuard), periodic timer (calendar), and sync button - Push single events to CalDAV on server-side create/update/delete - Push all events to CalDAV after chat event confirmation - Refactor ChatService to use EventService instead of direct EventRepository - Rename CalDav/calDav to Caldav/caldav for consistent naming - Add Radicale Docker setup for local CalDAV testing - Update PlantUML diagrams and CLAUDE.md with CalDAV architecture
238 lines
5.0 KiB
Plaintext
238 lines
5.0 KiB
Plaintext
@startuml "Backend Klassendiagramm"
|
|
|
|
scale 0.9
|
|
skinparam dpi 600
|
|
skinparam backgroundColor #FFAB40
|
|
|
|
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()
|
|
' +getConversation()
|
|
}
|
|
|
|
class EventController {
|
|
' -pushToCaldav()
|
|
' -deleteFromCaldav()
|
|
' +create()
|
|
' +getById()
|
|
' +getAll()
|
|
' +getByDateRange()
|
|
' +update()
|
|
' +delete()
|
|
}
|
|
|
|
class CaldavController {
|
|
' +saveConfig()
|
|
' +loadConfig()
|
|
' +deleteConfig()
|
|
' +pullEvents()
|
|
' +pushEvents()
|
|
' +pushEvent()
|
|
}
|
|
|
|
class AuthMiddleware {
|
|
' +authenticate()
|
|
}
|
|
}
|
|
|
|
package "Service Layer" #90EE90 {
|
|
package "Interfaces" {
|
|
interface AIProvider {
|
|
' +processMessage()
|
|
}
|
|
|
|
interface UserRepository {
|
|
' +findById()
|
|
' +findByEmail()
|
|
' +create()
|
|
}
|
|
|
|
interface EventRepository {
|
|
' +findById()
|
|
' +findByUserId()
|
|
' +findByDateRange()
|
|
' +findByCaldavUUID()
|
|
' +searchByTitle()
|
|
' +create()
|
|
' +update()
|
|
' +delete()
|
|
' +addExceptionDate()
|
|
}
|
|
|
|
interface ChatRepository {
|
|
' +getConversationsByUser()
|
|
' +createConversation()
|
|
' +getMessages()
|
|
' +createMessage()
|
|
' +updateProposalResponse()
|
|
' +updateProposalEvent()
|
|
}
|
|
|
|
interface CaldavRepository {
|
|
' +findByUserId()
|
|
' +createOrUpdate()
|
|
' +deleteByUserId()
|
|
}
|
|
}
|
|
|
|
class AuthService {
|
|
' -userRepo: UserRepository
|
|
' +login()
|
|
' +register()
|
|
}
|
|
|
|
class ChatService {
|
|
' -chatRepo: ChatRepository
|
|
' -eventService: EventService
|
|
' -aiProvider: AIProvider
|
|
' +processMessage()
|
|
' +confirmEvent()
|
|
' +rejectEvent()
|
|
' +getConversations()
|
|
' +getConversation()
|
|
}
|
|
|
|
class EventService {
|
|
' -eventRepo: EventRepository
|
|
' +create()
|
|
' +getById()
|
|
' +getAll()
|
|
' +getByDateRange()
|
|
' +searchByTitle()
|
|
' +findByCaldavUUID()
|
|
' +update()
|
|
' +delete()
|
|
' +deleteRecurring()
|
|
}
|
|
|
|
class CaldavService {
|
|
' -caldavRepo: CaldavRepository
|
|
' -eventService: EventService
|
|
' +connect()
|
|
' +pullEvents()
|
|
' +pushEvent()
|
|
' +pushAll()
|
|
' +deleteEvent()
|
|
' +getConfig()
|
|
' +saveConfig()
|
|
' +deleteConfig()
|
|
}
|
|
}
|
|
|
|
package "AI Implementations" #FFA07A {
|
|
class GPTAdapter implements AIProvider {
|
|
' -apiKey: string
|
|
' +processMessage()
|
|
}
|
|
}
|
|
|
|
package "Data Access Implementations" #FFD700 {
|
|
class MongoUserRepository implements UserRepository {
|
|
' -model: UserModel
|
|
}
|
|
|
|
class MongoEventRepository implements EventRepository {
|
|
' -model: EventModel
|
|
}
|
|
|
|
class MongoChatRepository implements ChatRepository {
|
|
' -model: ChatModel
|
|
}
|
|
|
|
class MongoCaldavRepository implements CaldavRepository {
|
|
' -model: CaldavConfigModel
|
|
}
|
|
}
|
|
|
|
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()
|
|
}
|
|
|
|
class RecurrenceExpander {
|
|
' +expandRecurringEvents()
|
|
}
|
|
|
|
class EventFormatters {
|
|
' +getWeeksOverview()
|
|
' +getMonthOverview()
|
|
}
|
|
}
|
|
|
|
' Controller -> Service
|
|
AuthController --> AuthService
|
|
ChatController --> ChatService
|
|
ChatController --> CaldavService
|
|
EventController --> EventService
|
|
EventController --> CaldavService
|
|
CaldavController --> CaldavService
|
|
AuthMiddleware --> JWT
|
|
|
|
' Service -> Interfaces (intern)
|
|
AuthService --> UserRepository
|
|
ChatService --> ChatRepository
|
|
ChatService --> EventService
|
|
ChatService --> AIProvider
|
|
EventService --> EventRepository
|
|
CaldavService --> CaldavRepository
|
|
CaldavService --> EventService
|
|
|
|
' Auth uses Utils
|
|
AuthService --> JWT
|
|
AuthService --> Password
|
|
|
|
' Event/Chat uses Utils
|
|
EventService --> RecurrenceExpander
|
|
ChatService --> EventFormatters
|
|
|
|
@enduml
|