๐ Official Selected Project for ECSoC 2026 (Elite Coders Summer of Code) & OSCI 2026 (Open Source Contribution India) ๐
WorkSphere is an autonomous multi-agent ecosystem engineered for remote professionals, digital nomads, and distributed teams.
Discover top-tier cafes, coworking spaces, and quiet libraries dynamically ranked on WiFi speeds, power outlet density, real-time noise metrics, and live seating occupancy.
๐ Launch Live Demo โข โจ Features โข ๐๏ธ Architecture โข โก Quickstart โข ๐ฅ Contributors (111) โข ๐ Report Issue
| Role | Leader | GitHub | Badges |
|---|---|---|---|
| ๐ Founder & Lead Architect / CTO | Satyam Pandey | @SatyamPandey-07 |
Tip
Issue Claiming & Auto-Merge Workflow:
- Post
/claimon any open issue to auto-assign it to yourself (limit: up to 10 active issues, 6-day completion window). - Post
/unclaimon an issue to unassign yourself if you need to release it for other contributors! - When opening a PR, link the issue (e.g.
Closes #123). Our CI will automatically approve and squash-merge your PR with co-author credit!
A massive thank you to all 111 brilliant contributors and bots building WorkSphere! ๐
- Features
- Core Platform Capabilities
- Tech Stack
- Architecture
- Getting Started
- Environment Variables
- Testing
- Pages
- API Routes
- Multi-Agent System
- Project Structure
- Troubleshooting
- Future Improvements
- Contributing
- License
- Natural Language Queries: "Find a quiet cafe with good WiFi near me"
- Smart Intent Understanding: Extracts work type, amenities, location preferences
- Intelligent Scoring: Ranks venues based on work-friendliness criteria
The chatbot supports voice-to-text via the Web Speech API:
| Browser | Voice Input |
|---|---|
| Chrome 33+ | โ Supported |
| Edge 79+ | โ Supported |
| Safari (desktop/mobile) | โ Supported (webkit prefix) |
| Firefox Stable | |
| Firefox Nightly |
Firefox users: The Web Speech API is disabled by default. To enable it:
- Navigate to
about:configin Firefox. - Search for
media.webspeech.recognition.enableand set it totrue. - Reload the application.
When voice input is unavailable, a clear warning banner is displayed and the feature degrades gracefully โ the text input remains fully functional.
- Dark Theme: Beautiful CartoDB Dark Matter tiles
- Real-time Markers: Purple glowing venue markers with venue photos
- Green Route Lines: Real road routing with OSRM (not straight lines)
- User Location: Custom marker with Clerk user avatar
- Auto-centering: Map adjusts to show search results
- Dark Popups: Styled popups matching the theme
- Server-Sent Events (SSE): Live venue data pushed from server to client
- Live Ratings: See new reviews appear instantly without refreshing
- Availability Updates: Crowd levels update in real-time
- Stable Connections: Smart reconnect logic prevents connection spam
- Pexels Integration: High-quality venue photos via Pexels API
- Server-side Proxy: API key never exposed to the browser
- DB Caching: Each venue fetched once, then served from cache
- Lazy Loading: Skeleton shimmer while photo loads, graceful fallback on error
- Free tier: 20,000 requests/month, no billing required
- OpenStreetMap Integration: Real venue data from OSM Overpass API
- Amenities Display: WiFi, outdoor seating, accessibility from OSM
- Opening Hours: Real business hours when available
- No Credit Card Required: All APIs are completely free
- OSRM Integration: Actual road paths instead of straight lines
- Turn-by-turn Geometry: Realistic routes on the map
- Distance Calculation: Accurate road distance to venues
- Multiple Profiles: Walking, driving, cycling routes
- 5 Specialized AI Agents working together:
- Orchestrator โ Context โ Data โ Reasoning โ Action
- Transparent Reasoning: See each agent's thought process
- Parallel Processing: Efficient query handling
- Favorites System: Save frequently visited spots
- Crowdsourced Ratings: Rate venues on WiFi quality, outlets, noise levels, quietness
- Rating Dialog: Beautiful modal with 5-star ratings for each amenity
- Conversation History: Resume previous searches
- Venue Suggestions: Submit new venues via modal form
- Profile Dashboard: Complete analytics dashboard showing booking history
- "NEURAL LEDGER": Futuristic booking history with confirmation IDs, dates, venue details
- Download Receipts: PDF receipts for each booking with automatic download
- View on Map: External link button to view booked venues on the interactive map
- Booking Status: Visual status badges (Confirmed, Pending, Cancelled)
- Clerk Integration: Secure sign-in/sign-up
- User Profiles: Personalized experience
- Webhook Sync: Real-time user data updates
- Serverless-Compatible: Uses pdf-lib (not PDFKit) for AWS Lambda compatibility
- Instant Generation: PDF receipts generated on-demand for confirmed bookings
- Professional Format: Includes venue details, booking info, confirmation ID, timestamps
- Embedded Fonts: Helvetica and HelveticaBold loaded from pdf-lib (no filesystem dependencies)
- Direct Download: One-click download with loading states and error handling
- Fixed Build Issues: Resolved Buffer/Uint8Array compatibility and cuid ID string handling
- Installable: Add to home screen on mobile/desktop
- Offline Support: IndexedDB storage for venues and favorites
- Service Worker: Caches static assets for fast loading
- Background Sync: Queue actions when offline
- Rate Limiting: API protection with configurable limits
- Data Caching: Multi-layer caching with TTL support
- Error Boundaries: Graceful error handling prevents crashes
- Loading Skeletons: Smooth loading states for better UX
See docs/NEXTJS_PERFORMANCE_PLAYBOOK.md for a full guide on rendering strategies, bundle optimization, image optimization, caching, and Core Web Vitals measurement.
- Event Tracking: Track searches, venue interactions, agent performance
- Agent Metrics: Monitor AI pipeline execution times
- Search Patterns: Understand user behavior and preferences
- 838+ Test Suites: Full coverage with Jest & React Testing Library
- E2E Testing: Playwright configuration for end-to-end user journey tests
- API Tests: Route handler testing with in-memory request simulation
- Component Tests: UI component validation and accessibility audits
- Solana Pay Engine: High-contrast QR payment modal with dynamic payment request generation, Screen Wake Lock API integration to prevent display dimming during scan, and verifiable on-chain confirmation (protected against synthetic confirmation spoofing).
- Focus Session Bounties & Escrow: Stake crypto tokens to commit to deep work sessions; automated smart-contract payout release upon verified session completion (
/api/bounties/payout,/api/bookings/escrow). - Virtual Single-Use Cards & Automated Invoicing: Issue ephemeral corporate cards for workspace booking expenses with automatic OCR receipt reconciliation (
/api/finance/card). - Nomad Tax Residency Geo-Fence & ZK Ledger: Automated tracking of border crossings and physical presence duration with zero-knowledge cryptographic proof generation (
/analytics/nomad-tax). - JSON & CSV Tax Export: Download complete tax records, workspace rental deductions, and business expense summaries formatted for international digital nomad audits (
/api/bookings/export).
- Dynamic Acoustic Privacy Jammer: WebAssembly DSP ring buffer applying Delayed Auditory Feedback (DAF) to headphones, scientifically disrupting loud speech and maintaining private conversations in open cafes (
/api/audio/jammer). - AI Generative Venue Vibe Audio Synthesizer: Procedural acoustic soundscapes and focus-frequency noise generation tailored in real-time to current venue ambient noise telemetry (
/api/audio/vibe). - Spatial RT60 Reverberation Analyzer: In-browser acoustic impulse measurement calculating venue echo decay time (RT60) to grade conference call suitability (
/api/venues/acoustics/rt60). - Keyboard Acoustic Emanation Shield: Client-side acoustic masking preventing microphone-based keystroke eavesdropping in public coworking lounges (
/api/security/acoustic).
- WebXR SLAM Venue Scanner & Voxel Octree: Camera-based spatial mapping for desk geometry, power outlet coordinates, and indoor navigation paths (
/ar/finder). - Real-Time 3D Desk Ergonomics & ISO Validator: WebGL 3D avatar posture analysis evaluating chair height, screen angle, and ambient lighting against ISO 9241 standards (
/wellness/ergonomics). - Automated Audio-Description Spatial Scene Graph: Real-time accessibility engine converting venue visual layout into navigable spatial audio narration for visually impaired professionals (
/api/accessibility/scene). - Team Proximity Haptic Feedback & Spatial Anchoring: Physical team proximity alerts using Gamepad/Web Haptics API and spatial beacon tags (
/api/ar/anchors).
- Workspace Digital Twin HVAC & Air Quality Purge: Live CO2, TVOC, and PM2.5 monitoring triggering automated ventilation requests and threshold breach alerts (
/api/twin/airquality). - Cafe Power Grid Load Forecasting & Breaker Trip Predictor: Wattage monitoring preventing sudden cafe circuit breaker trips (
/venues/power-grid). - Multi-Sensory Focus Environment IoT Controller: Smart lighting (circadian CCT), desk height, and acoustic masking control via Matter / HomeKit / Zigbee bridges (
/api/iot/orchestrate). - ASHRAE Standard 55 Thermal Comfort Index: Predicted Mean Vote (PMV) and Predicted Percentage Dissatisfied (PPD) computed live from ambient temperature and relative humidity sensors.
- Distributed Compute-Burst WebRTC Mesh: Collaborative local distributed computing offloading code builds and heavy processing across idle laptops on cafe WiFi (
/p2p/mesh-collab,/api/compute/burst). - Offline-First P2P Emergency Mesh Network: WebRTC DataChannels + Bluetooth Low Energy (BLE) peer discovery maintaining critical comms during cafe ISP outages (
/api/network/survival). - Offline Medical Emergency Mesh Beacon & First-Aid Router: Instant SOS broadcasting and automated navigation to the nearest automated external defibrillator (AED) and medical kit (
/api/medical/beacon). - Bandwidth-Hog Identification & Cooperative QoS: Local network cooperative monitoring to detect and throttle background stream hogs on public WiFi (
/api/network/qos).
- Flight-Delay Itinerary Auto-Rerouting: Webhook integration with aviation feeds automatically rescheduling booked coworking passes when flights are delayed or cancelled (
/api/travel/reroute). - Git Merge Conflict Physical War Room & IoT Lockdown: Automatic physical meeting room booking and IoT access lockdown during critical deployment conflicts (
/api/collab/warroom). - Decentralized Nomad Housing Swap & Smart-Contract Lease Ledger: Peer-to-peer apartment and studio exchange protocol backed by decentralized identity and reputation scores (
/api/housing/swap). - Distributed Luggage Storage P2P Trust & IoT Locker Protocol: Secure short-term storage locker management with cryptographic token keys and BLE unlock (
/peripherals/locker,/api/luggage/store). - Micro-Climate Pedestrian Routing & Wind-Tunnel Risk Engine: OSRM routing enriched with real-time micrometeorology, sheltering laptops from rain squalls and wind tunnels (
/api/routing/microclimate). - Predictive Cafe Inventory Restocking Engine: Real-time oat milk, specialty bean, and pastry stock forecasting based on check-in velocity (
/venues/cafe-order,/api/inventory/restock).
- Decentralized DID Wallet & ZK-Age / Identity Verification: Verify KYC and identity requirements without disclosing personal identity documents (
/test-student-zkp,/api/identity/verify). - Client-Side PII Redaction & Document Sanitization Pipeline: In-browser regex and NER model scrubbing sensitive credentials, emails, and phone numbers before cloud transmission (
/api/documents/sanitize). - AI-Powered Legal & NDA Redline Assistant: In-browser automated contract analysis, clause risk scoring, and interactive redlining before booking commercial spaces (
/api/legal/redline). - Cryptographic Proof-of-Deep-Work Ledger with ZK-SNARKs: Verifiable proof of undistracted deep-work time for client billing without surveillance (
/api/zkp/deepwork). - ECDH P-256 + AES-GCM 256 End-to-End Encrypted (E2EE) Chat & SPKI Key Pinning: Zero-knowledge team communication with SPKI SHA-256 Certificate Public Key Pinning (
/api/auth/passkey/*). - Audit Log SHA-256 Merkle Tree Verification: Tamper-evident immutable audit log endpoint (
/api/admin/audit/verify).
WorkSphere brings together geospatial data, ambient intelligence, and real-time collaboration into a unified, responsive interface:
| Capability | Experience | Technical Highlight |
|---|---|---|
| ๐บ๏ธ Interactive Geospatial Map | Dynamic CartoDB Dark Matter tiles with color-coded venue noise markers (green=quiet, amber=moderate, red=busy). | Real road routing with OSRM, Haversine proximity, custom Clerk user pins. |
| ๐ค Autonomous Multi-Agent AI | Conversational discovery agent that reasons across amenities, seating availability, and workspace preferences. | 5-agent pipeline (Orchestrator โ Context โ Data โ Reasoning โ Action) with transparent thought telemetry. |
| ๐ก Live Presence & Telemetry | Real-time seat occupancy badges (Quiet, Moderate, Busy) and collaborative workspace notes. | Sub-50ms WebSocket synchronization powered by PartyKit mesh network. |
| ๐ณ Solana Pay & Smart Escrow | One-click crypto micro-payments, QR scan with Wake Lock, and deep-work bounty escrow payouts. | Real-time Solana RPC verification, anti-spoofing transaction filters, smart contract escrow. |
| ๐ง WASM DSP Acoustic Privacy | Speech jamming with Delayed Auditory Feedback (DAF) preventing loud calls in public cafes. | WebAudio AudioWorklet + WebAssembly C ring buffer for ultra-low latency audio processing. |
| ๐ WebXR SLAM Spatial Scanner | Augmented Reality indoor desk finder, power outlet locator, and millimeter-level wayfinding. | WebXR Device API, point cloud voxelization, and SLAM visual-inertial odometry. |
| ๐ข Digital Twin HVAC & Air Purge | Automated indoor environmental air quality purge alerts and smart ventilation orchestration. | Real-time CO2/PM2.5 IoT telemetry with threshold anomaly detection and BACnet/MQTT bridge. |
| ๐ Distributed WebRTC Compute Mesh | Offload heavy compile and test workloads onto idle peer machines connected to the same cafe WiFi. | WebRTC DataChannels, P2P work stealing algorithm, and distributed task chunking. |
| ๐ Battery Panic Mode | Automatically re-ranks search results when battery drops below 20%, prioritizing verified desk outlets. | Web Battery API integration with graceful degradation on non-supported viewports. |
| ๐ด Offline-First Survival PWA | Browse cached venues, floor plans, and queue check-ins completely offline via mesh networking. | Service Worker background sync + IndexedDB storage + Web Locks API synchronization. |
| ๐งพ Cryptographic PDF Invoicing | Instant one-click PDF receipts with HMAC-SHA256 signatures generated for verified bookings. | 100% serverless, zero-filesystem execution via pdf-lib with embedded Helvetica glyphs. |
| ๐ Zero-Knowledge Identity & Perks | Claim verified student discounts and KYC clearance without revealing personal identification documents. | Client-side WASM ZKP proof generation with offline localStorage verification caching. |
| Auto-reschedule bookings upon flight delays and lock down physical war rooms on merge conflicts. | Aviation webhook feeds, automated calendar rebalancing, and IoT smart-lock triggers. | |
| ๐ก๏ธ Edge PII Redaction & E2EE | Client-side redaction of sensitive credentials and documents before leaving the local browser. | Zero-knowledge ECDH P-256 + AES-GCM 256 encryption with SPKI SHA-256 public key pinning. |
| Category | Technology |
|---|---|
| Framework | Next.js 15.5 (App Router with Server Components & Server Actions) |
| Language | TypeScript 5.0 |
| Styling | Tailwind CSS 4.0, Radix UI Primitives, Lucide Icons |
| AI / Multi-Agent | Groq SDK (Llama 3.3 70B Versatile), In-Browser Intent Orchestrator |
| Database | Neon Serverless PostgreSQL + Prisma 7.2 ORM (with @prisma/adapter-pg) |
| Authentication | Clerk (JWTs, Webhook Sync, Passkeys & WebAuthn) |
| Web3 & FinTech | Solana Web3.js, Solana Pay Protocol, Smart Contract Escrows |
| Edge Audio / DSP | WebAssembly (WASM C DSP), AudioWorklet API, Web Audio Oscillators |
| Spatial & AR | WebXR Device API, Three.js / WebGL, Voxel Octrees |
| Maps & Routing | React Leaflet, OpenStreetMap, OSRM Road Machine, CartoDB Dark Matter |
| Real-time & P2P | PartyKit WebSockets, Server-Sent Events (SSE), WebRTC DataChannels |
| Digital Twin / IoT | Matter / HomeKit Bridge, MQTT Telemetry, Web Bluetooth Low Energy (BLE) |
| Cryptography / ZKP | Web Crypto API (SubtleCrypto HMAC-SHA256), WASM ZK-SNARKs (SnarkJS) |
| PDF Generation | pdf-lib 2.x (Zero-filesystem serverless execution) |
| Testing | Jest 29, React Testing Library, Playwright E2E (838+ test suites) |
| PWA & Offline | Service Workers, IndexedDB, Background Sync API, Web Locks API |
| Deployment | Vercel (Edge & Serverless Functions) |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ USER INTERFACE โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Map (70%) โ โ Chat (30%) โ โ
โ โ - Venue Markers โ โ - Natural Language Input โ โ
โ โ - User Location โ โ - Agent Transparency โ โ
โ โ - Route Polylines โ โ - Venue Cards โ โ
โ โ - Auto-centering โ โ - Action Buttons โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MULTI-AGENT PIPELINE โ
โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Orchestrator โ -> โ Context โ -> โ Data โ โ
โ โ Agent โ โ Agent โ โ Agent โ โ
โ โ โ โ โ โ โ โ
โ โ Routes query โ โ Extracts โ โ Fetches โ โ
โ โ to agents โ โ intent & โ โ venues via โ โ
โ โ โ โ parameters โ โ Overpass API โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Action โ <- โ Reasoning โ โ
โ โ Agent โ โ Agent โ โ
โ โ โ โ โ โ
โ โ Updates UI, โ โ Scores & โ โ
โ โ map, chat โ โ ranks venues โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DATA LAYER โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โ
โ โ Neon Postgres โ โ OpenStreetMap โ โ Clerk โ โ
โ โ โ โ โ โ โ โ
โ โ - Users โ โ - Overpass API โ โ - Auth โ โ
โ โ - Venues โ โ - Cafes โ โ - User Sync โ โ
โ โ - Ratings โ โ - Libraries โ โ - Sessions โ โ
โ โ - Favorites โ โ - Coworking โ โ โ โ
โ โ - Conversations โ โ โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Pexels API โ โ OSRM API โ โ
โ โ โ โ โ โ
โ โ - Venue Photos โ โ - Road Routing โ โ
โ โ - 20k/mo FREE โ โ - Polylines โ โ
โ โ - Server Proxy โ โ - FREE โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Node.js 20+ (Node.js 20 LTS or Node.js 22 LTS recommended)
- npm or yarn
- Git
- Docker and Docker Compose (Optional, but highly recommended for local Postgres & Redis)
-
Clone the repository
git clone https://github.com/SatyamPandey-07/WorkSphere.git cd WorkSphere -
Install dependencies
npm install
-
Choose your environment setup path:
This starts a local PostgreSQL instance (with the
pgvectorextension) and Redis automatically.# Start database and Redis container services docker compose up -d # Copy local environment example cp .env.example .env.local # Fill out any missing external API keys in .env.local (e.g. Clerk, Groq)
If you prefer not to use Docker:
- Setup a PostgreSQL 15+ database with the
pgvectorextension enabled. - Optionally setup an Upstash Redis database.
- Copy environment config and fill in Neon and Upstash URLs:
cp .env.example .env.local
- Setup a PostgreSQL 15+ database with the
-
Initialize Database Schema
npx prisma generate npx prisma db push
-
Run the development server
npm run dev
-
Open in browser
http://localhost:3000
New contributors commonly run into a few setup hurdles when configuring their local environment. Here are the most frequent issues and their quick fixes:
Symptom:
PrismaClientInitializationError: Can't reach database server at `localhost:5432`
Please make sure your database server is running at `localhost:5432`.
or
The table `public.Venue` does not exist in the current database.
Root Causes & Solutions:
- Container not started: If using Docker Compose, ensure the PostgreSQL and Redis containers are actively running:
docker compose ps docker compose up -d
- Prisma Schema not pushed: If the database exists but tables or columns are missing, synchronize the schema:
npx prisma generate npx prisma db push
- Seeding sample data: To populate local venues and amenities:
npm run postinstall node prisma/seed.js
Symptom:
error: Unsupported engine. The engine "node" is incompatible with this module.
Expected version ">=20.0.0". Got "v18.19.0".
or syntax errors involving modern TypeScript experimental strip types, ECMAScript modules, or WebAssembly SIMD loaders.
Root Causes & Solutions:
- WorkSphere leverages Node.js 20+ runtime features (experimental type stripping, native fetch optimizations, and ES2024 features).
- Check your current Node.js version:
node -v
- If your version is lower than
v20.0.0, update via nvm (macOS/Linux) or nvm-windows:# Install and switch to Node.js 20 or 22 LTS nvm install 20 nvm use 20
Symptom:
Error: Cannot find module 'next/dist/server/...'
or hydration mismatch errors, stale chunk load errors, or webpack compilation failures after pulling major upstream changes.
Root Causes & Solutions:
-
Next.js caches compiled pages and webpack artifacts in
.next/. When branch switching or updating dependencies, the cache can become invalid. -
Clear the Next.js build cache and reinstall dependencies cleanly:
On macOS / Linux / Git Bash:
rm -rf .next npm run dev
On Windows PowerShell:
Remove-Item -Recurse -Force .next npm run dev
-
If you encounter native module mismatches:
# Deep clean rm -rf .next node_modules package-lock.json npm install npx prisma generate npm run dev
Symptom:
Error: Missing environment variable: DATABASE_URL
or authentication redirection loops with Clerk, or map tile loading failures.
Root Causes & Solutions:
- Next.js requires
.env.localfor local secrets. Ensure you copied.env.example:cp .env.example .env.local
- Verify the following essential keys in
.env.local:# Local Docker Postgres (default) DATABASE_URL="postgresql://postgres:postgres@localhost:5432/worksphere?schema=public" DIRECT_URL="postgresql://postgres:postgres@localhost:5432/worksphere?schema=public" # Upstash Redis (Optional for rate limiting; mock fallback exists) UPSTASH_REDIS_REST_URL="http://localhost:8079" UPSTASH_REDIS_REST_TOKEN="example_token" # App Base URL NEXT_PUBLIC_APP_URL="http://localhost:3000"
- Restart
npm run devafter updating.env.localto allow Next.js to reload environment variables.
npm testnpm run test:watchnpm run test:e2e
npm run test:e2e:ui # With UIFor a full guide on writing, running, and debugging Playwright tests, see docs/PLAYWRIGHT_TESTING_GUIDE.md.
- 57 Unit Tests covering:
- API Route Handlers
- React Components
- Utility Functions
- Rate Limiting
- Analytics
Create a .env.local file in the root directory by copying the template:
cp .env.example .env.localFill in the following values. Variables marked (required) must be set for the app to start; (optional) ones have local fallbacks.
# โโ Database โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# (required) Neon PostgreSQL connection string โ get from neon.tech
DATABASE_URL="postgresql://user:password@host/database?sslmode=require"
# โโ Authentication โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# (required) Clerk keys โ get from clerk.com > your app > API keys
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
# โโ AI โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# (required) Groq API key โ free at console.groq.com
GROQ_API_KEY=gsk_...
# (optional) Gemini API key โ used for server-side venue summaries
GEMINI_API_KEY=your_gemini_key_here
# โโ Venue Photos โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# (optional) Pexels API key โ falls back to placeholder images
PEXELS_API_KEY=your_pexels_key_here
# โโ Rate Limiting โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# (optional) Upstash Redis โ falls back to in-memory rate limiter
UPSTASH_REDIS_REST_URL=https://your-upstash-redis-endpoint.upstash.io
UPSTASH_REDIS_REST_TOKEN=your-upstash-redis-tokenFull reference: See
docs/ENV_VARS.mdfor a complete list of every variable with detailed descriptions.
You can obtain the Upstash Redis credentials from your Upstash Redis database dashboard.
The Upstash Redis variables are optional for local development. If UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN are omitted, the application falls back to an in-memory rate limiter. This allows the application to run locally without an Upstash Redis configuration, but rate-limit state is stored only in the local application memory and is not shared across multiple instances or processes.
For production or multi-instance deployments, configuring Upstash Redis is recommended to ensure consistent rate limiting across application instances.
| Service | URL | Free Tier | Required |
|---|---|---|---|
| Neon | neon.tech | 0.5GB storage | โ Yes |
| Clerk | clerk.com | 10,000 MAU | โ Yes |
| Groq | console.groq.com | Free API access | โ Yes |
| Pexels | pexels.com/api | 20,000 req/month | โ No (has fallback) |
| OSM/OSRM | N/A | Unlimited | โ No (public API) |
| Category | Route | Page | Description |
|---|---|---|---|
| Core AI & Maps | / |
Landing Page | Hero section with product showcase, community stats, and CTAs |
/ai |
AI Workspace Finder | Dual-pane 70/30 interactive CartoDB map & multi-agent reasoning chat | |
/ai/concierge |
AI Concierge | Natural-language concierge for itinerary planning & seat reservations | |
/workspace |
Workspace Suite | Multi-window workspace manager with persistent layout state | |
/compare |
Venue Comparison | Side-by-side metric matrix comparison across multiple venues | |
| Social & Collaboration | /social |
Nomad Community Hub | Local digital nomad community feeds, check-ins, and networking |
/social/focus-room |
Virtual Focus Rooms | Collaborative Pomodoro sessions with synchronized willpower gauges | |
/social/meet-halfway |
Meet Halfway Engine | Geospatial midpoint calculator for distributed team meetings | |
/social/skill-exchange |
Skill Barter Hub | Web-of-trust peer-to-peer knowledge and skill exchange | |
/bundles/work-hop |
Work-Hop Pass | Multi-venue pass bundle purchasing and check-in scanner | |
| Web3 & FinTech | /pay/crypto-micro |
Solana Pay Portal | Dynamic QR-code crypto micropayment terminal with Wake Lock |
/pay/split/[token] |
Bill Splitting Hub | Multi-party workspace booking bill split and settlement | |
/peripherals/locker |
Smart IoT Locker Grid | Decentralized luggage & equipment locker rental protocol | |
| Spatial & Hardware | /ar/finder |
WebXR AR Wayfinding | Augmented Reality SLAM indoor desk & outlet finder |
/wellness/ergonomics |
3D Desk Ergonomics | Real-time WebGL 3D avatar posture analysis & ISO 9241 evaluation | |
/venues/sound-gradient |
Acoustic Heatmap | Real-time spatial sound level gradient and noise contour map | |
/venues/power-grid |
Power Grid Monitor | Real-time cafe electrical load forecasting & breaker trip alert | |
/venues/solar-finder |
Solar Glare & Sun Calc | Solar angle & natural daylight tracking for glare-free outdoor desks | |
| Analytics & Nomad Compliance | /analytics |
Telemetry Dashboard | Venue network latency, noise history, and occupancy analytics |
/analytics/nomad-tax |
Nomad Tax & Border Ledger | Zero-knowledge border crossing ledger and tax residency tracker | |
/analytics/carbon |
Carbon Footprint Tracker | Commute and workspace energy consumption offset calculator | |
/analytics/noise-forecasting |
Predictive Noise Engine | Prophet-based forecasting for future crowd and decibel levels | |
| User & Administration | /dashboard |
User Neural Ledger | Personal dashboard, confirmed bookings, and cryptographic receipts |
/dashboard/webhooks |
Webhook Integrations | Developer webhook endpoint management and event delivery logs | |
/user-profile/passport |
Nomad Digital Passport | Verifiable credential badges, check-in history, and POAPs | |
/admin/system |
Admin System Diagnostics | Partition maintenance, DB health, and memory telemetry | |
/admin/performance |
Core Web Vitals Monitor | Real-time server latency, TTFB, and route latency heatmaps | |
/offline |
Offline Survival Mode | Offline-first PWA fallback with cached venues and queue sync | |
/sign-in |
Sign In | Clerk authentication sign-in portal | |
/sign-up |
Sign Up | Clerk authentication sign-up portal |
WorkSphere features a modular API architecture organized across specialized subsystems:
| Subsystem | Key Endpoints | Description |
|---|---|---|
| ๐ค Multi-Agent AI | /api/chat/api/ai/concierge/api/legal/redline/api/scheduling/pod |
Multi-agent reasoning pipeline, legal NDA redlining, and meeting pod optimization |
| ๐ง WASM Audio & DSP | /api/audio/jammer/api/audio/vibe/api/venues/acoustics/rt60/api/security/acoustic |
DAF speech jamming, AI ambient soundscapes, RT60 spatial acoustics, and acoustic masking |
| ๐ณ Web3 & Payments | /api/payments/solana/*/api/bounties/payout/api/bookings/escrow/api/finance/card |
Solana Pay RPC verification, focus bounties escrow, and virtual card issuance |
| ๐ Spatial & WebXR | /api/venues/slam/api/ar/anchors/api/accessibility/scene/api/spatial/beacons |
SLAM voxel octree, AR anchors, audio-described spatial scene graphs, and team proximity |
| ๐ข Digital Twin & IoT | /api/twin/airquality/api/venues/powergrid/api/iot/orchestrate/api/wellness/ergonomics |
HVAC air purge orchestrator, cafe breaker trip prediction, Matter IoT bridges, and ergonomics |
| ๐ Mesh & Survival | /api/compute/burst/api/network/survival/api/medical/beacon/api/network/qos |
WebRTC distributed compute mesh, offline P2P emergency network, and medical beacon |
| ๐ก๏ธ ZKP & Security | /api/auth/zkp/nomad-proof/api/identity/verify/api/documents/sanitize/api/zkp/deepwork |
Zero-knowledge identity proofs, client-side PII sanitization, and proof-of-deep-work |
| ๐บ๏ธ Venues & Routing | /api/venues/api/venues/enrich/api/routing/microclimate/api/travel/reroute |
Venue search & OSM enrichment, micro-climate weather routing, and flight-delay rerouting |
| ๐งพ Bookings & Receipts | /api/bookings/api/bookings/[id]/download/api/tax/nomad-compliance/api/bookings/export |
Serverless PDF receipt generation with HMAC-SHA256 signatures and JSON/CSV tax exports |
| ๐ Admin & Diagnostics | /api/admin/audit/verify/api/admin/performance/api/admin/system/latency-heatmap |
SHA-256 Merkle tree verification, route latency canvas heatmaps, and system diagnostics |
User Query: "Find a quiet cafe with WiFi near me"
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ORCHESTRATOR AGENT โ
โ โข Analyzes query type โ
โ โข Determines: Context โ Data โ Reasoning โ
โ โข Output: agentsToUse[], reasoning โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CONTEXT AGENT โ
โ โข Extracts intent: workType = "focus" โ
โ โข Parameters: amenities = [wifi, quiet] โ
โ โข Output: structured intent object โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DATA AGENT โ
โ โข Queries Overpass API for cafes โ
โ โข Filters by location radius โ
โ โข Output: venues[], conditions, meta โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ REASONING AGENT โ
โ โข Scores: WiFi(30%), Noise(25%), โ
โ Outlets(20%), Rating(15%), Distance(10%) โ
โ โข Ranks top venues with explanations โ
โ โข Output: rankedVenues[], reasoning โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ACTION AGENT โ
โ โข Updates map markers โ
โ โข Sets map view/zoom โ
โ โข Generates chat response โ
โ โข Output: UI updates, message โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The UI shows each agent's contribution:
๐ง Agent Pipeline (5 steps)
โโ ๐ฏ Orchestrator: Routing to Context, Data, Reasoning agents
โโ ๐ Context: Extracted intent - focus work, needs WiFi
โโ ๐ Data: Found 12 cafes within 2km radius
โโ ๐ก Reasoning: Top pick - Blue Bottle Coffee (score: 8.5/10)
โโ โก Action: Updated map with 5 markers
The venue summary endpoint sends its prompt to Gemini rather than the chat models. See docs/GEMINI_INTEGRATION.md for the client contract, model choice, error handling, and test setup.
The repository is a Next.js monorepo. Below is the top-level layout followed by a plain-English description of every major directory.
worksphere/
โโโ prisma/ # Database schema, migrations, and seed script
โโโ party/ # PartyKit real-time collaboration server
โโโ docs/ # Extended developer guides and reference docs
โโโ e2e/ # Playwright end-to-end tests
โโโ public/ # Static assets: PWA manifest, service worker, icons
โโโ scripts/ # Build and utility scripts
โโโ src/
โ โโโ __tests__/ # Jest unit and integration tests
โ โ โโโ api/ # API route tests
โ โ โโโ components/ # Component tests
โ โ โโโ lib/ # Utility tests
โ โโโ app/ # Next.js App Router pages, layouts, and API routes
โ โ โโโ api/ # API route handlers
โ โ โ โโโ chat/ # Multi-agent pipeline endpoint
โ โ โ โโโ venues/ # Venue CRUD + OSM/Pexels enrichment
โ โ โ โโโ favorites/ # User favorites
โ โ โ โโโ conversations/ # Chat history
โ โ โโโ ai/ # Main workspace-finder page
โ โ โโโ dashboard/ # User profile and booking dashboard
โ โ โโโ sign-in/ # Clerk authentication pages
โ โ โโโ sign-up/
โ โ โโโ offline/ # PWA offline fallback
โ โ โโโ layout.tsx # Root layout and global providers
โ โโโ components/ # Reusable React UI components
โ โ โโโ ai-elements/ # Agent-transparency and AI-specific UI pieces
โ โ โโโ ui/ # General design-system components
โ โโโ context/ # React context providers for global client state
โ โโโ core/ # Core business logic and domain services
โ โโโ hooks/ # Custom React hooks (PWA, real-time, speech)
โ โโโ lib/ # Shared utilities, database client, rate limiting, analytics
โ โโโ locales/ # Internationalisation (i18n) string files
โ โโโ shaders/ # WebGL/GLSL shader source files
โ โโโ types/ # Shared TypeScript type definitions
โ โโโ utils/ # General-purpose helper functions
โ โโโ wasm/ # WebAssembly modules used in the browser
โ โโโ worker/ # Service worker and background-sync logic
โ โโโ workers/ # Additional web worker scripts
โโโ jest.config.js # Jest configuration
โโโ playwright.config.ts # Playwright configuration
โโโ package.json
| Directory | What it contains |
|---|---|
prisma/ |
schema.prisma (data model), auto-generated migrations, and a seed script for local development |
party/ |
PartyKit server (server.ts, multiRegionServer.ts) that powers real-time collaborative features via WebSockets |
docs/ |
Hundreds of developer-facing guides covering architecture, testing, deployment, security, and more |
e2e/ |
Playwright end-to-end test suites for full browser flows |
public/ |
Static files served directly: service worker (sw.js), PWA manifest, and app icons |
scripts/ |
One-off and CI utility scripts (database seeding, asset generation, etc.) |
src/app/ |
Next.js 15 App Router โ every page, layout, and API route handler lives here |
src/components/ |
Reusable React components: map, chatbot, venue cards, rating dialog, error boundary, and design-system primitives |
src/context/ |
React context providers that share global state (currency, events, etc.) across the component tree |
src/core/ |
Framework-agnostic business logic and domain services, kept separate from Next.js specifics |
src/hooks/ |
Custom React hooks: usePWA, useRealTime (SSE), and useSpeechRecognition |
src/lib/ |
Shared back-end helpers: Prisma client, Zod validation schemas, rate limiter, analytics, OSM/Pexels integration, and OSRM routing |
src/locales/ |
Translation JSON files used by the i18n layer |
src/shaders/ |
GLSL/WebGL shader programs for any GPU-accelerated rendering |
src/types/ |
Project-wide TypeScript interfaces and enums |
src/utils/ |
Lightweight, stateless helper functions shared across the codebase |
src/wasm/ |
Compiled WebAssembly modules (e.g. FFT, noise filtering, SQLite FTS) |
src/worker/ |
Service worker source and offline/background-sync logic |
src/workers/ |
Additional dedicated web worker scripts (heavy computation off the main thread) |
src/__tests__/ |
Unit and integration tests mirroring the src/ directory layout |
- Open the app at
http://localhost:3000 - Allow location access when prompted
- Start chatting with the AI assistant!
Try these natural language queries:
- "Find a quiet cafe with good WiFi near me"
- "Show me coworking spaces within 2km"
- "I need a library to study"
- Open the app in Chrome or Edge
- Click the microphone icon in the chat input bar
- Allow microphone permission when prompted
- Speak your query โ it will populate the text input automatically
- Click Send or press Enter to submit
Testing the unsupported-browser warning (Firefox Nightly / DevTools simulation):
- Open Chrome DevTools (
F12) โ Console tab - Paste:
delete window.SpeechRecognition; delete window.webkitSpeechRecognition; - Reload the page
- The mic button will appear dimmed/greyed out
- Click it โ an amber warning banner appears explaining the limitation
- Sign in with Clerk
- Click heart icon on venue cards to favorite
- Click "Rate" to submit ratings
- Desktop: Click install icon in browser
- Mobile: "Add to Home Screen"
- Push to GitHub
- Connect repository to Vercel
- Add environment variables
- Deploy!
| Priority | Feature | Description |
|---|---|---|
| ๐ด High | Analytics Dashboard | Admin page to view search patterns, popular venues, user metrics |
| ๐ก Medium | Mobile App | React Native version sharing the same API backend |
| ๐ก Medium | AI Memory | Cross-conversation learning for personalized recommendations |
| ๐ก Medium | Social Features | Share favorite workspaces, follow other remote workers |
| ๐ข Low | Booking Integration | Reserve desks at coworking spaces via API |
| ๐ข Low | Noise Level API | Real-time noise monitoring hardware integration |
Contributions are warmly welcomed! We aim to make contributing as smooth and rewarding as possible.
- Find an Issue: Explore our Open Issues.
- Claim with
/claim: Drop a comment containing/claimon any unassigned issue. The automation will assign it to you instantly!- You can hold up to 10 active assigned issues at once.
- Recommended completion window is 6 days.
- Release with
/unclaim: If you need to step away from an issue, simply comment/unclaimto release it for other contributors. - Auto-Merge on PR: Include
Closes #<issue_number>in your PR description. When opened, CI checks the issue link and automatically squash-merges your PR with co-author credit!
Please refer to our Contributing Guide and Code of Conduct.
This project is licensed under the MIT License.
Satyam Pandey
- GitHub: @SatyamPandey-07
โญ Star this repo if you find it helpful!
Made with โค๏ธ by Satyam Pandey

