Saasfly Documentation

repository·main·Indexed 25 days ago

https://github.com/nextify-limited/saasfly

An enterprise-grade, open-source Next.js boilerplate for building SaaS applications. It provides a complete stack including authentication, database management, payments, and UI components, featuring integration with Prisma, tRPC, Contentlayer, and Tailwind CSS.

Tokens
23.3K
Snippets
34
Records
189
Agent score
83%

What's inside Saasfly

  1. Build documentation using Contentlayer and MDX

    main

    The documentation site is built using Contentlayer and MDX. This allows you to write content in MDX format, which is then transformed and validated by Contentlayer.

    Key features include:

    • MDX components like <Callout /> and <Card />.
    • Support for Table of Contents and custom navigation (prev/next pager).
    • Syntax highlighting via shiki and rehype-pretty-code for enhanced code blocks.
  2. Style vanilla HTML content with the Tailwind CSS prose class

    main

    To style unstyled HTML content (such as content from a CMS or Markdown files) without disabling Tailwind's base styles, use the @tailwindcss/typography plugin. This plugin provides a prose class that applies beautiful, well-formatted typography to any block of vanilla HTML content.

    Apply the prose class to a wrapper element (like <article>) to automatically style headings, paragraphs, lists, and code blocks within it.

    <article class="prose">
      <h1>Garlic bread with cheese: What the science tells us</h1>
      <p>
        For years parents have espoused the health benefits of eating garlic bread
        with cheese to their children...
      </p>
      <p>
        But a recent study shows that the celebrated appetizer may be linked to
        a series of rabies cases springing up around the country.
      </p>
    </article>
  3. Configure environment variables and database

    main

    After installation, set up your environment variables by copying the example file. You must have a PostgreSQL database ready (e.g., Vercel Postgres or a local instance) before running the database push command. Use the POSTGRES_URL key in your .env.local file.

    cp .env.example .env.local
    # (you must have a database prepared before running this command)
    bun db:push
  4. Set up Saasfly environment and database

    main

    After installation, follow these steps to configure your environment and synchronize your database schema:

    1. Copy the example environment file to .env.local.
    2. Ensure you have a PostgreSQL database ready (e.g., Vercel Postgres or a local instance).
    3. Run the database push command to sync the schema.
    4. Start the development server.
    cp .env.example .env.local 
    # Ensure POSTGRES_URL is set in .env.local before running the next command
    bun db:push
    bun run dev:web
  5. Configure and run Saasfly locally

    main

    After installation, follow these steps to set up your environment and start the development server:

    1. Set up environment variables: Copy the example environment file to .env.local. Note that you must have a database ready before proceeding.
      cp .env.example .env.local 
    2. Push database schema: Use the db:push command to sync your schema.
      bun db:push  
    3. Start the development server: Run the web server.
      bun run dev:web
    4. Access the app: Open http://localhost:3000 in your browser.

    Optional: To view your Tailwind CSS configuration in the browser, run:

    bun run tailwind-config-viewer

    And visit http://localhost:3333.

    cp .env.example .env.local 
    bun db:push  
    bun run dev:web
  6. Access the Admin Dashboard (Alpha)

    main

    The admin dashboard is currently in alpha and provides static pages. To access it:

    1. Set the ADMIN_EMAIL environment variable in .env.local to your email (e.g., ADMIN_EMAIL="admin@saasfly.io,root@saasfly.io").
    2. Access the dashboard at host:port/admin/dashboard.