IntelliCircle is a modern, real-time networking and chat application designed to digitally map users to hyper-localized professional groups. Stop swiping. Start meeting. IntelliCircle calculates physical proximity graphs to instantly drop users into local, highly-curated professional hubs based entirely on shared interests.
IntelliCircle utilizes a scalable npm Workspaces Monorepo. The frontend and backend codebases live together to share data validation schemas and types but run entirely independently.
- Framework: Next.js 14 (App Router)
- Styling: Tailwind CSS & Glassmorphism Design System
- State Management: Zustand (Persistent Local Storage) & TanStack Query
- Animations: Framer Motion (Page Transitions, Dynamic Typing Indicators)
- Data Rendering:
react-virtuoso(Virtualized infinite chat histories)
- Server: Fastify
- Real-Time:
@fastify/websocketover standardwsprotocols - Scaling Backplane: Redis Pub/Sub (via Upstash Serverless) for horizontal socket scaling
- ORM & DB: Drizzle ORM connecting to PostgreSQL (Supabase)
- Geospatial Math: PostGIS (
ST_DWithin,ST_MakePoint) for calculating earth-curvature distances natively in Postgres. - Security: Argon2 Hashing, Asymmetric JWTs (RS256),
@fastify/rate-limit,@fastify/csrf-protection
- Validation: Zod schemas defining strict payloads boundary parsing for both Client and Server.
IntelliCircle/
βββ package.json # Root monorepo workspace definition
βββ README.md # This documentation
βββ TODO.md # Project Roadmap & MVP Tracking
β
βββ packages/
β βββ client/ # Next.js Frontend Application
β β βββ src/
β β β βββ app/ # App Router Pages (/(app)/chat, /auth, /discover)
β β β βββ components/ # Reusable UI (AuthModal, MobileDrawer, PageTransition)
β β β βββ hooks/ # Custom React hooks (useSocket, useGeolocation)
β β β βββ lib/ # Intercepted Axios API clients
β β β βββ store/ # Zustand authentication & session store
β β βββ tailwind.config.ts # Global theme definitions
β β
β βββ server/ # Fastify Backend API
β β βββ src/
β β β βββ config/ # Environment validation (Zod)
β β β βββ db/ # Drizzle instance and seeding scripts
β β β βββ routes/ # REST APIs (auth.ts, rooms.ts, waitlist.ts)
β β β βββ services/ # 3rd party integrations (OpenCage Geocoding)
β β β βββ websocket/ # Real-time WebSocket handlers & Redis Pub/Sub adapters
β β β βββ app.ts # Fastify bootstrapper and Global Error Handlers
β β βββ drizzle.config.ts # Database migration configuration
β β
β βββ shared/ # Universal Cross-Platform Logic
β βββ src/
β βββ schema.ts # Single-Source-of-Truth DB Schemas & Zod validation
Because this is a monorepo, running npm run dev in the root folder will fail with a "Missing script" error.
You must start the Frontend and Backend servers in two separate terminal windows.
- Node.js (v20+ Recommended)
- Valid
.envfiles in bothpackages/serverandpackages/clientcontaining Supabase PostgreSQL and Upstash Redis URIs.
The backend handles the Database and Real-time WebSockets.
- Open Terminal 1.
- Navigate to the server folder:
cd packages/server - Start the dev server:
Success Output:
npm run dev
π Server listening on http://localhost:8080(or 8081)
- Open Terminal 2.
- Navigate to the client folder:
cd packages/client - Start the UI:
Success Output:
npm run dev
Ready in X.Xms - Local: http://localhost:3000
Open your web browser and navigate to: π http://localhost:3000
We use Drizzle ORM to manage Postgres. Our single source of truth for the schema lives in packages/shared/src/schema.ts.
If you ever modify a schema there, you need to push those changes to the live Supabase database.
From the packages/server folder, run:
npm run db:push- "npm error Missing script: dev"
- You are running Node in the root folder. You must
cdinto eitherpackages/clientorpackages/serverfirst!
- You are running Node in the root folder. You must
- "Port 3000 / 8080 is already in use"
- You have an orphaned process. Open PowerShell in Windows and run:
Get-Process node -ErrorAction SilentlyContinue | Stop-Process -Force
- You have an orphaned process. Open PowerShell in Windows and run:
- "Discover Page: 400 Bad Request"
- Ensure that you granted Location/GPS permissions in your web browser. The Discover page mathematically filters rooms based on your exact physical location coordinates.
- "WebSocket Reconnecting..." constantly flashes
- Ensure that your Upstash Redis credentials inside
packages/server/.envare active. WebSockets require the Redis PubSub backbone to bind.
- Ensure that your Upstash Redis credentials inside