Each article takes one mechanism and follows the same order: the problem it solves, the design, the shape of the data or the logic, the ways it can fail with the test that covers each, and the limits I know about.
The first three are about money: the kernel every point movement goes through, the keys that make a retry harmless, and the two places where points meet the banking system. The next two are about running the service: a scheduler that must fire once on a two-process cluster, and account checks that take effect at the next request. The sixth is the product’s central state machine. The last three cover the retrieval model behind the chatbot, the marketing-data layer, and the mobile client.
- 1 Points: a stored balance and a ledger row in one transaction Every point movement in CASHPOCKET is one conditional balance update and one ledger row in one MongoDB transaction. Two concurrent debits that exceed the balance are settled by the database.
- 2 Idempotency keys: naming the thing being paid for Each money operation that can be retried carries a key built from the thing it pays for. A lookup makes a repeat cheap, and a partial unique index makes two simultaneous first attempts safe.
- 3 Payments: card top-up, cash-out, and a structure built around cash-convertibility Where points meet the banking system: a card top-up claimed before the provider is called and credited once, a cash-out written with its debit, and a structure built around cash-convertibility.
- 4 Scheduled jobs on one of two instances The server runs as two pm2 processes that boot the same code. Only instance 0 starts the scheduler, so a reward is paid once and a KakaoTalk message is sent once.
- 5 Account checks from Redis, and refresh tokens that rotate Every request re-checks the account against Redis in front of MongoDB. Refresh tokens rotate on use, with a per-user lock and a 120-second grace window for concurrent refreshes.
- 6 Campaign and application lifecycle A campaign has eight states and each application under it has its own. People move some transitions, dates move the rest, two evaluations decide a submission, and a separate claim pays the reward.
- 7 The FAQ chatbot as a hybrid retriever MongoDB text search fused with per-FAQ embedding cosine, a lexical short-circuit, a model fallback and human escalation, answers logged. An evaluation showed the score is not a confidence value.
- 8 Marketing data and the influencer index One tracker feeding GA4, the Meta Pixel and error logs, UTM first touch on the user, a daily ad sync, cost per sign-up per creative reported as a range, and three scores behind an A to F grade.
- 9 The mobile app: a second client of the same API A React Native and Expo app on the web's backend: one token refresh with a request queue, push with open tracking, deep links, and a tested contract file for the web paths it intercepts.
CASHPOCKET is a company product, so these articles show schema shapes and pseudo-code written for the page instead of source excerpts. Field names, state names and thresholds are the ones in the code.
