Skip to content

AnirudhAP2k/CorpConnect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,047 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CorpConnect

AI-Powered B2B Collaboration & Networking Graph Platform

CorpConnect is a next-generation multi-tenant platform designed to help organizations discover, connect, and collaborate through structured relationship graphs, pre-event matchmaking, and real-time interaction systems.


πŸš€ The Vision: Beyond Simple Events

Unlike transactional event portals that focus strictly on ticket sales and static guest lists, CorpConnect treats events as catalysts for strategic connections.

The platform is architected around an Organization-First Networking Graph:

  • Relationship-driven: Businesses build persistent organization profiles detailing services, technologies, hiring statuses, and partnership interests.
  • Intelligent Matchmaking: Vector search similarity analyses identify complementary organizations and propose connections.
  • Pre-Event Coordination: Attendees can request private 1-on-1 business meetings prior to events starting.
  • Interactive Live Collaboration: Virtual panels feature real-time WebRTC streams with interactive hand-raising queues, chats, and sentiment polling.

πŸ—οΈ System Topology & Hybrid Architecture

CorpConnect runs a hybrid, multi-tenant monorepo architecture, distributing concerns across specialized runtimes:

graph TD
    Client["Client / Web App (Next.js Frontend)"]
    
    subgraph CorpConnectCore ["CorpConnect Next.js Application Core"]
        NextServer["Next.js App Router (SSR/ISR/Server Actions)"]
        DomainLayer["Domain Layer (/domain)<br/>(Queries, Actions, Validation)"]
        NextAuth["Next-Auth Session Layer"]
    end
    
    subgraph Microservices ["Microservices Layer"]
        WSService["ws-service (Node/Socket.io)<br/>[Real-time Chat & In-Event Interactivity]"]
        LVService["lv-service (Node/Express/LiveKit)<br/>[Virtual Rooms management]"]
        AIService["ai-service (Python/FastAPI)<br/>[Recommendations, Semantic Search, pgvector]"]
    end
    
    subgraph DataStorage ["Data & Cache Layer"]
        DB[(PostgreSQL Database<br/>+ pgvector)]
        Redis[(Redis Cache & Adapters)]
    end
    
    subgraph External ["External Integrations"]
        Stripe["Stripe / Razorpay SDKs<br/>(Payments & Webhooks)"]
        Cloudinary["Cloudinary<br/>(Image/Logo Uploads)"]
        LiveKitCloud["LiveKit Server<br/>(Real-time WebRTC Live Streaming)"]
        ResendSMTP["Resend / SMTP<br/>(System Mailer)"]
    end

    Client -->|HTTPS / Next.js Pages| NextServer
    Client -->|WebSocket Connection| WSService
    Client -->|WebRTC Audio/Video| LiveKitCloud
    
    NextServer --> DomainLayer
    DomainLayer --> DB
    WSService --> DB
    AIService --> DB
    LVService --> DB
    
    WSService <-->|Pub/Sub Adapter| Redis
    NextServer -->|Embedding Jobs| AIService
    NextServer -->|Payment Processing| Stripe
    NextServer -->|Logo Assets| Cloudinary
    LVService -->|Mint Tokens & Admin Rooms| LiveKitCloud
Loading

Services Breakdown

  1. Next.js Core Web App: Main web portal handling server-side rendering (SSR), incremental static regeneration (ISR) for public directories, form validation (Zod), and secure mutations (Server Actions) decoupled into a Domain-Driven /domain structure.
  2. WebSocket Service (ws-service): A stateful Node.js + Socket.io service handling real-time messaging, typing indicators, read receipts, and in-event interactivity (emojis, raise-hand queues). Scales horizontally using a Redis pub/sub adapter.
  3. LiveKit Proxy Service (lv-service): Node.js Express service wrapping the LiveKit Server SDK. Generates JWT video room tokens, enforces event attendance permissions, and tracks active meeting durations.
  4. AI Microservice (ai-service): Python/FastAPI service embedding data utilizing all-MiniLM-L6-v2 and performing vector calculations (pgvector) to recommend events, suggest matching partners, search semantically, and perform feedback sentiment analyses.

πŸ’Ž Features & Subscription Tier Matrix

CorpConnect enforces multi-layered tier gates across database queries, APIs, and real-time sockets:

Platform Feature Free Pro Enterprise
Workspace Profile & Switcher βœ… βœ… βœ…
B2B Filtered Discovery βœ… βœ… βœ…
Standard Event Registration βœ… (max 50 attendees) βœ… (Unlimited) βœ… (Unlimited)
Paid Event Gateways (Stripe/Razorpay) ❌ βœ… βœ…
Direct Messaging (DMs) ❌ βœ… βœ…
Pre-Event 1-on-1 Matchmaking ❌ βœ… βœ…
Organization Connections ❌ βœ… βœ…
AI Partner & Event Recommendations ❌ βœ… βœ…
External API Key Credentials ❌ βœ… βœ…
Real-time WebRTC Virtual Rooms ❌ βœ… βœ…
WhatsApp-style Group Chats ❌ ❌ βœ…
AI Planner & Event Pitching Flow ❌ ❌ βœ…
Post-Event Sentiment & Performance Reports ❌ ❌ βœ…
Semantic Search (pgvector) ❌ ❌ βœ…
Organization Webhook Delivery ❌ ❌ βœ… (With HMAC Signature)

πŸ”’ Governance & Constraints

To keep organizational workspaces compliant, the platform enforces strict business rules at the domain layer:

  • Role Governance: Organizations are restricted to exactly 1 Owner and a maximum of 5 Admins. Promotions to OWNER must run through the transactional transferOrganizationOwnershipAction to demote the current owner and promote the target atomically.
  • Abuse Prevention: Free tier organizations are blocked from publishing paid event checkouts, and a 2% (Pro) or 1% (Enterprise) platform commission fee is applied at payment checkouts.

πŸ“ Monorepo Directory Structure

/
β”œβ”€β”€ actions/             # Legacy and shared server actions
β”œβ”€β”€ ai-service/          # Python FastAPI microservice (embeddings, recommendation engine)
β”œβ”€β”€ app/                 # Next.js App Router (pages, middleware, and API routes)
β”œβ”€β”€ components/          # React components structured by domain (shared, billing, messaging, virtual)
β”œβ”€β”€ constants/           # Platform constants, menu links, metadata
β”œβ”€β”€ data/                # Data Access Layer (DAL) - database reads with permission isolation
β”œβ”€β”€ docs/                # Feature specs, implementation plans, and architecture walkthroughs
β”œβ”€β”€ domain/              # DDD / Vertical Slice Layer (Actions, Queries, Validation, Types)
β”‚   β”œβ”€β”€ events/
β”‚   β”œβ”€β”€ messaging/
β”‚   β”œβ”€β”€ notifications/   # Laravel-style notification dispatcher with multi-adapter system
β”‚   β”œβ”€β”€ organizations/
β”‚   β”œβ”€β”€ pitches/         # Event pitching lifecycle schemas & actions
β”‚   └── tags/
β”œβ”€β”€ hooks/               # Client-side hooks (Socket.io subscriptions, intersection observers)
β”œβ”€β”€ lib/                 # Infrastructure clients (Prisma, payment gateways, mailer, job queues)
β”œβ”€β”€ lv-service/          # LiveKit WebRTC rooms management gateway microservice
└── ws-service/          # Socket.io real-time chat service

πŸ› οΈ Local Development Setup

1. Prerequisites

  • Node.js 20+ (with pnpm)
  • Python 3.11+ (with venv)
  • PostgreSQL (with the pgvector extension installed/enabled)
  • Redis (for WebSocket scaling and AI cache)

2. Database Initialization

From the project root:

# Enable pgvector in your PostgreSQL instance
npx ts-node scripts/enable-pgvector.ts

# Apply the Prisma schema and generate client
npx prisma db push

3. Next.js Web Application

# Install dependencies
pnpm install

# Run the dev server
pnpm dev

4. WebSocket Service (ws-service)

cd ws-service
pnpm install
# Compile typescript and start
pnpm dev

5. LiveKit Gateway (lv-service)

cd lv-service
pnpm install
pnpm dev

6. AI Microservice (ai-service)

cd ai-service
python -m venv .venv
source .venv/bin/activate  # Or .venv\Scripts\activate on Windows
pip install -r requirements.txt

# Run the Uvicorn FastAPI server
uvicorn main:app --reload --port 8000

Note: The first startup of the AI service downloads the all-MiniLM-L6-v2 model (~90MB) and stores it locally.


πŸ“§ Notification System

CorpConnect implements a Factory + Adapter notification pattern. Job handlers enqueue events (like SEND_EVENT_REMINDER or VIRTUAL_ROOM_OPENED) which resolve active notification adapters concurrently:

  • Email Adapter: Relies on Nodemailer/SMTP and logs results in the EmailLog table for auditing.
  • In-App Adapter: Writes directly to the Notification table.
  • Slack / Google Chat / SMS Adapters: Hook into outgoing chat webhook formats.

Add channels by creating an adapter under domain/notifications/adapters/ and listing it in registry.ts.


βš™οΈ Environment Variables

Copy the .env.example templates in the root, ws-service, lv-service, and ai-service folders. Key environment variables include:

  • Next.js: DATABASE_URL, AUTH_SECRET, AI_SERVICE_MASTER_KEY, STRIPE_SECRET_KEY, RAZORPAY_KEY_SECRET, LIVEKIT_API_KEY, NEXT_PUBLIC_WS_URL.
  • AI Service: DATABASE_URL (uses asyncpg scheme: postgresql+asyncpg://...), MASTER_KEY.
  • ws-service: DATABASE_URL, REDIS_URL, AUTH_SECRET.
  • lv-service: DATABASE_URL, LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET.

πŸ›‘οΈ License

This project is proprietary and private software. All rights reserved. Unauthorized redistribution or duplication is strictly prohibited.

About

CorpConnect is an AI-powered B2B collaboration platform that enables organizations to connect, host events, discover strategic partners, and unlock business opportunities through intelligent matchmaking and structured networking.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors