
Tech Stack
Description
SpendPilot is a cloud cost-optimization SaaS built with a Next.js frontend and a Python/Flask backend using SQLAlchemy, backed by Azure Database for PostgreSQL. The stack was chosen for Next.js's strong Clerk/Stripe integration, and for future data-analysis needs (pandas/PySpark) on the Python backend.
Authentication combines a custom login flow with Clerk's prewritten components (organization-profile, create-profile) for team and profile management — reusing solved auth UI instead of rebuilding it, while keeping full control over the core login logic.
Billing runs on Stripe Checkout and the Stripe Customer Portal, connected through a webhook endpoint. Stripe's server calls the backend when an event happens (e.g. a successful payment) — the backend never has to poll or rely on the frontend, which keeps subscription status reliably in sync.
- Deployments are automated with a bash script (build → tag → push → Azure Container App update), saving roughly 5 minutes per deploy.
- Runs on Azure Container Apps with Azure Container Registry; Azure PostgreSQL's IP allowlist needs periodic updates since the ISP-assigned IP changes.
- Azure was chosen deliberately over AWS to learn Azure Postgres and Container Apps together, keeping AWS as an easier future migration target.