The classic messenger. Reimagined as a full-stack web application with real-time WebSocket communication.
All the nostalgic WLM features, rebuilt with modern full-stack technology.
A modern full-stack powering a classic experience.
How messages travel from client to server and back to all connected users.
๐จ Supported Message Types
๐ก๏ธ Server Middleware Pipeline
๐ Connection Lifecycle
Client connects โ WS Server assigns rate-limit tokens
Client sends AUTH {token} โ Server validates โ Sends HISTORY + AUTH_SUCCESS
Server broadcasts USER_STATUS_UPDATE to all clients
Client sends messages โ Validated โ Stored โ Broadcast to all
Client disconnects โ Removed from clients โ Status re-broadcast
Get DOT Messanger running locally โ both backend and frontend.
1. Clone the repository
git clone https://github.com/aarab-abderrahmane/messager.git
cd messager
2. Backend setup
cd server
npm install
# Create .env from example
cp .example.env .env
PORT=5000 # Express + WS server port
MAX_TOKENS=10 # Rate limiter token bucket size
JWT_SECRET=mysecretkey # Auth secret
3. Frontend setup
cd ../frontEnd
npm install
4. Run both servers
# Terminal 1 โ Backend
cd server && npm run dev # starts on http://localhost:5000
# Terminal 2 โ Frontend
cd frontEnd && npm run dev # starts on http://localhost:3000
๐ Project Structure
messager/
โโโ server/ # Backend
โ โโโ package.json
โ โโโ server/
โ โโโ server.js # Express + HTTP entry point
โ โโโ config/socket.js # WebSocket server setup
โ โโโ controllers/ # signup, GIF proxy
โ โโโ handlers/ # auth, message, reaction handlers
โ โโโ memory/ # In-memory userStore & chatStore
โ โโโ middleware/ # auth, rateLimiter, validation
โ โโโ routes/chatRoutes.js # REST API endpoints (/Dot)
โ โโโ services/ # broadcast, messageFactory
โ
โโโ frontEnd/ # Frontend
โโโ public/ # Static assets, avatars, stickers
โโโ src/
โโโ App.tsx # Root โ SignupPage or ChatPage
โโโ types.ts # Message, UserData, NewsItem
โโโ constants.ts # Avatars, stickers, emojis
โโโ components/
โโโ common/ # TitleBar, Toast
โโโ signup/ # SignupPage
โโโ chat/ # ChatPage + all dialogs
โโโ ChatPage.tsx
โโโ ThemeDialog.tsx
โโโ StickerDialog.tsx
โโโ ProfileDialog.tsx
โโโ PhotoPreviewDialog.tsx
โโโ PdfPreviewDialog.tsx
โโโ NewsDialog.tsx
โโโ GiftDialog.tsx
โโโ FormatButton.tsx
Key props and interfaces for the main components.
TitleBar
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | โ | Window title text displayed in the blue bar |
| icon | ReactNode | โ | Optional icon before the title |
| onClose | () => void | โ | Callback for the โ close button |
| showControls | boolean | true | Show min/max/close window controls |
ChatPage
| Prop | Type | Description |
|---|---|---|
| user | UserData | Current authenticated user (token, email, username, avatar) |
| onLogout | () => void | Clears localStorage and returns to SignupPage |
Message Interface
| Field | Type | Description |
|---|---|---|
| id | string | Unique message identifier (UUID) |
| type | 'text' | 'image' | 'voice' | 'pdf' | 'sticker' | 'gif' | 'gift' | 'nudge' | 'system' | Message content type |
| content | string | Text content or base64-encoded media |
| sender | 'me' | 'them' | Message direction |
| reactions | {[emoji]: string[]} | Map of emoji โ array of user emails |
| replyTo | {id, text, username} | Optional threaded reply reference |
| attachments | {name, content}[] | PDF file attachments (up to 3) |
ThemeDialog
| Prop | Type | Description |
|---|---|---|
| isOpen | boolean | Controls dialog visibility |
| onClose | () => void | Callback to close the dialog |
| onApply | (theme) => void | Applies font, colours, and font-size globally |
DOT Messanger windows โ faithful to the original WLM 7 layout.