Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏒 OfisPresence

Electron React TypeScript Yjs CRDT Vite License Tests GitHub Stars Release


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.


πŸ“Έ Visual Showcase

πŸ“Š Employee Presence & 2D Floor Plan πŸšͺ Meeting Room Occupancy & Auto-Sync
Office Presence Dashboard Meeting Room Join and Status Sync
Real-time employee presence grid, custom statuses, 2D floor plan map, and presence audit history. Interactive meeting rooms ("Mars", "VenΓΌs") with automated participant tracking and "In Meeting" status broadcast.

πŸ—οΈ System Architecture

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
Loading

πŸš€ Key Features

1. ⚑ Zero-Server P2P Mesh Network

  • 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.

2. πŸ”„ Conflict-Free Real-Time State Sync (CRDT)

  • 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.

3. πŸ§ͺ Virtual Mesh Simulation Mode (Instant Demo)

  • 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.

4. πŸ—ΊοΈ Interactive 2D Floor Plan Visualizer

  • 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.

5. πŸšͺ Meeting Room Management & Presence Auto-Lock

  • 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.

6. πŸ” Cryptographic Identity & Keytar Resilience

  • 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.

7. πŸ”” Native Desktop Notifications & Timeline Audit

  • Instant desktop notifications on room joins and emergency field status broadcasts.
  • Comprehensive timeline history tracking employee availability transitions throughout the day.

πŸ› οΈ Quick Start

Prerequisites

  • Node.js (v18+)
  • npm or yarn

1. Clone & Install Dependencies

git clone https://github.com/adacreativeco/OfisPresence.git
cd OfisPresence
npm install

2. Run Automated Unit Tests (Vitest)

npm test

3. Start Development Server

npm run dev

4. Build Production Bundle

npm run build

5. Package Desktop Executable (Windows / macOS / Linux)

npm run package

πŸ“‚ Project Structure

OfisPresence/
β”œβ”€β”€ 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

πŸ“„ License

Distributed under the Apache 2.0 License. See LICENSE for details.


Built with 🏒 by ADA Creative Co.

About

Zero-Server, Peer-to-Peer (P2P) real-time office presence & meeting room tracking desktop app built with Electron, React, TypeScript, and Yjs CRDTs.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages