vchili chilivchilihub
Behind the Hub

How vchili hub Was Built

The engineering decisions, data architecture, and open methodology that power our hybrid community platform.

Core Pillar 01
Architecture

Payload CMS Owns the Database

Zero competing schema migrations or ORM overhead.

Payload CMS 3.x strictly defines and controls the single PostgreSQL schema. Models for Users, Resources, Pages, Members, and Community Contributions live in Payload.

The NestJS backend accesses the exact same tables using Drizzle ORM for stateless queries without generating competing migrations or Prisma dependencies.

Core Pillar 02
Bot Lifecycle

Startup Catch-Up Protocol

Guaranteed message continuity across restarts and downtime.

Before connecting to the Discord WebSocket Gateway, the bot queries Postgres for the last_synced_timestamp.

It queries the Discord REST API to fetch any forum threads created between that timestamp and the present, ingesting missed threads as status: pending before actively listening to live events.

Core Pillar 03
Content Flow

Hybrid Content Ingestion

Automated community feeds paired with manual admin override.

Every resource originates from either Discord (entrySource: 'discord') or direct administrative authoring (entrySource: 'manual').

Manual admin posts default immediately to official status. In contrast, Discord threads start as pending until approved via the /approve slash command.

Core Pillar 04
Security

Discord OAuth2 Live Role Sync

Real-time access synchronization tied to server roles.

Upon Discord sign-in, the system queries the Discord Guild API to inspect the user’s active roles.

Designated server roles grant instant access to the Staff Portal. If a user is removed or demoted in Discord, their web administrative privileges are immediately revoked on their next session.

The Modern Technology Stack

Engineered for high performance, developer happiness, and zero lock-in.

Next.js 16

App Router & RSC

Payload CMS 3.x

Headless Content Engine

NestJS 10+

Discord Bot & Catch-Up

Drizzle ORM

Stateless SQL Layer

Interested in contributing or reviewing our code?