Backend

Backend

9 pieces of work

Tagly

Pricing each customer's post from 9 factors

Built the engine that decides how much a customer is paid for posting about a business. The engine prices each post from 9 factors. Three of the factors:

  • Geography: how far the customer's audience lives from the business, geocoded through AWS Location.
  • Authenticity: the account's size and its follower-to-following ratio. Smaller, more authentic accounts earn more than large ones.
  • Anti-spam: the more often someone posts, the lower each reward.

Every factor is stored on the reward, along with the version of the code that priced it. Any past payout can be recomputed exactly.

  • PostgreSQL and PostGIS
  • Kysely
  • Instagram Graph API
  • AWS

Tagly

Anti-fraud checks for each share

Built the checks that stop Tagly from paying for a fake or repeated share. Every share has to pass AWS Rekognition, which reads the picture to confirm the right business was tagged. A cap in the pricing stops reshares from inflating a post's reach. A record of paid posts survives account deletion, so the same post can't be paid twice. Banned Instagram accounts are kept on a list, so a banned account can't be linked to a new Tagly account.

  • AWS
  • Instagram Graph API

Tagly

Sign-in and per-account auth

Built sign-in and authentication across Tagly. Customers and businesses sign in with an email and a one-time code, or with Apple or Google. Customers can also sign in with Instagram, offered for anyone who's forgotten their email. One-time codes have attempt limits, resend limits and lockouts. After sign-in, every request carries a JWT with the caller's public uid. The uid's prefix is different for each account type, so the backend knows whether a customer, a business or an admin is calling. Each endpoint is only reachable by the account type it was built for.

  • Express
  • Resend
  • TypeScript

Tagly

Full Instagram integration, approved by Meta

Built the Instagram integration that lets Tagly read statistics of the posts it pays for. The integration covers account connection, token refresh and permission handling, plus the data-deletion callbacks Meta requires before granting access in the Meta App Review. Two background workers collect the data. One pulls post-level insights for every share. The other takes a snapshot of the customer's account when they connect Instagram or create a share.

  • Instagram Graph API
  • Node.js

Tagly

7 background services

Built the 7 background services that handle Tagly's work outside of API requests. All 7 run on ECS Fargate and share one framework. The services cover database maintenance, notifications, payments, Stripe reconciliation, cleanup, Instagram post insights collection and Instagram profile snapshot collection.

  • Node.js
  • AWS
  • Docker

Tagly

52 notifications across push and email

Built the 52 notifications Tagly sends, across 11 categories: balance, shares, referrals, security, marketing and more. Each notification goes out as a push notification, an email, or both. Security and legal notices are mandatory. Every other notification can be turned off per channel. Marketing notifications that would land overnight wait until morning, and go out as a push first, with an email only if the push wasn't acted on. Marketing email also sends from a separate subdomain, so spam complaints can't stop an important notification from arriving.

  • Resend
  • Expo
  • Node.js

Tagly

Hundreds of queries per screen, down to 2

Cut the cost of calculating the earnings estimate a customer sees on every business in the app, in two steps. Each business used to cost 11 database queries, run one after another, and 7 of those fetched the same customer data again every time. At its limit of 75 businesses, a full map screen would have cost around 825 queries. Moving the 7 customer-related queries out of the per-business loop, and running the rest in parallel, brought a full screen down to about 307. Then every estimate was cached in Redis per customer and per business, so loading a screen again costs 2 Redis reads. Counters on the customer and the business clear an estimate the moment anything that affects its price changes. If Redis is down, estimates fall back to live pricing.

  • Redis
  • PostgreSQL and PostGIS
  • Kysely

Tagly

From a customer's Instagram story to a payout

Built the lifecycle every share on Tagly goes through, from a customer posting a story to Instagram to getting paid for it. An admin approves each share. 24 hours after the story goes up, a worker collects the post's data and a snapshot of the customer's profile. A share is only paid out once both steps are done. The price comes from the pricing engine, based on the collected data.

  • Instagram Graph API
  • PostgreSQL and PostGIS
  • Prisma

Tagly

Rate limits on Redis

Built the rate limits that protect Tagly's REST API from abuse. There's one limit for signed-out traffic, one per logged-in account, and tighter limits on high-security endpoints like login. All the limits live in Redis, so each limit is shared across every server instead of counted per server.

  • Redis
  • Express