---
title: Deploy Moneygun with AI on Blossom
url: "/deploy/moneygun/"
canonical_url: https://blossom88.com/deploy/moneygun/
markdown_url: https://blossom88.com/deploy/moneygun.md
summary: Start a multi-tenant Rails app and create a project in your first organization.
categories:
- deployment
- rails
stack:
- Ruby
- Rails
- Hotwire
- PostgreSQL
---

# Deploy Moneygun with AI on Blossom

[Moneygun](https://github.com/yshmarov/moneygun) is Yaroslav
Shmarov's [MIT-licensed Rails SaaS starter](https://github.com/yshmarov/moneygun/blob/main/LICENCE.md).
It gives you organizations, memberships, and email-code sign-in
so you can start with your app's own features.

## Ask Your Agent

> **Ask your AI agent:** Deploy Moneygun on Blossom and help me create a project in my first organization.
>
> Follow this guide: https://blossom88.com/deploy/moneygun/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and [choose a Location in your cloud account](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#connect-your-provider).

## Have Ready

- **Email delivery** (Required): Use a private mail sink for a workshop or configure your SMTP provider to receive sign-in codes.
- **x86 Location** (Required): The upstream image build uses an x86 ClamAV package.
- **Object storage and Stripe** (Later): Configure your bucket for uploads and Stripe when you enable billing.

## How It Runs

| Part | Role | Where |
|---|---|---|
| Rails web | Sign-in, organizations, and projects | App Capacity |
| GoodJob worker | Deliver sign-in emails from the job queue | Private Service on App Capacity |
| PostgreSQL | Users, memberships, projects, jobs, and query statistics | Private Persistent Service with a Volume |
| Mailpit | Receive test sign-in codes | App Capacity behind Blossom Account access |

## Deploy Moneygun

Build the upstream Dockerfile in an x86 Location. Run Rails and
GoodJob as separate Services. Give PostgreSQL a Volume and enable
`pg_stat_statements`, which Moneygun uses for query statistics. Keep
the workshop and test mailbox behind Blossom Account access.

<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom app:create --data app.yml
    blossom environment:create --data environment.yml
    blossom git_repo:create --data moneygun-source.yml
    blossom environment:build_config:update --id environment-100 --data dockerfile.yml
    blossom service:create --data postgres.yml
    blossom service:create --data mailpit.yml
    blossom service:create --data web.yml
    blossom service:create --data worker.yml
    blossom env_var:push --environment environment-100 --file moneygun.env
    blossom environment:deploy --id environment-100 --follow
    blossom job:run:create --environment environment-100 --data prepare-schema.yml
    blossom service:scale --id service-web-100 --desired-size 1 --follow
    blossom service:scale --id service-worker-100 --desired-size 1 --follow

</details>

<details class="optional-reading" markdown="1">
<summary>Notes for your agent</summary>

Start PostgreSQL on a Persistent Service with its Volume at
`/var/lib/postgresql/data`. Preload and install `pg_stat_statements`
during database initialization. Give Rails a limited database owner
role and use its private connection URL as `DATABASE_URL`.

For the first deploy, start PostgreSQL and Mailpit with Rails and
GoodJob scaled to zero. When PostgreSQL is ready, run
`bin/rails db:prepare` as a Job from the built release. Set the same
command as the Release Phase hook for later deploys. Start Rails with
the `/up` health check, then start GoodJob with the generated web
hostname. Keep `SECRET_KEY_BASE` stable and route test SMTP through
Mailpit's private Service address.

</details>

## Sign In With an Email Code

Request a code for a test address, open it in the mail sink, and
enter it in Moneygun. Complete the test profile when prompted.

> **Ask your AI agent:** Help me sign in to Moneygun using a code from the private mail sink.

> Follow this guide: https://blossom88.com/deploy/moneygun/



## Create a Project

Create a workshop organization. Add a project and check that it
appears in that organization's project list.

> **Ask your AI agent:** Create a workshop organization and add a sample project.

> Follow this guide: https://blossom88.com/deploy/moneygun/



![View the project list in Workshop Studio.](/deploy/assets/images/moneygun/workshop-projects.webp)

## Reopen the Project After an Update

Replace the web Container, keeping PostgreSQL and the worker.
In a fresh session, request a new code and reopen the original project.

> **Ask your AI agent:** Replace the web Container and help me reopen the same project.

> Follow this guide: https://blossom88.com/deploy/moneygun/



<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom service:scale --id service-web-100 --desired-size 0 --follow
    blossom service:scale --id service-web-100 --desired-size 1 --follow

</details>

![Reopen the same organization project after replacing the web Container.](/deploy/assets/images/moneygun/workshop-project-after-replacement.webp)

## What You Get

- A private Rails starter on your own HTTPS address
- Sign-in with a one-time email code
- A sample project inside your first organization
- The same project after a Container update

Tested on Blossom: A fresh email-code sign-in reopened the same organization project after replacing the web Container.
