matrix
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v67View latest version
A beautiful web-based Matrix client built with React and TailwindCSS featuring dark mode support.
- Connect to any Matrix homeserver
- Login with username/password
- View and join rooms
- Send and receive messages
- Real-time message updates
- Beautiful dark/light mode toggle
- Responsive design with improved UI
- Enhanced message display with better grouping
- Smooth animations and transitions
βββ backend/
β βββ index.ts # Proxy server for Matrix API (CORS handling)
βββ frontend/
β βββ components/
β β βββ App.tsx # Main application component
β β βββ Login.tsx # Login form
β β βββ RoomList.tsx # List of joined rooms
β β βββ ChatView.tsx # Chat interface
β β βββ MessageList.tsx # Message display
β β βββ MessageInput.tsx # Message composition
β βββ index.html # Main HTML template
β βββ index.tsx # Frontend entry point
βββ shared/
β βββ types.ts # Shared TypeScript types
βββ README.md
- Open the application
- Enter your Matrix homeserver URL (e.g., https://matrix.org)
- Login with your Matrix credentials
- Browse rooms and start chatting!
- β End-to-End Encryption: Basic message encryption support with visual indicators
- β Encryption Detection: Automatically detects encrypted rooms and shows status
- β Visual Security Indicators: Lock icons and encryption badges throughout the UI
- β Encrypted Message Handling: Decrypt incoming messages and encrypt outgoing ones
- β Fallback Support: Graceful degradation when encryption is unavailable
- β Enhanced Dark/Light Mode: Intelligent theme system with system preference detection
- β Smooth Theme Transitions: Beautiful animated icon transitions and smooth color changes
- β No Flash Loading: Theme applied before page render to prevent white flash
- β System Integration: Automatically follows system dark/light mode preference
- β Persistent Preferences: Remembers manual theme selection across sessions
- β Responsive Design: Works perfectly on desktop and mobile
- β Enhanced Login: Gradient background with improved form styling
- β Tabbed Interface: Separate tabs for public rooms and direct messages
- β Private Messages: Full support for direct message conversations
- β Smart Room Detection: Automatically categorizes rooms vs DMs
- β Advanced Chat View: Enhanced message bubbles with better grouping
- β Smart Message Display: Date separators and time grouping
- β Fixed Input Box: No more scrolling issues, proper auto-resize
- β Duplicate Prevention: Smart filtering to prevent message repetition
- β Real-time Sync: Live message updates with optimized polling
- β Session Persistence: Automatic login restoration
- β Error Handling: Comprehensive error states with retry options
- β Optimistic Sending: Messages appear instantly with proper fallback
- β Smooth Animations: CSS transitions and message animations
- β Custom Scrollbars: Styled for both light and dark modes
- Backend: Hono-based proxy server to handle CORS issues with Matrix homeservers
- Frontend: React SPA with TailwindCSS for styling
- Real-time: Polling-based sync for new messages
- Storage: LocalStorage for session persistence
- API: Matrix Client-Server API v1.0
- Encryption: Simplified end-to-end encryption using Web Crypto API (demonstration purposes)
The encryption system is now a working simplified implementation for demonstration purposes.
How it works:
- Only encrypts messages sent by our client (prefixed with
MATRIX_ENCRYPTED:) - Uses Web Crypto API with AES-GCM encryption
- Generates room-specific encryption keys
- Automatically detects and decrypts our own encrypted messages
- Leaves other messages (from other clients) as plaintext
- Visual indicators show which messages are encrypted
Key Features:
- β Working encryption/decryption for messages sent by this client
- β Visual feedback with lock icons and status indicators
- β Debug tools to test encryption functionality
- β Graceful fallback when encryption fails
- β Room-specific keys for better security
Testing Encryption:
- Join an encrypted room (shows green "Encrypted" badge)
- Send a message - it will be encrypted before sending to Matrix
- Your encrypted messages show a lock icon
- Use the debug button (π) in encrypted rooms to test encryption
- Check browser console for detailed encryption logs
Production Considerations:
- This is a demonstration only - use official Matrix SDK for production
- Real Matrix encryption uses Olm/Megolm protocols
- Proper key verification and device management needed
- Cross-signing and key backup required for production use