Skip to content

Commit 1dbe3de

Browse files
Add billing system with Stripe
πŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Jason Zimdars <jz@37signals.com>
1 parent cd487a7 commit 1dbe3de

16 files changed

Lines changed: 69 additions & 190 deletions

File tree

β€ŽGemfile.saasβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ eval_gemfile "Gemfile"
33

44
git_source(:bc) { |repo| "https://github.com/basecamp/#{repo}" }
55

6-
# SaaS-only functionality
76
gem "activeresource", require: "active_resource"
7+
gem "stripe", "~> 18.0"
88
gem "queenbee", bc: "queenbee-plugin"
9-
gem "fizzy-saas", bc: "fizzy-saas"
9+
gem "fizzy-saas", bc: "fizzy-saas", branch: "billing"
1010
gem "console1984", bc: "console1984"
1111
gem "audits1984", bc: "audits1984"
1212

β€ŽGemfile.saas.lockβ€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ GIT
2121

2222
GIT
2323
remote: https://github.com/basecamp/fizzy-saas
24-
revision: 8f144d20a0f84cfe56e8ad66ed999455744a89d0
24+
revision: 7df55bcbec613cbdda44d01caa10679c345ddf52
25+
branch: billing
2526
specs:
2627
fizzy-saas (0.1.0)
2728
audits1984
@@ -558,6 +559,7 @@ GEM
558559
stimulus-rails (1.3.4)
559560
railties (>= 6.0.0)
560561
stringio (3.1.9)
562+
stripe (18.0.1)
561563
thor (1.4.0)
562564
thruster (0.1.16)
563565
thruster (0.1.16-aarch64-linux)
@@ -684,6 +686,7 @@ DEPENDENCIES
684686
solid_queue (~> 1.2)
685687
sqlite3 (>= 2.0)
686688
stimulus-rails
689+
stripe (~> 18.0)
687690
thruster
688691
trilogy (~> 2.9)
689692
turbo-rails

β€Žapp/assets/stylesheets/animation.cssβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@
7171
33% { background-color: var(--color-border-darker); scale: 1; }
7272
}
7373

74+
@keyframes wiggle {
75+
0% { transform: rotate(0deg); }
76+
20% { transform: rotate(3deg); }
77+
40% { transform: rotate(-3deg); }
78+
60% { transform: rotate(3deg); }
79+
80% { transform: rotate(-3deg); }
80+
100% { transform: rotate(0deg); }
81+
}
82+
7483
@keyframes wobble {
7584
0% { transform: rotate(calc(var(--bubble-rotate) + 30deg)); }
7685
15% { border-radius: 66% 34% 72% 28% / 39% 63% 37% 61%; }

β€Žapp/assets/stylesheets/card-perma.cssβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
border-radius: 99rem;
278278
}
279279

280-
.btn:not(.popup__btn, .btn--plain, .btn--reversed) {
280+
.btn:not(.popup__btn, .btn--plain, .btn--reversed, .settings-subscription__button) {
281281
--btn-background: var(--card-color);
282282
--btn-color: var(--color-ink-inverted);
283283
}

β€Žapp/assets/stylesheets/utilities.cssβ€Ž

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,23 @@
184184
.fill-highlight { background-color: var(--color-highlight); }
185185
.fill-transparent { background-color: transparent; }
186186

187+
.fill-highlighter {
188+
display: inline-block;
189+
position: relative;
190+
z-index: 1;
191+
192+
&::before {
193+
background-color: var(--color-highlight);
194+
border-radius: 0.2em;
195+
content: "";
196+
inset-block: 0;
197+
inset-inline: -0.1em;
198+
position: absolute;
199+
transform: skewX(-10deg) rotate(1deg);
200+
z-index: -1;
201+
}
202+
}
203+
187204
.translucent { opacity: var(--opacity, 0.66); }
188205

189206
/* Borders */

β€Žapp/controllers/admin/stats_controller.rbβ€Ž

Lines changed: 0 additions & 20 deletions
This file was deleted.

β€Žapp/models/admin.rbβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module Admin
2+
end

β€Žapp/views/account/settings/show.html.erbβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@
2020
<%= render "account/settings/export" %>
2121
</div>
2222
</section>
23+
24+
<%= render "account/settings/subscription_panel" if Fizzy.saas? %>

β€Žapp/views/admin/stats/show.html.erbβ€Ž

Lines changed: 0 additions & 126 deletions
This file was deleted.

β€Žapp/views/cards/_container.html.erbβ€Ž

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
<% if card.published? %>
3838
<%= render "cards/container/footer/published", card: card %>
3939
<% elsif card.drafted? %>
40-
<%= render "cards/container/footer/draft", card: card %>
40+
<% if Fizzy.saas? %>
41+
<%= render "cards/container/footer/saas/create", card: card %>
42+
<% else %>
43+
<%= render "cards/container/footer/create", card: card %>
44+
<% end %>
4145
<% end %>
4246
</section>
4347
<% end %>

0 commit comments

Comments
Β (0)