Project: Affirm

Affirm thumbnail 1
Affirm thumbnail 2
Affirm main image

Merchant Analytics Dashboard

Affirm

Web ApplicationServerless

A real-time analytics dashboard for Affirm merchants to visualize customer conversion rates, AOV increases, and payment plan selection patterns.

Completion DateMarch 19, 2025
Project Day3 of 10

Project Demo

Project Metrics

7
Hours Spent
4,552
Lines of Code
2,000
Lines of Markdown
$24.96
LLM Cost

Project Details

The Merchant Analytics Dashboard empowers merchants with real-time insights about their Affirm integration, demonstrating clear ROI and helping identify opportunities to improve conversion. It provides visibility into how offering Affirm as a payment option impacts business metrics.

Business Value

  • Data-Driven Decisions
  • Merchant Insights

Key Features

Real-time Analytics Dashboard

Visualizes key metrics like AOV and transaction volume with support for hourly and daily granularities.

Order Simulation Form

Allows merchants to simulate orders with different parameters, supports multiple merchants for comparison, and includes option to simulate payment failures.

Event-Driven Processing

Uses DynamoDB Streams to trigger real-time aggregation, calculates metrics like AOV and volume in real-time, and stores aggregated data in S3 for efficient retrieval.

Merchant-Specific Analytics

Enforces merchant granularity for all analytics queries and provides insights tailored to each merchant's integration.

Technologies Used

Frontend

ReactTypeScriptCSS ModulesChart.js/D3.jsViteTanstack Router

Backend

Node.jsExpressserverless-httpAWS Lambda

DevOps

AWS CDKDynamoDBS3API Gateway

Other

Real-time AnalyticsEvent-Driven Architecture

Challenges & Solutions

Lambda dependency bundling issues

Updated API implementation to properly bundle dependencies and added necessary packages to package.json.

DynamoDB Stream processing for real-time aggregates

Implemented a Lambda function triggered by DynamoDB Streams to calculate real-time aggregates.

Date comparison logic in analytics endpoint

Fixed the filtering logic to extract just the date part from ISO timestamps and added detailed logging.

Key Learnings

  • Memory Bank Pattern: The memory bank approach is becoming more efficient with each project, making it easier to track progress and stay focused.
  • Business Value Alignment: The project directly addresses Affirm's top three business risks, demonstrating how technical solutions can align with business priorities.
  • AWS Serverless Architecture: DynamoDB Streams provide an elegant solution for real-time event processing without polling.
  • Project Research: More upfront research into company priorities can help focus the project on high-impact areas.