Skip to main content

Development Setup

Run RiDDiX - Matrix Synapse Panel locally for development.

Prerequisites

  • Node.js 20+
  • PostgreSQL 14+ (running locally or via Docker)
  • npm

Steps

1. Clone and Install

git clone https://github.com/RiDDiX/matrix-synapse-panel.git
cd matrix-synapse-panel
npm install

2. Configure Environment

cp .env.example .env

Edit .env with your local settings:

APP_URL=http://localhost:3000
DATABASE_URL="postgresql://portal:portal@localhost:5432/invite_portal"
SESSION_SECRET=your-dev-secret-at-least-32-characters-long
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=admin123

3. Set Up the Database

# Run migrations
npx prisma migrate dev

# Seed admin user
npx prisma db seed

4. Start the Dev Server

npm run dev

The application starts at http://localhost:3000.

Available Scripts

ScriptDescription
npm run devStart Next.js dev server with hot reload
npm run buildProduction build
npm run startStart production server
npm run lintRun ESLint
npm run typecheckRun TypeScript type checking
npm run testRun tests with Vitest
npm run test:watchRun tests in watch mode
npm run db:generateRegenerate Prisma client
npm run db:migrateDeploy pending migrations
npm run db:migrate:devCreate and apply migrations (dev)
npm run db:seedSeed admin user
npm run db:pushPush schema changes without migration

Running PostgreSQL with Docker

If you don't have PostgreSQL installed locally:

docker run -d \
--name portal-db \
-e POSTGRES_USER=portal \
-e POSTGRES_PASSWORD=portal \
-e POSTGRES_DB=invite_portal \
-p 5432:5432 \
postgres:16-alpine

Prisma Studio

Inspect and edit database records:

npx prisma studio

Opens a web UI at http://localhost:5555.

Testing

# Run all tests
npm run test

# Watch mode
npm run test:watch

Tests use Vitest and cover validation schemas, rate limiting, branding defaults, integration catalog, bot templates, and cryptographic operations.