Aller au contenu principal

Modules

HeartCo Starter ships with a modular architecture. Each module can be enabled/disabled via the NEXT_PUBLIC_TIER environment variable.

Module overview

ModuleDescriptionTierStatusRouterKey models
Core (auth)Authentication, sessions, OAuthAllcoreauth.tsUser, Account, Session
Core (RBAC)Role-based access control, permission matrixAllcorepermissions.tsRole, Permission
Core (billing)Stripe subscriptions, freemium limitsAllcorefreemium.tsSubscription, Plan
Core (multi-tenant)Organizations, teams, invitesAllcoreorganization.tsOrganization, Team
Core (notifications)In-app + push notificationsAllcorenotifications.tsNotification
Core (email)Transactional emails via ResendAllcoreadmin-email.tsEmailTemplate
Core (onboarding)User onboarding flowAllcoreonboarding.tsOnboardingProgress
CRMContacts, deals, Kanban pipelinePro+examplecrm.tsContact, Deal, Pipeline
InvoicingQuotes, invoices, payments, credit notesPro+examplefacturation.ts, devis.tsInvoice, Quote, Payment
AI ContentSocial media content generationPro+examplesocial-content.tsAiContent, SocialPost
CopilotAI assistant (chatbot + business copilot)Pro+examplecopilote.tsChatbotConversation
HREmployee profiles, contracts, leaves, timesheetsPro+examplerh.ts, employee-profiles.tsEmployeeProfile, LeaveRequest
ProjectsProject management, tasks, work ordersPro+exampleprojets.tsProject, WorkOrder
CalendarEvents, appointments, syncPro+examplecalendars.tsCalendarEvent, Appointment
ChatInternal messaging, conversationsPro+exampleconversations.tsConversation, Message
MarketingCampaigns, sequences, email marketingPro+examplemarketing.tsCampaign, Sequence
AnalyticsDashboard KPIs, statsPro+exampleanalytics.ts
StockInventory managementPro+examplestock.tsStockItem, StockMovement
BlogCMS with AI generationPro+exampleblog.tsBlogArticle, BlogCategory
E-InvoicingFactur-X / Iopole integrationPro+examplefacturx.ts, iopole.tsIopoleLog
BankBridge API banking integrationPro+examplebank.tsBankTransaction
TicketsCustomer support ticketsPro+exampletickets.tsTicket
PortalClient portal, document sharingPro+exampleportal.tsPortal, PortalDocument
MarketplaceAdd-on marketplacePro+examplemarketplace.tsMarketplaceAddon
AutomationWorkflow automation enginePro+exampleautomation.tsAutomation
RealtimePusher-based real-time notificationsPro+example
MobileExpo app, offline-first, pushPro+examplepush-tokens.tsPushToken
ReportingReport generation with templatesPro+examplereports.tsReport, ReportTemplate
SignaturesElectronic signaturesPro+examplesignatures.tsSignature
_templateModule scaffold for new modulesAlltemplaterouter.ts

How to enable/disable modules

Configuration

Module activation is controlled by the NEXT_PUBLIC_TIER environment variable.

File: src/lib/config/tiers.ts

// src/lib/config/tiers.ts
export const TIER_CONFIG = {
  starter: { crm: false, invoicing: false, hr: false, ... },
  pro: { crm: true, invoicing: true, hr: false, ... },
  team: { crm: true, invoicing: true, hr: true, ... },
};
 
export const activeTierModules = TIER_CONFIG[process.env.NEXT_PUBLIC_TIER || 'starter'];

Environment setup

In your .env.local:

NEXT_PUBLIC_TIER=pro  # or 'starter', 'team'

At build/runtime, only routers and Prisma models for enabled modules are imported.

How to add a new module

See Adding a module for a step-by-step guide.

Minimal checklist:

  1. Create src/server/api/routers/<module-name>.ts
  2. Register in src/server/api/root.ts
  3. Add models to prisma/schema.prisma (with organizationId)
  4. Add tier config to src/lib/config/tiers.ts
  5. Add to permission matrix (src/lib/permissions/matrix.ts)
  6. Create components in src/components/<module-name>/

Module ideas you can build

  • Inventory & Warehouse — Stock levels, bins, transfers, barcodes
  • Booking & Appointments — Calendars, availability, auto-confirmation
  • Helpdesk & KB — Support tickets, knowledge articles, FAQs
  • E-commerce — Products, cart, checkout, order tracking
  • Learning Management (LMS) — Courses, lessons, certifications, quizzes
  • Fleet Management — Vehicles, routes, fuel, maintenance logs
  • Property Management — Tenants, leases, maintenance requests, billing
  • Document Management — File storage, versioning, permissions