kern 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +13 -2
- data/README.md +15 -13
- data/Rakefile +3 -3
- data/app/assets/builds/tailwind.kern.css +1749 -0
- data/app/controllers/kern/billing_profiles/subscriptions_controller.rb +37 -0
- data/app/controllers/kern/billing_profiles/subscriptions_controller.rb.tt +37 -0
- data/app/controllers/kern/settings/subscriptions_controller.rb +6 -0
- data/app/controllers/kern/signups_controller.rb +1 -1
- data/app/models/billing_profile/subscription.rb +16 -0
- data/app/models/billing_profile.rb +7 -0
- data/app/models/session.rb +1 -1
- data/app/models/signup.rb +1 -1
- data/app/models/user.rb +1 -1
- data/app/models/workspace/access.rb +3 -0
- data/app/models/workspace/access.rb.tt +10 -0
- data/app/models/workspace/billable.rb +16 -0
- data/app/models/workspace/feature_access.rb +28 -0
- data/app/models/workspace/members.rb +9 -7
- data/app/models/workspace/setup.rb +5 -3
- data/app/models/workspace.rb +2 -0
- data/app/views/components/_dialog.html.erb +36 -0
- data/app/views/kern/pages/welcome.html.erb +10 -6
- data/app/views/kern/settings/_cards.html.erb +11 -3
- data/app/views/kern/settings/subscriptions/_plan.html.erb +35 -0
- data/app/views/kern/settings/subscriptions/show.html.erb +11 -0
- data/app/views/kern/settings/users/show.html.erb +2 -2
- data/app/views/kern/signups/new.html.erb +2 -0
- data/app/views/layouts/kern/application.html.erb +4 -2
- data/app/views/layouts/kern/application.html.erb.tt +2 -1
- data/app/views/layouts/kern/auth.html.erb +2 -2
- data/app/webhooks/stripe/base.rb +31 -0
- data/app/webhooks/stripe/checkout_session_completed.rb +46 -0
- data/app/webhooks/stripe/customer_subscription_deleted.rb +20 -0
- data/app/webhooks/stripe/customer_subscription_updated.rb +33 -0
- data/bin/release +2 -3
- data/config/initializers/stripe.rb +5 -0
- data/config/initializers/stripe.rb.tt +3 -0
- data/config/routes.rb +4 -0
- data/db/migrate/20250101000007_create_billing_profiles.rb +14 -0
- data/db/migrate/20250101000008_create_billing_profile_subscriptions.rb +20 -0
- data/lib/generators/kern/feature/USAGE +1 -0
- data/lib/generators/kern/feature/feature_generator.rb +82 -19
- data/lib/generators/kern/install/install_generator.rb +43 -7
- data/lib/generators/kern/install/templates/POST_INSTALL +25 -0
- data/lib/generators/kern/install/templates/configurations/plans.yml +43 -0
- data/lib/generators/kern/install/templates/configurations/stripe.yml +11 -0
- data/lib/generators/kern/layouts/layouts_generator.rb +12 -0
- data/lib/kern/version.rb +1 -1
- metadata +27 -5
- data/app/assets/builds/tailwind.css +0 -2
- data/lib/generators/kern/views/USAGE +0 -22
- data/lib/generators/kern/views/views_generator.rb +0 -42
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d18817224e28d4f7ed96d2d6c805ee1a9a5ab6afc6c6b052ed661d0ac35949bc
|
|
4
|
+
data.tar.gz: 4261479514032c6e87caccd6b59c9e7d5fbfa3ab68a9a903d808f0021121e4a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b68dd99d028916c30b5b44f5b85a7890cfade3185bb4ec6ca26a061f3d6027ddede1476b41cbc1189bd15df2d24d1aa6852731a4d702558e5c1807e85b54d977
|
|
7
|
+
data.tar.gz: 2d00f1333f735d2ef44d10f72d9a560b2cd074596527f3fb67a074f23b46ba9c5cb8574defb555ca2844f3a590dfb9d00d50814d85326d94d6cc158c73ac41e8
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
kern (0.
|
|
4
|
+
kern (0.7.0)
|
|
5
5
|
rails (>= 8.0.0)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -194,6 +194,9 @@ GEM
|
|
|
194
194
|
rails-html-sanitizer (1.6.2)
|
|
195
195
|
loofah (~> 2.21)
|
|
196
196
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
197
|
+
rails_vault (0.1.0)
|
|
198
|
+
rails (>= 7.2.2)
|
|
199
|
+
store_attribute (>= 1.3)
|
|
197
200
|
railties (8.1.1)
|
|
198
201
|
actionpack (= 8.1.1)
|
|
199
202
|
activesupport (= 8.1.1)
|
|
@@ -252,7 +255,10 @@ GEM
|
|
|
252
255
|
standard-performance (1.9.0)
|
|
253
256
|
lint_roller (~> 1.1)
|
|
254
257
|
rubocop-performance (~> 1.26.0)
|
|
258
|
+
store_attribute (2.0.1)
|
|
259
|
+
activerecord (>= 6.1)
|
|
255
260
|
stringio (3.1.9)
|
|
261
|
+
stripe (18.0.1)
|
|
256
262
|
tailwindcss-rails (4.4.0)
|
|
257
263
|
railties (>= 7.0.0)
|
|
258
264
|
tailwindcss-ruby (~> 4.0)
|
|
@@ -300,9 +306,11 @@ DEPENDENCIES
|
|
|
300
306
|
propshaft
|
|
301
307
|
puma
|
|
302
308
|
rails (~> 8.1.0)
|
|
309
|
+
rails_vault
|
|
303
310
|
rake (~> 13.3.0)
|
|
304
311
|
sqlite3
|
|
305
312
|
standard (~> 1.50.0)
|
|
313
|
+
stripe
|
|
306
314
|
tailwindcss-rails
|
|
307
315
|
turbo-rails
|
|
308
316
|
|
|
@@ -337,7 +345,7 @@ CHECKSUMS
|
|
|
337
345
|
io-console (0.8.1) sha256=1e15440a6b2f67b6ea496df7c474ed62c860ad11237f29b3bd187f054b925fcb
|
|
338
346
|
irb (1.15.3) sha256=4349edff1efa7ff7bfd34cb9df74a133a588ba88c2718098b3b4468b81184aaa
|
|
339
347
|
json (2.17.1) sha256=e0e4824541336a44915436f53e7ea74c687314fb8f88080fa1456f6a34ead92e
|
|
340
|
-
kern (0.
|
|
348
|
+
kern (0.7.0)
|
|
341
349
|
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
|
|
342
350
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
343
351
|
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
@@ -375,6 +383,7 @@ CHECKSUMS
|
|
|
375
383
|
rails (8.1.1) sha256=877509b7aef309239978685883097d2c03e21383a50a3f78882cf9b3b5c136f7
|
|
376
384
|
rails-dom-testing (2.3.0) sha256=8acc7953a7b911ca44588bf08737bc16719f431a1cc3091a292bca7317925c1d
|
|
377
385
|
rails-html-sanitizer (1.6.2) sha256=35fce2ca8242da8775c83b6ba9c1bcaad6751d9eb73c1abaa8403475ab89a560
|
|
386
|
+
rails_vault (0.1.0) sha256=ac98a27a1ef563735948ba5278ec2da8d2cebfab843bea8ee27dfdcbbe79dda5
|
|
378
387
|
railties (8.1.1) sha256=fb0c7038b147bea41bf6697fa443ff1c5c47d3bb1eedd9ecf1bceeb90efcb868
|
|
379
388
|
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
380
389
|
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
|
|
@@ -397,7 +406,9 @@ CHECKSUMS
|
|
|
397
406
|
standard (1.50.0) sha256=b6c67f61fd6cedeec90ee338c6e913d9ccc4c467660ad1575da8aa6ba10f4aec
|
|
398
407
|
standard-custom (1.0.2) sha256=424adc84179a074f1a2a309bb9cf7cd6bfdb2b6541f20c6bf9436c0ba22a652b
|
|
399
408
|
standard-performance (1.9.0) sha256=49483d31be448292951d80e5e67cdcb576c2502103c7b40aec6f1b6e9c88e3f2
|
|
409
|
+
store_attribute (2.0.1) sha256=643655e4800655b58379e8b01bd524f5586093a9d88698483ac8762cda25b5ab
|
|
400
410
|
stringio (3.1.9) sha256=c111af13d3a73eab96a3bc2655ecf93788d13d28cb8e25c1dcbff89ace885121
|
|
411
|
+
stripe (18.0.1) sha256=9be1f8e286b9046591496d09b83c48b3c5256b9864d67076baac3985d0cc4f22
|
|
401
412
|
tailwindcss-rails (4.4.0) sha256=efa2961351a52acebe616e645a81a30bb4f27fde46cc06ce7688d1cd1131e916
|
|
402
413
|
tailwindcss-ruby (4.1.16) sha256=d30e4713152bb89ebe1fddb5b5f9b31d7755bf5576453e601eb58b19174c48c0
|
|
403
414
|
tailwindcss-ruby (4.1.16-aarch64-linux-gnu) sha256=916554206b47b4218ba9130ee369687a6546fba0224b7168f118e4f955b2f97e
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Kern
|
|
2
2
|
|
|
3
|
-
Rails engine that handles the SaaS foundation: authentication, team invitations, subscription/billing, and common partials. Skip the boilerplate and start shipping the actual product.
|
|
3
|
+
Rails engine that handles the SaaS foundation: authentication, team invitations, subscription/billing, and common partials. Skip the boilerplate and start shipping the actual product.
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
<table>
|
|
@@ -15,6 +15,11 @@ Rails engine that handles the SaaS foundation: authentication, team invitations,
|
|
|
15
15
|
<img src="https://raw.githubusercontent.com/Rails-Designer/kern/HEAD/.github/kern__dashboard.jpg" alt="Dashboard" width="400">
|
|
16
16
|
</a>
|
|
17
17
|
</td>
|
|
18
|
+
<td>
|
|
19
|
+
<a href="https://raw.githubusercontent.com/Rails-Designer/kern/HEAD/.github/kern__subscriptions.jpg" target="_blank">
|
|
20
|
+
<img src="https://raw.githubusercontent.com/Rails-Designer/kern/HEAD/.github/kern__subscriptions.jpg" alt="Subscriptions" width="400">
|
|
21
|
+
</a>
|
|
22
|
+
</td>
|
|
18
23
|
</tr>
|
|
19
24
|
</table>
|
|
20
25
|
|
|
@@ -72,10 +77,7 @@ Kern works out of the box after installation. All features are available immedia
|
|
|
72
77
|
|
|
73
78
|
### Generators
|
|
74
79
|
|
|
75
|
-
If you want to customize any available
|
|
76
|
-
|
|
77
|
-
- `bin/rails generate kern:views`;
|
|
78
|
-
- `bin/rails generate kern:feature`.
|
|
80
|
+
If you want to customize any available feature (e.g. sign up, log in, etc.), you can run: `bin/rails generate kern:feature`.
|
|
79
81
|
|
|
80
82
|
Append `--help` to see the generator's help.
|
|
81
83
|
|
|
@@ -105,12 +107,12 @@ Update user's email and password.
|
|
|
105
107
|
|
|
106
108
|
### Multi-tenancy
|
|
107
109
|
|
|
108
|
-
By default a `Workspace` record is created upon sign up. Each
|
|
110
|
+
By default a `Workspace` record is created upon sign up. Each `User` is associated to it using a `Member` join table. Each `Member` can have multiple `Role`'s you can use to authorize if they should have access (`Current.member.has_role? :owner`).
|
|
109
111
|
|
|
110
112
|
|
|
111
113
|
### Billing & subscriptions using Stripe
|
|
112
114
|
|
|
113
|
-
Following [Rails Designer's Stripe Billing set up](https://railsdesigner.com/saas/billing-with-stripe/), offer subscriptions right away.
|
|
115
|
+
Following [Rails Designer's Stripe Billing set up](https://railsdesigner.com/saas/billing-with-stripe/), offer subscriptions right away. Just update `config/configurations/plans.yml` and add your Stripe API key and Signing secret to your credentials.
|
|
114
116
|
|
|
115
117
|
|
|
116
118
|
### Team invitations
|
|
@@ -118,7 +120,7 @@ Following [Rails Designer's Stripe Billing set up](https://railsdesigner.com/saa
|
|
|
118
120
|
Add more users to your `Workspace`, update roles or remove them again.
|
|
119
121
|
|
|
120
122
|
|
|
121
|
-
### Form
|
|
123
|
+
### Form builder
|
|
122
124
|
|
|
123
125
|
Pulled from [Rails Designer's Components](https://railsdesigner.com/components/), the included Form Builder lets you quicly build beautiful forms. Including a magic `input` helper that works like this:
|
|
124
126
|
|
|
@@ -131,13 +133,13 @@ Pulled from [Rails Designer's Components](https://railsdesigner.com/components/)
|
|
|
131
133
|
```
|
|
132
134
|
|
|
133
135
|
|
|
134
|
-
### Component
|
|
136
|
+
### Component helper
|
|
135
137
|
|
|
136
138
|
Some basic components are included like:
|
|
137
139
|
|
|
138
140
|
- container; keep all your app's content in check
|
|
139
141
|
- heading; have consistent headings for each screen
|
|
140
|
-
- enhanced dialog element (works with Turbo Frames and
|
|
142
|
+
- enhanced dialog element (works with Turbo Frames and, includes `centered` or a `drawer` variants)
|
|
141
143
|
- flash messages (notifiy your users from the bottom-right)
|
|
142
144
|
|
|
143
145
|
These are built using vanilla Rails, as [described in this article]() (`component` helper included).
|
|
@@ -155,17 +157,17 @@ When using Turbo Stream responses, use `turbo_stream.notify "Updated"` to notifi
|
|
|
155
157
|
|
|
156
158
|
## Rails Icons support
|
|
157
159
|
|
|
158
|
-
The application/dashboard layout and the Form Builder have support for [Rails Icons](https://github.com/Rails-Desiger/rails_icons).
|
|
160
|
+
The application/dashboard layout and the Form Builder have optional support for [Rails Icons](https://github.com/Rails-Desiger/rails_icons). Run `bin/rails generate rails_icons:install --libraries=phosphor` to enable them.
|
|
159
161
|
|
|
160
162
|
|
|
161
163
|
### Sluggable concern
|
|
162
164
|
|
|
163
|
-
If you do not want to expose the record's primary key, use the `Sluggable` concern. Include it in the model, make sure it has a (unique) `slug` column, and look up records
|
|
165
|
+
If you do not want to expose the record's primary key, use the `Sluggable` concern. Include it in the model, make sure it has a (unique) `slug` column, and look up records using `ModelName.sluggable.find(params[:id])`.
|
|
164
166
|
|
|
165
167
|
|
|
166
168
|
### Configuration
|
|
167
169
|
|
|
168
|
-
Little syntactic sugar on top of Rails' `config_for` as explained [in this article](https://railsdesigner.com/saas/configuration/). Keep configuration together in, e.g. `config/configuration/urls.yml` and call each value like `Config::Urls.docs
|
|
170
|
+
Little syntactic sugar on top of Rails' `config_for` as explained [in this article](https://railsdesigner.com/saas/configuration/). Keep configuration together in, e.g. `config/configuration/urls.yml` and call each value like `Config::Urls.docs`.
|
|
169
171
|
|
|
170
172
|
|
|
171
173
|
## Contributing
|
data/Rakefile
CHANGED
|
@@ -16,12 +16,12 @@ namespace :assets do
|
|
|
16
16
|
desc "Build Tailwind CSS for distribution"
|
|
17
17
|
task :precompile do
|
|
18
18
|
Dir.chdir("test/dummy") do
|
|
19
|
-
sh "
|
|
19
|
+
sh "bundle exec tailwindcss -i app/assets/tailwind/application.css -o app/assets/builds/tailwind.kern.css"
|
|
20
20
|
|
|
21
21
|
FileUtils.mkdir_p "../../app/assets/builds"
|
|
22
22
|
FileUtils.cp(
|
|
23
|
-
"app/assets/builds/tailwind.css",
|
|
24
|
-
"../../app/assets/builds/tailwind.css"
|
|
23
|
+
"app/assets/builds/tailwind.kern.css",
|
|
24
|
+
"../../app/assets/builds/tailwind.kern.css"
|
|
25
25
|
)
|
|
26
26
|
end
|
|
27
27
|
end
|