finds.dev← search

// the find

adrianhajdin/ai_saas_app

★ 1,354 · TypeScript · updated Jul 2024

Build a REAL Software-as-a-Service app with AI features and payments & credits system that you might even turn into a side income or business idea using Next.js 14, Clerk, MongoDB, Cloudinary AI, and Stripe.

A YouTube tutorial project from JavaScript Mastery that walks through building an image transformation SaaS — restore, recolor, background removal, generative fill — with Clerk auth, MongoDB, Cloudinary, and Stripe credits. The target audience is developers learning how to wire together third-party services into a working product, not people looking for a production-ready codebase to fork.

The credits system uses MongoDB's $inc operator, which avoids the race condition you'd get from a read-then-write; that's the right call. Webhook handlers for both Clerk and Stripe do proper signature verification (svix and Stripe's own library), so the auth surface isn't wide open. The server actions + Next.js App Router structure is clean and follows current conventions correctly. Cloudinary handles all the actual AI heavy lifting, which means zero ML infrastructure to manage.

The handleError utility in utils.ts throws a brand-new Error wrapping the message string, which discards the original stack trace entirely — when something breaks in production you'll see 'Error: Error: ...' with no useful location. JSON.parse(JSON.stringify(doc)) is used to serialize every Mongoose document returned from the DB; this strips virtuals, breaks Date objects, and is a footgun that will surprise anyone who extends the models. The any type appears throughout the image-related types and TransformationForm props, so TypeScript is mostly decorative in the core transformation flow. The 'AI' in the title is doing heavy marketing work — every AI operation is a single Cloudinary API call; there's no prompt engineering, no model interaction, and no logic that would transfer to a different AI stack.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →