Zero-Server, Peer-to-Peer (P2P) Real-Time Office Presence & Meeting Room Management System.
English Documentation β’ πΉπ· TΓΌrkΓ§e DokΓΌmantasyon β’ π Case Study
OfisPresence is a high-performance desktop application for tracking workplace presence, employee availability, and meeting room occupancy without requiring a central server or cloud backend (Zero-Server Architecture).
Peers on the same local area network (LAN) discover each other automatically via mDNS/UDP multicasting and synchronize presence states in real time using Yjs CRDTs (Conflict-free Replicated Data Types) with Ed25519 cryptographic authentication.
flowchart TD
subgraph LAN["π Local Area Network (LAN Mesh)"]
PeerA["π» Peer Node A (Alice)"]
PeerB["π» Peer Node B (Bob)"]
PeerC["π» Peer Node C (Charlie)"]
end
subgraph Discovery["π‘ Discovery & Transport Layer"]
mDNS["mDNS / UDP Multicast Discovery
(Port 5353 / 41234)"]
WSServer["Embedded WebSocket Server / Client"]
end
subgraph CoreEngine["π§ P2P Core Engine (Electron Main)"]
YjsDoc["Yjs Shared CRDT Document
(Presence Map & Room State)"]
CryptoEngine["Ed25519 Cryptographic Signatures
(Tamper-Proof Status Updates)"]
KeytarStore["Keytar OS Keychain & SQLite Encrypted Fallback"]
Simulator["Virtual Mesh Simulation Engine
(5 Virtual Teammates Demo Mode)"]
end
subgraph UI["π₯οΈ Presentation Layer (React 18 & Tailwind)"]
PresenceGrid["Employee Presence Grid & Status Selectors"]
FloorPlan["Interactive 2D Floor Plan Visualizer"]
Rooms["Meeting Room Management & Modals"]
AuditLog["Timeline Audit History & Admin Panel"]
end
PeerA <===> mDNS <===> PeerB
PeerB <===> WSServer <===> PeerC
WSServer <--> YjsDoc
YjsDoc <--> CryptoEngine
CryptoEngine <--> KeytarStore
YjsDoc <--> UI
- No centralized database, server, or cloud subscriptions required.
- Devices discover each other on the local network via mDNS/UDP multicasting and establish direct peer-to-peer WebSocket channels.
- Fully offline-first: works seamlessly even if internet connectivity drops.
- State synchronization is powered by Yjs (CRDT).
- Status changes, room entries/exits, and custom availability broadcasts propagate across all active nodes within milliseconds with zero merge conflicts.
- Test the full multi-user P2P experience on a single machine!
- Enables 5 virtual AI teammates who dynamically change statuses, move between meeting rooms, and simulate realistic office presence.
- Real-time visual map of the office layout.
- See at a glance who is currently at their desk, in meeting room "Mars", or on the field.
- Join virtual rooms ("Mars", "VenΓΌs", "JΓΌpiter") with a single click.
- Entering a meeting room automatically broadcasts an "In Meeting" status to the entire office mesh.
- Role-based administrator panel allows adding, editing, and deleting rooms dynamically.
- All status broadcasts are cryptographically signed with Ed25519 key pairs to prevent spoofing.
- Private keys are stored in the OS native keychain (Keytar). If unavailable, an encrypted local SQLite storage fallback is automatically activated.
- Instant desktop notifications on room joins and emergency field status broadcasts.
- Comprehensive timeline history tracking employee availability transitions throughout the day.
- Node.js (v18+)
- npm or yarn
git clone https://github.com/adacreativeco/OfisPresence.git
cd OfisPresence
npm installnpm testnpm run devnpm run buildnpm run packageOfisPresence/
βββ electron/ # Electron Main & Preload processes
β βββ main.ts # Electron lifecycle & window management
β βββ preload.ts # Secure IPC bridge (contextBridge)
β βββ lib/ # Core P2P networking & state libraries
β βββ crypto.ts # Ed25519 signing & verification
β βββ discovery.ts # mDNS / UDP mesh peer discovery
β βββ identity.ts # Cryptographic keypair generation & identity
β βββ ipc.ts # IPC handler registry
β βββ notifications.ts # Native OS desktop notification dispatch
β βββ persistence.ts # SQLite state storage & Keytar fallback
β βββ simulation.ts # Virtual mesh 5-agent simulation engine
β βββ ws-server.ts # Peer-to-peer WebSocket transport
β βββ yjs-manager.ts # Yjs CRDT document & awareness manager
βββ src/ # React 18 & TailwindCSS Renderer
β βββ App.tsx # Main layout & tab orchestration
β βββ main.tsx # React DOM entry point
β βββ components/
β β βββ admin/AdminPanel.tsx # Role-based room & office management
β β βββ history/StatusHistory.tsx # Availability timeline & audit trail
β β βββ map/FloorPlan.tsx # Interactive 2D floor plan visualizer
β β βββ rooms/ # Meeting room cards & join dialogs
β β βββ setup/SetupWizard.tsx # First-launch onboarding & identity setup
β β βββ status/ # Custom status & field dialogs
β β βββ ui/ # Reusable Shadcn/Radix UI components
β βββ lib/
β β βββ i18n.ts # Bilingual translation engine (TR β· EN)
β β βββ locales/ # JSON dictionaries (en.json, tr.json)
β βββ styles/globals.css # Dark-themed Tailwind design system
βββ shared/
β βββ types.ts # Shared TypeScript interfaces & models
βββ tests/ # Automated Vitest test suite
β βββ crypto.test.ts # Ed25519 signature & tamper tests
β βββ i18n.test.ts # Locale key parity tests
β βββ persistence.test.ts # Encrypted storage & fallback tests
β βββ yjs.test.ts # CRDT document mutation & sync tests
βββ electron.vite.config.ts # Electron-Vite compilation config
βββ package.json # Package metadata & build scripts
βββ tsconfig.json # TypeScript compiler configuration
Distributed under the Apache 2.0 License. See LICENSE for details.

