Spark Credit






An application aiming to bring lending to small medical clinics to increase revenue and customer acquisition.
Stack
- Vercel - Deployments, metrics, ci/cd
- Next.js (V15 stable) - The base UI framework for routing server rendering, static pages, and other web related needs.
- tRPC - API layer for client side data fetching and mutations. Most of the Spark's data fetching and mutations are done in server actions with direct secure Supabase access.
- Sanity - Sanity CMS is used to serve marketing content.
- Typescript - bacause there is no reason not to have type safety.
- Supabase - Rather than manage a self hosted postgress instance Supabase provides everything needed to handle Spark's data. Migrations are handled automatically though the Drizzle.js ORM framework.
- Clerk - Auth is hard, and Clerk helps me move fast. The database for Spark is synced with Clerk user management via webhook functions that I built right into Supabase.
- Shadcn / Tailwind - The need for fast simple styles makes shadcn and tailwind easy to choose.
About Spark
Spark is something I've been working on in my spare time, exploring the idea of a SaaS solution for small businesses that want to offer microloans to qualifying customers for products and services.
Building Spark has been a huge learning experience for me. While I’m primarily a front-end developer, I’ve picked up a decent amount of knowledge on the back end. I’m no expert in databases, API architecture, or advanced topics like caching, but I’ve got a solid understanding of what makes a backend work well. That’s why I love using tools like Supabase and Clerk—if someone’s already built what I need, I can save a lot of time (and money) knowing I’m working with solid, best-practice solutions for things like authentication and data persistence.
Next.js has been a great tool for interacting with my database directly through server actions, and I lean on Supabase functions for handling authorization when I’m fetching or mutating data. Designing the database schema was one of those necessary steps where I had to dust off my old college notes to make sure it was well normalized. Maybe one day I’ll dive deeper into backend work just for the learning experience, but for now, I’m focused on making the app work.
Identifying Unique Challenges
One of the biggest challenges with Spark is something that might seem simple at first but is actually quite complex behind the scenes. Clinics need to quickly and securely get customers approved for credit. To make this happen, I’ve integrated an SMS service like Twilio or Prelude. This allows me to create a secure session where new customers can scan a QR code linked to a clinic and quickly complete a soft credit check. Once the microloan is selected, a new customer is created, and lending can begin.