exit lab
~/lab/api

API Design

Endpoint conventions, auth flows, and response shapes — sampled from the REST APIs behind each project.

H-Phsar — B2B Marketplace API

POST/authorization

Sign up, log in, and password reset flows

POST/authorization/api/v1/otp

Generate and email a 4-digit OTP to verify an account

POST/api/v1/retailer/orders

Add to cart, save drafts, and confirm a cart as a live order

GET/api/v1/distributor/reports

Order activity reports by month and year

Hengo — AI Companion for Daily Growth

POST/api/ai/chat/stream

Stream an authenticated AI coaching conversation

POST/api/ai/analyzer

Analyze workplace Korean tone and meaning

POST/api/ai/vocab/generate

Generate a structured vocabulary deck

POST/api/ai/goals/coach

Stream goal coaching with concrete next steps

Money Flow — Personal Finance PWA

GET/api/summary

Aggregated totals for the analytics dashboard

POST/api/chat

Ask Gemini a question about your own finances

GET/api/cron/recurring

Daily cron — create scheduled recurring transactions

GET/api/cron/backup

Daily cron — sync all Supabase tables to Neon

We Commerce — Multi-Vendor Marketplace

POST/api/v1/auth/register

Register with a phone number; returns JWT access + refresh tokens

POST/api/v1/auth/refresh-token

Rotate an expired access token

GET/api/v1/item/popular

Popular products ranked by view count

POST/api/v1/purchase

Place an order and generate a receipt

AuthHub — Reusable Authentication Service

POST/api/auth/login

Authenticate with credentials; issues JWT access + refresh tokens

POST/api/auth/oauth2/google

Log in by verifying a Google ID token server-side

POST/api/auth/mfa/verify

Complete login with a TOTP code or a one-time backup code

GET/api/admin/audit-logs

Query the audit trail of security events (admin)

Dev Lab — Personal Practice & Tooling Monorepo

GET/api/products

Paged product listing (heang-dev-lab store admin)

POST/api/products

Create a product — multipart or JSON body (heang-dev-lab)

GET/users

List users (heang-dev-lab)

GET/api/ping

Health check (heang-api-center)