mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 18:29:39 +02:00
feat(matrix): add SvelteKit Matrix client (Phase 1)
Implements a minimal self-hosted Matrix chat client with: - matrix-js-sdk integration with Svelte 5 runes store - Password login with homeserver discovery - Room list (DMs and groups) with unread counts - Message timeline with typing indicators - Send messages with Enter key - Responsive chat UI with Tailwind CSS Project structure: - apps/matrix/apps/web: SvelteKit client (port 5180) - apps/matrix/packages/shared: Shared types Commands: pnpm dev:matrix:web https://claude.ai/code/session_01RUrt2qN1D3nVh9HcGpwoby
This commit is contained in:
parent
bea066c7f8
commit
4e622a66de
36 changed files with 2453 additions and 0 deletions
2
apps/matrix/packages/shared/src/index.ts
Normal file
2
apps/matrix/packages/shared/src/index.ts
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
// Re-export all types
|
||||
export * from './types';
|
||||
42
apps/matrix/packages/shared/src/types.ts
Normal file
42
apps/matrix/packages/shared/src/types.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* Shared types for Matrix client
|
||||
*/
|
||||
|
||||
export type SyncState = 'STOPPED' | 'PREPARED' | 'SYNCING' | 'ERROR' | 'RECONNECTING' | 'CATCHUP';
|
||||
|
||||
export interface MatrixCredentials {
|
||||
homeserver: string;
|
||||
accessToken: string;
|
||||
userId: string;
|
||||
deviceId: string;
|
||||
}
|
||||
|
||||
export type MessageType = 'm.text' | 'm.image' | 'm.file' | 'm.audio' | 'm.video' | 'm.emote' | 'm.notice';
|
||||
|
||||
export interface SimpleMessage {
|
||||
id: string;
|
||||
sender: string;
|
||||
senderName: string;
|
||||
body: string;
|
||||
formattedBody?: string;
|
||||
timestamp: number;
|
||||
type: MessageType;
|
||||
isOwn: boolean;
|
||||
replyTo?: string;
|
||||
edited?: boolean;
|
||||
}
|
||||
|
||||
export interface SimpleRoom {
|
||||
id: string;
|
||||
name: string;
|
||||
topic?: string;
|
||||
avatar?: string;
|
||||
lastMessage?: string;
|
||||
lastMessageSender?: string;
|
||||
lastMessageTime?: number;
|
||||
unreadCount: number;
|
||||
highlightCount: number;
|
||||
isDirect: boolean;
|
||||
isEncrypted: boolean;
|
||||
memberCount: number;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue