Skip to main content

Welcome to CONA

CONA is a comprehensive business management system built with Next.js, Temporal, and Supabase.

Getting Started

This documentation will help you understand and work with the CONA codebase.

Overview

CONA follows a structured, modular architecture with:
  • Next.js App Router: Web application framework
  • TypeScript: For type-safe development
  • PNPM: Package management with workspaces
  • Temporal: Workflow automation
  • Supabase: Database
  • Auth0: Authentication

Monorepo Structure

CONA uses a monorepo architecture with PNPM workspaces for efficient package management and code sharing.

Package Architecture

Core Business Logic (@cona/core)

  • Purpose: Pure business logic and domain models
  • Usage: Imported by webapp and temporal workers
  • Contains: Database operations, business rules, data transformations
  • Import: import { functionName } from "@cona/core"

Database Layer (@cona/database)

  • Purpose: Database schema, migrations, and Prisma client
  • Usage: Shared across all applications
  • Contains: Prisma schema, migrations, database utilities
  • Import: import { prisma } from "@cona/database"

Temporal Workflows (@cona/temporal-workflows)

  • Purpose: Workflow definitions and activities
  • Usage: Used by temporal-workers application
  • Contains: Long-running workflows, background tasks
  • Import: import { workflowName } from "@cona/temporal-workflows"

Shared UI Components (@cona/ui)

  • Purpose: Reusable UI components based on Shadcn/UI
  • Usage: Imported by webapp and other frontends
  • Contains: Base components, design system elements
  • Import: import { Button } from "@cona/ui"

Utilities (@cona/utils)

  • Purpose: Shared utility functions
  • Usage: Used across all packages and applications
  • Contains: Encryption, date handling, formatting, validation
  • Import: import { encryptText } from "@cona/utils"

Types (@cona/types)

  • Purpose: Shared TypeScript type definitions
  • Usage: Used across all packages for type safety
  • Contains: API interfaces, domain models, shared types
  • Import: import type { ActionResponse } from "@cona/types"

Import Aliases

The webapp uses path aliases for cleaner imports:

Key Features

  • Type-Safe Development: Full TypeScript support across all packages
  • Modular Architecture: Clear separation of concerns between packages
  • Efficient Package Management: PNPM workspaces for fast installs and builds
  • Shared Code Reuse: Common logic in packages, app-specific code in apps
  • Database Integration: Supabase with Prisma ORM and migrations
  • Workflow Automation: Temporal for background processing
  • Comprehensive UI Components: Shadcn/UI-based design system

Next Steps