Skip to content

shuttle-hq/axum-next-fullstack-saas

Repository files navigation

Shuttle SaaS Example

Introduction

This template is a SaaS template with a Next.js Typescript frontend and a Rust backend. The design of the template internally is based on a sales-oriented Customer Relationship Management (CRM) tool where users will be able to view their customers, sales records as well as some analytics.

Features

  • Take subscription payments with Stripe
  • Email session-based login
  • Mailgun (email subscription, welcome email etc)
  • Pre-configured frontend routes for easy transition
  • Examples of how to implement simple dashboard analytics

Pre-requisites

  • Rust
  • Node.js/NPM
  • Typescript
  • Shuttle CLI

Instructions for Usage

  • Initialize the template with:

    shuttle init --from shuttle-hq/shuttle-examples --subfolder fullstack-templates/saas
  • cd into the folder

  • Run npm i to install the dependencies on the frontend.

  • Set your secrets in the Secrets.toml file at the Cargo.toml level of your backend folder. Unset secrets will default to "None" to prevent automatic crashing of the web service, but some services may not work.

Development Scripts

  • Using dev for Development:
    • Run npm run dev to start your application with live reload capabilities. This script uses turbowatch to monitor changes in both the frontend and backend.
    • Visit http://localhost:8000 once the app has built.
    • If you prefer using cargo-watch instead of turbowatch, the watch feature can be disabled in the turbowatch.ts file.
  • Frontend-Focused Development with next-dev:
    • For a frontend-specific development workflow, use npm run next-dev.
    • This script runs Next.js in a development mode optimized for faster builds and reloads, enhancing your frontend development experience.
  • Analyzing Bundle Size with analyze:
    • The analyze script is designed to provide insights into the bundle size of your Next.js application.
    • Run npm run analyze to generate a detailed report of the size of each component and dependency in your bundle.
    • This is particularly useful for identifying large dependencies or components that could be optimized for better performance.

Main page for Next.js + Shuttle Saas Template

Troubleshooting

  • If you change the migrations after running locally or deploying, you will need to go into the database itself and delete the tables. You can do this easily with something like psql or pgAdmin.
  • If connecting to external services like Stripe doesn't work, try checking your Secrets.toml file.
  • Shuttle connects by default to port 8000 - if you're currently already using something at port 8000, you can add the --port <port-number> to the shuttle run command to change this.

Shuttle template: axum-next-fullstack-saas

This template (repo) is a synced replica from shuttle-examples.

Deploy on Shuttle with just a few clicks!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages