CtrlK
BlogDocsLog inGet started
Tessl Logo

project-architecture

Use this skill to understand the RingCentral App Connect project structure, including the monorepo layout, core package APIs, handlers, models, and how components interact.

64

1.16x
Quality

43%

Does it follow best practices?

Impact

100%

1.16x

Average score across 3 eval scenarios

SecuritybySnyk

Passed

No known issues

Optimize this skill with Tessl

npx tessl skill review --optimize ./.agent-skills/project-architecture/SKILL.md
SKILL.md
Quality
Evals
Security

Project Architecture

Repository Structure

rc-unified-crm-extension/
├── packages/                    # Monorepo packages
│   ├── core/                    # @app-connect/core - shared business logic
│   │   ├── handlers/            # Business logic handlers
│   │   ├── models/              # Sequelize data models
│   │   ├── lib/                 # Utilities (jwt, analytics, logger, etc.)
│   │   ├── connector/           # Connector registry
│   │   └── mcp/                 # MCP (Model Context Protocol) tools
│   ├── cli/                     # CLI tools for project setup
│   └── template/                # Template for new connector projects
├── src/                         # Main development server
│   ├── connectors/              # CRM connector implementations
│   ├── plugins/                 # Data plugins
│   ├── index.js                 # App entry point
│   ├── server.js                # Express server
│   └── lambda.js                # AWS Lambda handler
├── serverless-deploy/           # Production deployment
├── serverless-deploy-test/      # Test environment deployment
├── docs/                        # Documentation (MkDocs)
└── tests/                       # Integration tests

Core Package (@app-connect/core)

Entry Point Usage

const { createCoreApp, connectorRegistry } = require('@app-connect/core');

// Set manifest before registering connectors
connectorRegistry.setDefaultManifest(manifest);
connectorRegistry.registerConnector('myCRM', myCRMConnector, manifest);

// Create Express app with all core functionality
const app = createCoreApp();

Handlers (packages/core/handlers/)

HandlerFilePurpose
Authauth.jsOAuth flow, token refresh, API key auth
Contactcontact.jsContact search, matching, creation
Loglog.jsCall/message logging, updates
Adminadmin.jsAdmin settings, user mappings
Useruser.jsUser settings, preferences
Dispositiondisposition.jsCall dispositions

Models (packages/core/models/)

ModelFilePurpose
UserModeluserModel.jsUser auth, tokens, settings
CallLogModelcallLogModel.jsCall log records
MessageLogModelmessageLogModel.jsSMS/message logs
AdminConfigModeladminConfigModel.jsAdmin configurations
CacheModelcacheModel.jsCaching layer

Key Libraries (packages/core/lib/)

LibraryFilePurpose
JWTjwt.jsToken encoding/decoding
Analyticsanalytics.jsUsage tracking
Loggerlogger.jsStructured logging
Constantsconstants.jsShared constants (LOG_DETAILS_FORMAT_TYPE, etc.)
CallLogComposercallLogComposer.jsCompose call log details
ErrorHandlererrorHandler.jsStandardized error handling
Utilutil.jsGeneral utilities

Connector Registry

The connector registry manages CRM connector lifecycle:

const { connectorRegistry } = require('@app-connect/core');

// Register a connector
connectorRegistry.registerConnector('platformName', connectorModule, manifest);

// Register interface functions (extend without modifying original)
connectorRegistry.registerConnectorInterface('platformName', 'createCallLog', customFn);

// Get composed connector
const connector = connectorRegistry.getConnector('platformName');

API Routes

Core routes provided by @app-connect/core:

Authentication

  • GET /authValidation - Validate auth
  • GET /oauth-callback - OAuth callback
  • POST /apiKeyLogin - API key login
  • POST /unAuthorize - Logout

Contacts

  • GET /contact - Find by phone
  • POST /contact - Create contact
  • GET /custom/contact/search - Search by name

Logging

  • GET /callLog - Get call log
  • POST /callLog - Create call log
  • PATCH /callLog - Update call log
  • PUT /callDisposition - Set disposition
  • POST /messageLog - Create message log

Settings

  • GET /user/settings - User settings
  • POST /user/settings - Update user settings
  • GET /admin/settings - Admin settings
  • POST /admin/settings - Update admin settings

Environment Variables

Key environment variables:

# Database
DATABASE_URL=postgres://...
DISABLE_SYNC_DB_TABLE=false

# Server
APP_SERVER_SECRET_KEY=secret
HASH_KEY=hash-key
IS_PROD=false

# DynamoDB (local dev)
DYNAMODB_LOCALHOST=http://localhost:8000

# CRM-specific (example for Pipedrive)
PIPEDRIVE_CLIENT_ID=...
PIPEDRIVE_CLIENT_SECRET=...
PIPEDRIVE_ACCESS_TOKEN_URI=...
PIPEDRIVE_REDIRECT_URI=...

Development Workflow

# Start local server
npm run server

# Start ngrok tunnel
npm run ngrok

# Run tests
npm test

# Build for deployment
npm run build

# Deploy
npm run deploy

Database

  • Development: SQLite (db.sqlite)
  • Production: PostgreSQL via Sequelize ORM
  • Cache/Locks: DynamoDB (local via npm run dynamo-local)
Repository
ringcentral/rc-unified-crm-extension
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.