Project notes

Repository findings and notes on the SalesCandy product, sales workflow, and engineering team.

Browse repositories and contributors

Explore the Connectome graph

Engineering

Amazon Aurora

Provides relational storage for CandyBase management data.

Engineering

Amazon Cognito

Bridges SalesCandy’s authentication service and AWS identity federation.

Engineering

Amazon DynamoDB

Stores lead records and streams record changes to downstream processing.

Engineering

Amazon S3

Stores files that SalesCandy clients can upload and retrieve through signed requests.

Engineering

Amazon SES

Sends email from the reporting pipeline.

Engineering

AWS Amplify

Connects the manager portal to AWS authentication and GraphQL from the browser.

Engineering

AWS AppSync and GraphQL

Defines SalesCandy’s managed GraphQL API and connects operations to backend services.

Engineering

AWS CloudFormation

Defines AWS resources alongside the functions that depend on them.

Engineering

AWS Lambda

Runs SalesCandy handlers for HTTP callbacks, queued work, and scheduled jobs.

Engineering

AWS Step Functions

Waits until a scheduled routing-hours change becomes due.

Utilities

Bucket antivirus

An upstream utility for scanning new S3 objects with AWS Lambda and ClamAV.

Contribution

Reza Rosli on 20200308-sample-leads

Modified `collectData.js` to reduce collected items by implementing random selection using `function_score` in the Elasticsearch query.

Contribution

Ibrahim on admin-api

Adjusted validation logic for WhatsApp message templates to correctly handle threshold and industry ID parsing for update and delete operations.

Contribution

Reza Rosli on admin-api

Updates to `helper/TenantModel.js` correctly reflect the migration of `waMsgThreshold` from the `tenants` table to `tenantSettings` in SQL queries and object handling.

Contribution

Muhammad Anwaar on admin-portal

Refactored GraphQL schema by renaming fields like `tenantUsers` to `userId` and adding new fields like `username`, `designation`, `email`, and `phone` to user-related queries.

Contribution

Rasikh Mashhadi on admin-portal

Added console logs in `AuthComponent` to check the validity of the phone number input and retrieve validation errors, improving debugging visibility.

Contribution

Reza Rosli on admin-portal

The build process was updated to explicitly include AWS credentials (Access Key ID, Secret Access Key, and Region) in the deployment script.

Contribution

Stuti Singh on admin-portal

The logic for enabling a field's 'invalid' state in the lead-action component was updated to check for both 'at_incall' and 'at_ocall' status.

Contribution

Yash Bansal on admin-portal

Updated Angular dependencies and added new loaders/packages like 'sass-loader' and 'node-sass' to resolve build and testing issues.

Contribution

Ele Elyiana on bouncer

Updated serverless.yml to use SSM parameters for environment details like EFS access points and subnet IDs.

Contribution

Ele Elyiana on CandyBase

Introduced `resourcesCandyOffline` to handle offline lead source data processing, including new configuration files and S3 lifecycle rules.

Contribution

Muhammad Shoaib on CandyBase

Updated DynamoDB table creation logic in `tenantBootstrap` to use `BillingMode: 'PAY_PER_REQUEST'` for the `sc-candyBase` table.

Contribution

Reza Rosli on CandyBase

Adds explicit resource definitions and outputs in `sc-vpc` for AWS resources like Security Groups and EIPs, making identifiers available for cross-stack referencing.

Contribution

Reza Rosli on CandyGuard

Built an Athena-backed audit query, ordered results by event time, and investigated intermittent S3 access errors.

Contribution

Reza Rosli on candylake

Introduces a dedicated reindexing queue mechanism by updating `serverless.yml` with `CandyLakeQueueUrl` and modifying `app/CandyStreamHandler.js` to use AWS SQS for queueing.

Contribution

Ele Elyiana on CandyMailbox

Renamed a configuration constant in `serverless.yml` from `SR_LABEL` to `CandyMail` in the CandyBase context.

Contribution

Ele Elyiana on CandyNumber

Added a new API endpoint, `AdminNumberLists`, to `config/function.yml` for managing number lists via HTTP POST to `/admin/list/number/{dataType}`.

Contribution

Reza Rosli on CandyNumber

Updated AWS resource reference syntax in `serverless.yml` to correctly use `${self:provider.region}` when constructing Amazon Resource Name (ARN) strings.

Contribution

Ele Elyiana on CandyPixel

Built the manager setup and form mapping, then moved website capture to an S3-backed intake path. A site could acknowledge a stored enquiry while a separate worker processed it for downstream lead ingestion.

Contribution

Ele Elyiana on candypixel.js

Established the browser capture script, adapted it for older browsers, and connected website form submissions to configurable campaign tracking.

Contribution

Reza Rosli on candypixel.js

Reorganised the browser embed around dedicated helpers in the 3.6.11 rewrite and fixed when queued submissions resume.

Contribution

Reza Rosli on CandyPixel

Updated the service’s embed template for the 3.6.11 browser rewrite and gave developers one place to swap the script URL during debugging.

Contribution

Reza Rosli on candysync-webhook

The patch in `LeadLogMarshaller.js` prevents the transmission of 'MODIFY' events for lead logs by returning null if the event type matches.

Contribution

Reza Rosli on Carousel

The service name changed from `leadRouting` to `sc-carousel`, and dependencies were updated to include `serverless-plugin-optimize` and set `package.individually: true`.

Contribution

Reza Rosli on CarouselMatcher

Persisted deferred leads in Redis and kept later team-assigned leads eligible during automatic routing.

Contribution

Ele Elyiana on cdy.ai

Updated serverless.yml to include `serverless-finch` plugins and defined custom resources for better deployment management.

Contribution

Wahidiatul Firni on cdy.ai

Explicitly passes a `permission` object containing `tenantId` and a hardcoded `userId` of "system" when setting up AWS Lambda invocation contexts across multiple services.

Contribution

Ele Elyiana on classicapi

Logging related to 'lead data' was systematically removed or modified across several commits, cleaning up console logs and removing environment-specific function definitions.

Contribution

Ele Elyiana on Clone Army

Connected template-based test leads to dynamic form fields and fixed the generator to preserve random assignment. Those changes let synthetic leads exercise the forms service and assignment handling with the intended inputs.

Contribution

Muhammad Anwaar on Clone Army

Built a browser interface for creating leads and added a repeat-lead action. It gave testers a direct way to exercise a repeat enquiry alongside the initial submission.

Contribution

Reza Rosli on Clone Army

Started from the CandyMuncher feeder and split bulk generation into queued jobs. Separate Lambda workers could generate test leads without making the initial bulk request do all the work.

Contribution

Wahidiatul Firni on Clone Army

Changed synthetic form email fields to use example addresses and updated the campaign-tracking payload. This kept generated inputs aligned with the revised lead structure while using addresses intended for examples.

Contribution

Ibrahim on crm-api

Introduces the `getForm` query to the GraphQL schema, requiring updates to `package.json`, `serverless.yml`, and adding a new mapping template.

Contribution

Ibrahim on customer-api-appsync

Adds functionality to interact with WhatsApp message templates via a new GraphQL operation, updating schemas, mapping templates, and AWS resources.

Contribution

Reza Rosli on customer-api-appsync

Implements functionality to get and update user portal preferences by adding new AWS Lambda data sources and corresponding request mapping templates.

Contribution

Muhammad Anwaar on customer-api

Refactored lead export queries from `getExportLeadList` to `getExportsList` across GraphQL and data source definitions.

Contribution

Muhammad Shoaib on customer-api

Added support for creating project groups via a new mutation, `createProjectGroup`, in the GraphQL schema and associated serverless configuration.

Contribution

Reza Rosli on customer-api

Added `getLeadActionTemplate` to retrieve a tenant's lead action template from DynamoDB, utilized in `handlers/leadActionTemplate.js`.

Contribution

Reza Rosli on export-all

Updated `main.js` to explicitly load AWS credentials from a local file path (`.aws-credentials.json`).

Contribution

Ele Elyiana on Facebook

Updates include changes to module paths and handler references, such as updating `handler` entries in `config/function.yml` to point to new or modified file paths.

Contribution

Reza Rosli on Facebook

The `serverless.yml` file was updated to remove the reference to the temporary SQS queue name, `sc-sugarrush-temp-lead`, from the provider configuration.

Contribution

Wahidiatul Firni on Facebook

Added `console.error` statements within the `list` function in `app/controller/manager/update/update.js` to log the incoming `event` and `context` objects to CloudWatch.

Contribution

Reza Rosli on fb-conversions-webhook

The message unpacking logic was updated to extract and include a `projectId` from the message body, enhancing event data context.

Contribution

Muhammad Anwaar on lead-exporter

Renames the lead export handler from `getExporedtLeads` to `getExportsList` in `handlers/leads-handler.js` to better reflect its purpose.

Contribution

Ele Elyiana on manual

The `serverless.yml` file for CandyMuncher updates the runtime environment from nodejs12.x to nodejs14.x for the staging environment.

Contribution

Muhammad Anwaar on phone-number-validator

Updated package dependencies (e.g., `libphonenumber-js`, `serverless`) and changed the runtime specified in `serverless.yml` from `nodejs8.10` to `nodejs12.x`.

Contribution

Reza Rosli on phone-number-validator

The `format` function signature was updated to accept only `(event)`, and the default country code now reads from `process.env.defaultCountryCode` instead of being hardcoded.

Contribution

Teo on phone-number-validator

Introduced a dedicated logger module (`libs/logger.js`) and updated `handler.js` to use it, alongside updating `package.json` dependencies.

Contribution

Reza Rosli on Presence

Modified `app/lib/CandyBase.js` to explicitly return `null` when `getRoutingStatus` finds no results, improving reliability over previous undefined/null returns.

Contribution

Muhammad Anwaar on PresenceLogger

The parameter order passed to the query execution within `_updateCandyBase` in `handlers/newEventsHandler.js` was updated.

Contribution

Reza Rosli on PresenceLogger

Renamed the project from `CandyBase-PresenceObserver` to `sc-presenceLogger` across `package.json` and `serverless.yml`.

Contribution

Reza Rosli on project-cpx-report

The data source for acquisition reports was updated from CandyFloss to CandyLake, reflected in both the application logic and serverless configuration.

Contribution

Reza Rosli on RoutingHours

Updated `serverless.yml` to use `RoutingHoursAlarmStateMachineName` and refactored `handler.js` to introduce `notifyRoutingHoursEvent` for better separation of concerns.

Contribution

Muhammad Anwaar on RoutingLogger

Adds infrastructure for 'carousel' logging by defining custom queue names and resources in `serverless.yml` and updating handlers.

Contribution

Reza Rosli on RoutingLogger

The log ingestion handler was updated to perform parallel insertions into both CandyBase and ElasticSearch, and simplified the reference ID generation logic.

Contribution

Reza Rosli on salesperson-action-report

The maximum size constant was reduced from 2147483647 to 1000000 in `app/lib/leadLogs.js` and `app/lib/leads.js` following an Elasticsearch upgrade.

Contribution

Ele Elyiana on sc-admin-appsync

Added administrative CRUD operations for 'CandyCrumbs' tracking to the schema, mapping templates, and function configurations within the `candyNumber` data source.

Contribution

Ibrahim on sc-admin-appsync

The `UpdateWhatsappMessageTemplateInput` now accepts a nullable list of IDs for the `id` field, changing it from a required non-nullable scalar.

Contribution

Ibrahim on sc-auth

The method for retrieving versions in CandyBase was updated from `getLatestVersion` to `getAllVersions`, changing the database query to fetch all versions instead of just the latest one.

Contribution

Muhammad Anwaar on smart-alert-es

Updated dependencies, including `@elastic/elasticsearch`, and upgraded the Node.js runtime specified in `serverless.yml` to `nodejs12.x`.

Contribution

Reza Rosli on smart-alert-es

Updated Elasticsearch client configuration to fetch credentials using AWS Secrets Manager via a new helper module, shifting away from direct environment variable reliance.

Contribution

Muhammad Anwaar on user-analytics

Refined user data retrieval using comprehensive JOINs in `candyBase.js` and implemented JWT validation in `handler.js` and `helper.js`.

Contribution

Reza Rosli on user-analytics

Simplified database initialization in `candyBase.js` by removing explicit `writerDb` handling and updating `serverless.yml` accordingly.

Contribution

Reza Rosli on usernotifications

Notification delivery logic was updated to use the new `Presence-newMsg` endpoint instead of the deprecated `Presence-sendMessage` mechanism.

Engineering

How SalesCandy routed leads

How SalesCandy coordinated routing hours, salesperson availability, assignment, and the records that explained each decision.

Engineering

SalesCandy’s v3 serverless rebuild

Three architecture diagrams from AWS Activate 2021 show how SalesCandy moved from a shared server stack to separate managed services.

Engineering

Serverless Framework

How SalesCandy used service configuration to deploy AWS Lambda functions, connect event sources, and manage infrastructure.

Engineering

Twilio

Connects SalesCandy’s lead intake and messaging services to phone calls and conversations.

Engineering

Domain-driven design

Use the language and rules of the business to shape software models and boundaries.

Engineering

Elasticsearch

Maintains search indexes derived from SalesCandy lead data.

Engineering

GitLab CI

Automates linting, tests, and builds for the manager portal.

Engineering

Hexagonal architecture

Keep business rules independent of the interfaces and services that connect them to the outside world.

Engineering

Node.js

Runs SalesCandy’s JavaScript backend handlers and shared libraries.

Product

Real-time lead routing

How SalesCandy kept unattended enquiries moving between available salespeople.

Workflow

Mobile-first follow-up

How the salesperson’s app and manager portal supported the work after assignment.

Repository

Modelling who gets the next lead

How SalesCandy used a simulator to explore why lead distribution felt uneven and what choosing a routing policy could change.

Engineering

Microservice boundaries

Divide a system by responsibility so teams can change and release services with less coordination.

Engineering

Presence-aware routing

Use a live availability signal to help decide who should get the next enquiry.

Engineering

Webhook event contracts

Treat the meaning of an outbound event as part of the interface customers depend on.

People

Jeffry Chan

SalesCandy’s co-founder and chief growth officer during its Microsoft for Startups interview.

People

Stanley Chee

SalesCandy’s co-founder and CEO in its 2019 interview with The Digital Enterprise.