SaaS codebase your AI can actually understand

A scalable, secured, production-ready SaaS boilerplate with solid foundations built for developers.

use-create-checkout.ts
packages>payment>hooks>use-create-checkout.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
'use client';

import { useMutation } from '@tanstack/react-query';
import type { CreateCheckoutSessionInput } from '../schemas';

interface UseCreateCheckoutOptions {
    onSuccess?: (url: string) => void;
    onError?: (error: Error) => void;
}

export function useCreateCheckout(options: UseCreateCheckoutOptions = {}) {
    const { onSuccess, onError } = options;

    return useMutation({
        mutationFn: async (data: CreateCheckoutSessionInput) => {
            const response = await fetch('/api/payment/create-checkout', {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify(data),
            });

            const result = await response.json();

            if (!response.ok || !result.success) {
                throw new Error(result.error || 'Failed to create checkout session');
            }

            if (!result.data?.url) {
                throw new Error('No checkout URL returned');
            }

            return result.data;
        },
        onSuccess: (data) => {
            if (data.url) {
                window.location.href = data.url;
            }
            onSuccess?.(data.url);
        },
        onError: (error: Error) => {
            onError?.(error);
        },
    });
}

Interact to explore more folders and files

Features

A complete SaaS boilerplate with all the essential features to get your product to market faster.

Authentication

Complete signin and signup system with next-auth, Google & Github OAuth.

Style

Beautiful, customizable UI components with modern designs, dark mode, and themes.

Stack

Built with modern technologies for optimal performance and developer experience.

Database

PostgreSQL with Prisma ORM, migrations, and type-safe database access.

Payments

Stripe integration with subscriptions, one-time payments, checkout, and billing portal.

Email

Flexible email delivery for transactional emails, notifications, and marketing campaigns.

Monitoring

Built-in monitoring for comprehensive user analytics and log aggregation.

Deployment

Deploy-ready workflows with environment configuration and monitoring setup.

Notifications

In-app notifications, email notifications and push notifications.

Contact

Built-in contact form with admin interface to manage and reply to customer inquiries.

Translations

Full internationalization for multi-language translations and locale routing.

Mobile application

Progressive Web App capabilities with offline support, install prompts and native experience.

Security

Built-in security features including CSRF protection, rate limiting, and secure cookies.

Bot protection

Cloudflare turnstile integration to prevent spam and abuse on forms and authentication flows.

Cookie Consent

GDPR-compliant cookie consent management with preferences and consent tracking.

How it works

Get started with Fastack in three simple steps. From purchase to production in no time.

01

Get GitHub repository access

After purchase, you'll receive instant access to the private GitHub repository. Clone it to your local machine and you're ready to start.

  • •Complete source code included
  • •Deployment workflows included
  • •Stay up to date with ongoing updates
  • •Full documentation and setup guides
02

Configure your project

Follow our step-by-step configuration guide. Set up your database, environment variables, and integrate your preferred services.

  • •Environment configuration
  • •Database setup and migrations
  • •Third-party service integration
  • •Customization and branding
03

Deploy to production

Deploy your SaaS application to production with our deployment guides.

  • •One-click deployment options
  • •Docker containerization
  • •CI/CD pipeline setup
  • •Production monitoring

Built by a developer, for developers

Antoine Depuydt - Founder of Fastack

Antoine Depuydt

Founder Fastack

Senior Tech Lead & Software Engineer

As a passionate full-stack developer with over 10 years of experience building web applications, I have been working as a Tech Lead for major European companies, where I have been leading engineering teams and architect scalable solutions.

On the side, I'm a solo developer who loves building SaaS products. I've successfully created and launched freekick.world, a platform that demonstrates the power of modern web technologies and best practices.

Fastack is the result of years of experience building SaaS applications. It's everything I wish I had when starting my first SaaS project - a solid foundation that handles all the common challenges so you can focus on what makes your product unique.

Pricing

One-time purchase. No subscriptions. No recurring fees. Get everything you need to launch your SaaS.

One-Time Purchase
Lifetime access
--.--one-time

Everything included. No hidden fees.

  • Private GitHub repository access
  • Complete source code
  • Deployment workflows
  • All features included
  • Full documentation
  • Lifetime updates
  • Email support

Pay once. Build unlimited ideas!

Frequently asked questions

Everything you need to know about Fastack

Fastack | SaaS codebase your AI can actually understand