šŸ“¢ Have a product idea? Check out our new SaaS template!

Our new SaaS template is here!

Iā€™m excited to introduce our new SaaS template - designed to help you get your product up and running quickly! It combines the best of Anvil and Stripe to give you everything you need to build, manage, and scale your app. It includes built-in user permissions to control access to features and integrates with Stripe to easily handle user subscriptions.

Why Use The SaaS Template?

This template is a solid foundation for building your own SaaS app. It gives you:

Stripe Payment Integration

The template app handles payments with a fully integrated Stripe checkout. Itā€™s configured easily from your Stripe dashboard and takes users into Stripes checkout flow - ensuring a smooth and secure transaction with your users. It also uses Stripeā€™s pricing tables to display your prices.

Subscription Management

Users can subscribe, upgrade, downgrade, or cancel their plans using Stripeā€™s customer portal. All while the backend integration built into the SaaS template keeps everything in sync.

Account Management

Account management is integrated, allowing users to do things like update their email and have it synced automatically with Stripe.

User Permissions

The permission system is wrapped in a simple-to-use decorator, making it easy to enforce subscription-based access to functionality.

For example, this function is only allowed to be run by users with a ā€œpersonalā€ or ā€œproā€ subscription:

@anvil.server.callable(require_user=user_has_subscription(["personal, pro"]))
def calculate_percentage_of(number, total_number):
    percentage = (int(number) / int(total_number)) * 100
    return percentage

Overall, its aim is to be an ideal starting point for your project.


Itā€™s Open Source

Want to contribute to the template or extend it? Itā€™s open source and can be found on GitHub: GitHub - anvil-works/saas-template: SaaS Template - Built with Anvil

Weā€™d love for you to pitch in and help us improve the template for future users. The template is just an Anvil app, so if you fork the repository and open it in Anvil , you can work directly from the Anvil Editor.

Please still raise general Anvil issues here on the forum.


Get started

Hereā€™s my full guide which teaches you exactly how to set up the template:

Happy product building!
Ryan

15 Likes

Thatā€™s very cool! Now if I only had a great product ideaā€¦

3 Likes

I appreciate the effort that went into this! I have personally been working on a boilerplate for quite some time, but more for multi-tenant apps. So I have features like:

  • Differentiating PermissionDenied errors between situations where the user doesnā€™t have the right role in their tenant or where the feature is not available on their plan
  • Role based permissions, which allow me to flexibly change the permissions allocated to each plan without making changes in the code

I do like the idea of a @catch_permission_errors decorator and may adapt that to my use caseā€¦ I was looking for an elegant way to handle the whole ā€˜prompt users to upgradeā€™ in my client code

3 Likes

This is a great idea! I think many people were waiting for a SaaS template like this.

1 Like

With best practices, templates, and more Anvil is starting to feel like the Ruby on Rails of Python web apps. Excellent!

4 Likes