← Back to blog
crm April 24, 2026 5 min read

CRM Suite

Multi-tenant CRM platform built with NestJS, PostgreSQL, and microservice architecture. Manages leads, deals, contacts, companies, activities, and tasks with organization-scoped data isolation and granular RBAC.

CRM suite dashboard screenshot
CRM suite dashboard

Tech Stack

LayerTechnology
RuntimeNode.js, TypeScript (strict)
FrameworkNestJS 11 (monorepo)
DatabasePostgreSQL, TypeORM
AuthJWT, Passport.js, bcrypt
AuthorizationCASL with hierarchical permission scopes
EmailBullMQ, MJML, Handlebars, Nodemailer
Validationclass-validator, class-transformer
ArchitectureCQRS, event-driven microservices
Package Managerpnpm
Tech Stack

Architecture

Multi-Tenancy

  • Organization-based data isolation with tenant-aware base service
  • Users belong to multiple organizations with distinct roles
  • Automatic query scoping per active tenant

RBAC / Permissions

  • CASL-powered permission engine with 6 scopes: Global, Company, Department, Team, Self, Owner
  • Role-based permission assignment per resource and action
  • Permission guard enforced on every protected endpoint

Email Microservice

  • Decoupled from main API via NestJS microservices
  • BullMQ job queue for reliable async delivery
  • MJML templates compiled to responsive HTML
  • Event-driven triggers (user registration, etc.)

API

  • RESTful with consistent CRUD patterns and DTO validation
  • Pagination, filtering, proper HTTP status codes