Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

ai_saas_app

> 前端框架
Open source

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

1.4K stars0 likes1 views
WebsiteGitHub

About

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

An AI SaaS Platform

Table of Contents

  1. Introduction
  2. ⚙️ Tech Stack
  3. Features
  4. Quick Start
  5. ️ Snippets
  6. Links
  7. More

Tutorial

This repository contains the code corresponding to an in-depth tutorial available on our YouTube channel, JavaScript Mastery.

If you prefer visual learning, this is the perfect resource for you. Follow our tutorial to learn how to build projects like these step-by-step in a beginner-friendly manner!

Introduction

Build an AI image SaaS platform that excels in image processing capabilities, integrates a secure payment infrastructure, offers advanced image search functionalities, and supports multiple AI features, including image restoration, recoloring, object removal, generative filling, and background removal. This project can be a guide for your next AI image tool and a boost to your portfolio.

If you're getting started and need assistance or face any bugs, join our active Discord community with over 27k+ members. It's a place where people help each other out.

⚙️ Tech Stack

  • Next.js
  • TypeScript
  • MongoDB
  • Clerk
  • Cloudinary
  • Stripe
  • Shadcn
  • TailwindCSS

Features

Authentication and Authorization: Secure user access with registration, login, and route protection.

Community Image Showcase: Explore user transformations with easy navigation using pagination

Advanced Image Search: Find images by content or objects present inside the image quickly and accurately

Image Restoration: Revive old or damaged images effortlessly

Image Recoloring: Customize images by replacing objects with desired colors easily

Image Generative Fill: Fill in missing areas of images seamlessly

Object Removal: Clean up images by removing unwanted objects with precision

Background Removal: Extract objects from backgrounds with ease

Download Transformed Images: Save and share AI-transformed images conveniently

Transformed Image Details: View details of transformations for each image

Transformation Management: Control over deletion and updates of transformations

Credits System: Earn or purchase credits for image transformations

Profile Page: Access transformed images and credit information personally

Credits Purchase: Securely buy credits via Stripe for uninterrupted use

Responsive UI/UX: A seamless experience across devices with a user-friendly interface

and many more, including code architecture and reusability

Quick Start

Follow these steps to set up the project locally on your machine.

Prerequisites

Make sure you have the following installed on your machine:

  • Git
  • Node.js
  • npm (Node Package Manager)

Cloning the Repository

bash
git clone https://github.com/adrianhajdin/imaginify.git
cd imaginify

Installation

Install the project dependencies using npm:

bash
npm run dev

Set Up Environment Variables

Create a new file named .env.local in the root of your project and add the following content:

env
#NEXT
NEXT_PUBLIC_SERVER_URL=

#MONGODB
MONGODB_URL=

#CLERK
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
WEBHOOK_SECRET=

NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/

#CLOUDINARY
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=

#STRIPE
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=

Replace the placeholder values with your actual respective account credentials. You can obtain these credentials by signing up on the Clerk, MongoDB, Cloudinary and Stripe

Running the Project

bash
npm run dev

Open http://localhost:3000 in your browser to view the project.

️ Snippets

tailwind.config.ts
…
globals.css
…
constants/index.ts
…
user.model.ts
…
transaction.model.ts
typescript
import { Schema, model, models } from "mongoose";

const TransactionSchema = new Schema({
  createdAt: {
    type: Date,
    default: Date.now,
  },
  stripeId: {
    type: String,
    required: true,
    unique: true,
  },
  amount: {
    type: Number,
    required: true,
  },
  plan: {
    type: String,
  },
  credits: {
    type: Number,
  },
  buyer: {
    type: Schema.Types.ObjectId,
    ref: "User",
  },
});

const Transaction = models?.Transaction || model("Transaction", TransactionSchema);

export default Transaction;
InsufficientCreditsModal.tsx
…
user.action.ts
…
utils.ts
…
types/index.d.ts
…
api/webhooks/clerk/route.ts
…
components/shared/CustomField.tsx
…
components/shared/Collection.tsx
…
components/shared/Search.tsx
…
image.actions.ts
…
transformations/[id]/page.tsx
…
transformations/[id]/update/page.tsx
…
components/shared/DeleteConfirmation.tsx
…
api/webhooks/stripe/route.ts
…
credits/page.tsx
…
components/shared/Checkout.tsx
…
profile/page.tsx
…

Links

Public Assets used in the project can be found here

More

Advance your skills with Next.js 14 Pro Course

Enjoyed creating this project? Dive deeper into our PRO courses for a richer learning adventure. They're packed with detailed explanations, cool features, and exercises to boost your skills. Give it a go!



Accelerate your professional journey with the Expert Training program

And if you're hungry for more than just a course and want to understand how we learn and tackle tech challenges, hop into our personalized masterclass. We cover best practices, different web skills, and offer mentorship to boost your confidence. Let's learn and grow together!

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptclerkcloudinarynext14nextjs

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架