The real-time, location-aware watercooler for local professional networking.
Features β’ Architecture β’ Getting Started β’ Folder Structure β’ Design Philosophy β’ Troubleshooting
IntelliCircle is a modern, real-time networking and chat application designed to digitally map users to hyper-localized professional groups. We remove the friction of traditional networking by providing spontaneous, hyper-local chat environments. IntelliCircle calculates physical proximity to instantly drop users into curated professional hubs based entirely on shared interests.
While platforms like LinkedIn serve as a global, asynchronous resume repository, IntelliCircle serves as the synchronous, location-aware watercooler. Stop swiping. Start meeting.
- π Location-Based Discovery: Automatically detects your city and calculates real-time distances to active chat rooms using
PostGISnative geospatial indexes. - β‘ Ultra-Low Latency Messaging: Sub-50ms native WebSocket broadcasting powered by
wsand scaled horizontally viaRedis Pub/Sub. - π― Frictionless Zero-Click Entry: Users can join local rooms immediately with temporary aliases. No lengthy signup walls required.
- π€ AI-Powered Context: Integrates with Google Gemini Flash 2.5 (via
BullMQbackground jobs) to automatically summarize missed conversations in active rooms. - π Enterprise-Grade Security: Fully asymmetric JWT authentication (RS256),
Zodpayload validation across the entire stack, CSRF protection, and strict rate limiting.
IntelliCircle leverages a cutting-edge decoupled Client-Server architecture utilizing an npm Workspaces Monorepo. This allows for strict type-sharing while maintaining isolated execution environments.
Built for SEO, speed, and seamless UX.
- Framework: Next.js 14 (App Router)
- UI & Styling: Tailwind CSS, Shadcn UI, and highly-optimized Framer Motion micro-interactions.
- State Management: Zustand (Client Global State) + TanStack Query/React Query (Server State).
- Infinite Scrolling:
react-virtuosofor rendering massive chat logs without frame drops.
High-throughput, real-time processing engine.
- Framework: Fastify for maximum JSON parsing speed.
- WebSockets:
@fastify/websocketbinding native Node.jswsto the HTTP instance. - Queue System:
BullMQ(Redis) for heavy async jobs (Email dispatch, AI Summarization). - AI Integration:
@google/generative-aifor intelligent room summaries.
- Primary Database: PostgreSQL with the PostGIS extension for
ST_DWithinspatial queries. - ORM: Drizzle ORM, the fastest TypeScript ORM available.
- Broker & Caching: Redis (Upstash) serving as the WebSocket Pub/Sub backplane, rate-limit store, and job queue.
- Zod: Ensures type safety across the network boundary, strictly typing DB schemas, WS payloads, and REST APIs.
IntelliCircle/
βββ legacy
β βββ client
β β βββ index.html
β β βββ src
β β βββ App.tsx
β β βββ components
β β β βββ ui
β β β β βββ accordion.tsx
β β β β βββ alert-dialog.tsx
β β β β βββ alert.tsx
β β β β βββ aspect-ratio.tsx
β β β β βββ avatar.tsx
β β β β βββ badge.tsx
β β β β βββ breadcrumb.tsx
β β β β βββ button.tsx
β β β β βββ calendar.tsx
β β β β βββ card.tsx
β β β β βββ carousel.tsx
β β β β βββ chart.tsx
β β β β βββ checkbox.tsx
β β β β βββ collapsible.tsx
β β β β βββ command.tsx
β β β β βββ context-menu.tsx
β β β β βββ dialog.tsx
β β β β βββ drawer.tsx
β β β β βββ dropdown-menu.tsx
β β β β βββ form.tsx
β β β β βββ hover-card.tsx
β β β β βββ input-otp.tsx
β β β β βββ input.tsx
β β β β βββ label.tsx
β β β β βββ menubar.tsx
β β β β βββ navigation-menu.tsx
β β β β βββ pagination.tsx
β β β β βββ popover.tsx
β β β β βββ progress.tsx
β β β β βββ radio-group.tsx
β β β β βββ resizable.tsx
β β β β βββ scroll-area.tsx
β β β β βββ select.tsx
β β β β βββ separator.tsx
β β β β βββ sheet.tsx
β β β β βββ sidebar.tsx
β β β β βββ skeleton.tsx
β β β β βββ slider.tsx
β β β β βββ switch.tsx
β β β β βββ table.tsx
β β β β βββ tabs.tsx
β β β β βββ textarea.tsx
β β β β βββ toast.tsx
β β β β βββ toaster.tsx
β β β β βββ toggle-group.tsx
β β β β βββ toggle.tsx
β β β β βββ tooltip.tsx
β β β βββ waitlist-form.tsx
β β βββ hooks
β β β βββ use-mobile.tsx
β β β βββ use-toast.ts
β β βββ index.css
β β βββ lib
β β β βββ queryClient.ts
β β β βββ utils.ts
β β βββ main.tsx
β β βββ pages
β β βββ chat.tsx
β β βββ discover.tsx
β β βββ home.tsx
β β βββ not-found.tsx
β β βββ profile.tsx
β βββ server
β β βββ db.ts
β β βββ index.ts
β β βββ routes.ts
β β βββ storage.ts
β β βββ vite.ts
β βββ shared
β βββ schema.ts
βββ packages
β βββ client
β β βββ lint.log
β β βββ next-env.d.ts
β β βββ next.config.mjs
β β βββ package.json
β β βββ postcss.config.js
β β βββ src
β β β βββ app
β β β β βββ (app)
β β β β β βββ chat
β β β β β β βββ [id]
β β β β β β β βββ page.tsx
β β β β β β βββ page.tsx
β β β β β βββ dashboard
β β β β β β βββ page.tsx
β β β β β βββ discover
β β β β β β βββ page.tsx
β β β β β βββ profile
β β β β β βββ page.tsx
β β β β βββ (marketing)
β β β β β βββ about
β β β β β β βββ page.tsx
β β β β β βββ contact
β β β β β β βββ page.tsx
β β β β β βββ privacy
β β β β β β βββ page.tsx
β β β β β βββ terms
β β β β β β βββ page.tsx
β β β β β βββ waitlist
β β β β β βββ page.tsx
β β β β βββ auth
β β β β β βββ page.tsx
β β β β βββ globals.css
β β β β βββ layout.tsx
β β β β βββ not-found.tsx
β β β β βββ page.tsx
β β β βββ components
β β β β βββ CreateRoomModal.tsx
β β β β βββ auth-modal.tsx
β β β β βββ footer.tsx
β β β β βββ header.tsx
β β β β βββ mobile-drawer.tsx
β β β β βββ page-transition.tsx
β β β β βββ posthog-provider.tsx
β β β β βββ providers.tsx
β β β β βββ upgrade-modal.tsx
β β β βββ hooks
β β β β βββ useGeolocation.ts
β β β β βββ useSocket.ts
β β β βββ lib
β β β β βββ api.ts
β β β β βββ utils.ts
β β β βββ middleware.ts
β β β βββ store
β β β βββ authStore.ts
β β β βββ index.ts
β β βββ tailwind.config.ts
β β βββ tsconfig.json
β β βββ tsconfig.tsbuildinfo
β β βββ typescript-errors.log
β βββ server
β β βββ .env
β β βββ .env.keys
β β βββ Dockerfile
β β βββ check-logs.ts
β β βββ check_db.ts
β β βββ drizzle.config.ts
β β βββ inject_nearby.txt
β β βββ inject_nearby_fixed.txt
β β βββ inject_out.txt
β β βββ migrations
β β β βββ 0000_fantastic_shriek.sql
β β β βββ 0001_youthful_ser_duncan.sql
β β β βββ 0002_steady_xavin.sql
β β β βββ meta
β β β βββ 0000_snapshot.json
β β β βββ 0001_snapshot.json
β β β βββ 0002_snapshot.json
β β β βββ _journal.json
β β βββ package.json
β β βββ src
β β β βββ app.ts
β β β βββ config
β β β β βββ env.ts
β β β βββ db
β β β β βββ enable-postgis.ts
β β β β βββ index.ts
β β β β βββ redis.ts
β β β β βββ run-migrations.ts
β β β β βββ seed.ts
β β β βββ index.ts
β β β βββ jobs
β β β β βββ deadRoomCleanup.ts
β β β β βββ summarizeRoom.ts
β β β βββ plugins
β β β βββ routes
β β β β βββ auth.ts
β β β β βββ health.ts
β β β β βββ rooms.ts
β β β β βββ test-db.ts
β β β β βββ waitlist.ts
β β β βββ services
β β β β βββ geocoding.ts
β β β β βββ queue.ts
β β β βββ test_inject.ts
β β β βββ utils
β β β β βββ auth.ts
β β β β βββ logger.ts
β β β β βββ metrics.ts
β β β β βββ response.ts
β β β βββ websocket
β β β β βββ pubsub.ts
β β β β βββ wsHandler.ts
β β β βββ worker.ts
β β βββ test_inject.ts
β β βββ test_ws.ts
β β βββ tsconfig.json
β βββ shared
β βββ package.json
β βββ src
β β βββ index.d.ts
β β βββ index.js
β β βββ index.ts
β β βββ schema.d.ts
β β βββ schema.js
β β βββ schema.ts
β βββ test_schema.ts
β βββ test_zod_bug.ts
β βββ tsconfig.json
βββ .env.example
βββ .gitignore
βββ .nvmrc
βββ CONTRIBUTING.md
βββ LICENSE
βββ README.md
βββ deploy.md
βββ netlify.toml
βββ package-lock.json
βββ package.json
βββ docker-compose.yml
βββ drizzle.config.ts
βββ generate-keys.js
βββ generated-icon.png
βββ postcss.config.js
βββ render.yaml
βββ replit.md
βββ tailwind.config.ts
βββ test_api.js
βββ theme.json
βββ tsconfig.json
βββ vite.config.ts
Because IntelliCircle is a strictly defined monorepo, running npm run dev in the root folder will fail. You must run the Client and Server as separate, concurrent processes.
- Node.js v20+
- PostgreSQL instance with PostGIS installed.
- Redis instance (Local or Upstash Serverless).
- Environment variables configured properly (See
.env.examplein bothclientandserverpackages).
The Fastify server builds the DB connection pool and spins up the WebSocket server on port 8080.
# Terminal 1
cd packages/server
npm i
npm run db:push # Synchronize Drizzle schema to PostgreSQL
npm run dev # Starts Fastify on http://localhost:8080Note: To test AI and background jobs, you may also need to start the BullMQ worker in an adjacent terminal using
npm run worker.
The Next.js client runs on port 3000 and proxys to the backend.
# Terminal 2
cd packages/client
npm i
npm run dev # Starts Next.js on http://localhost:3000Open http://localhost:3000 in your browser. Upon clicking "Find Nearby Rooms", you will be prompted for Location access by your browser.
Our single source of truth for all schemas lives in packages/shared/src/schema.ts.
This ensures that frontend forms and backend queries use the exact same Zod validation objects.
When modifying the database structure in schema.ts, apply changes to your PostgreSQL instance by navigating to packages/server and running:
npm run db:generate # Generates SQL migration files
npm run db:push # Pushes migrations to the DBNote: Depending on your config, some projects rely solely on db:push for rapid prototyping.
IntelliCircle heavily relies on specific UX principles to convert casual browsers into engaged community members:
- Dark, Deep Palette: A high-contrast
#0A0A0Abackground layered with electric indigo (#4F46E5) neon accents creates a secure, tech-forward environment. - Product-Led Growth (PLG): The application delays account creation until after a user has engaged in a chat, bypassing traditional signup walls and significantly boosting conversion.
- Typography: We use
Interfor hyper-legible chat interfaces and stark formatting.
(See Design Doc.md for our complete design system details).
- "Error: Cannot find module '@intellicircle/shared'"
Ensure you ran
npm installat the root of the monorepo first so NPM links the workspaces. - "Port 3000 / 8080 is already in use"
You likely have an orphaned Node process.
- Windows:
Get-Process node -ErrorAction SilentlyContinue | Stop-Process -Force - Mac/Linux:
pkill -f node
- Windows:
- "Discover Page: 400 Bad Request" Your browser must have Geolocation enabled. If testing locally, ensure you aren't blocking location API requests.
- "WebSocket Reconnecting..."
The Fastify server requires a valid Redis connection string in the
.envto bind the Pub/Sub network. Validate your Redis URI.
When contributing to IntelliCircle, please ensure your changes respect the shared boundaries. If you alter the database, update the Zod schemas; the Next.js client and Fastify server will instantly inherit these validation rules.
Designed with π©΅ for local networking.