1.5 KiB
1.5 KiB
Architecture Overview
Plexus is designed as a real-time, decentralized-first chat application.
🏗 System Components
1. Frontend (Client)
- Built with Vue 3 and Vite.
- Uses Pinia for state management (messages, users, channels).
- Communicates with the backend via Socket.IO for real-time updates.
- Simulates Solana transactions for messages, reactions, and username changes.
2. Backend (Server)
- Built with Node.js and Express.
- Uses Socket.IO to handle real-time communication.
- DuckDB is used as the primary data store for:
- User profiles (wallet addresses, unique usernames).
- Message history.
- Reactions.
3. Database Schema
users:wallet_address(PK),username(UNIQUE),last_seen.messages:id(PK),channel_id,wallet_address,content,timestamp,tx_id.reactions:message_id,wallet_address,emoji.
🔄 Data Flow
- User Joins: Client emits
joinwith wallet address and requested username. Server verifies/generates unique username and updatesuserstable. - Sending Message: Client simulates transaction, then emits
sendMessagewithtxId. Server saves message to DuckDB and broadcastsnewMessageto all clients. - Reactions: Client emits
toggleReaction. Server updatesreactionstable and broadcastsupdateReactions.
🛡 Security
- Currently uses a simple wallet-based identification.
- Future versions will implement full message signing and verification.