/ Phase01
The challenge
An AI chat interface becomes a real product only when identity, persistence, usage limits, billing entry points, and application state work together. The challenge was designing those systems as one coherent experience rather than treating the model call as the entire application.
/ Phase02
The approach
Clerk handles authentication while Prisma and PostgreSQL store users, threads, messages, and credit state. The backend checks available credits before calling Gemini, stores completed exchanges, and deducts usage after successful responses. Stripe Checkout Sessions provide the payment-entry workflow.