Declared
Code Review Dashboard
The Problem
ShipStation has a bug that's been open for 8+ years: when a Shopify order has an ORDER-LEVEL discount (like '20% off you...
The Database
The database has 6 tables (called 'models' in Prisma). Session stores Shopify login info. Shop stores each merchant's se...
Webhook Intake
When Shopify creates or updates an order, it sends a webhook (an HTTP request) to our app. This is the front door — the ...
The Queue
After an order qualifies, it's dropped into an AWS SQS FIFO queue — think of it as a single-file waiting line. The queue...
The Worker
The worker is an AWS Lambda function that sits between the queue and the order processor. It reads messages from SQS, ca...
The Math
This is the heart of the app — the discount calculator. It takes Shopify's discount information, calculates a ratio (lik...
The Orchestrator
This is the big boss function — processOrder(). At 1,040 lines, it's the largest file in the codebase. It coordinates th...
ShipStation API
The ShipStation client is how we read and write customs data. It handles authentication (Basic auth with encrypted crede...
Shopify API
We use Shopify's GraphQL Admin API to fetch full order details — specifically the discount allocations and line item pri...
Verification
After pushing corrected customs values to ShipStation, we read them back via the API and compare what we sent vs what Sh...
Email Notifications
The app sends 8 types of email notifications via Resend (an email API service). Error alerts, review needed, plan limit ...
Billing & Plans
The app has 4 billing tiers: Free (20 orders/month), Starter ($9.99, 100 orders), Growth ($24.99, 500 orders), and Pro (...
The Dashboard
The merchant-facing UI is built with Shopify Polaris (their design system) and Remix (a React framework). There are page...
Security & Infrastructure
ShipStation API credentials are encrypted with AWS KMS in production (AES-256-CBC locally for development). All routes a...
Built for reviewing the Declared codebase
~23,400 lines across 99 files