From 912661eb6e6adf69ade8817650ec1a9c06943cbd Mon Sep 17 00:00:00 2001 From: Kurnia Muhamad Date: Mon, 25 May 2026 11:59:27 +0700 Subject: [PATCH 1/2] Add README for starter kit Documents features, quick start, credentials setup, Stripe webhook configuration, development commands, and deployment with Kamal. --- README.md | 141 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 128 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 7db80e4..f1ed11b 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,139 @@ -# README +# Tokko — Rails E-Commerce Starter Kit -This README would normally document whatever steps are necessary to get the -application up and running. +A production-ready e-commerce starter kit built with Rails 8.1. Ships with everything you need to launch an online store: products with variants, Stripe checkout, customer accounts, discount coupons, inventory tracking, and a full-featured admin dashboard. -Things you may want to cover: +## Features -* Ruby version +**Storefront** +- Product catalog with variants, options, and faceted filtering +- Category and collection pages +- Full-text product search +- Cart and Stripe Checkout (with coupon support) +- Customer accounts — order history, saved addresses, wishlist +- Magic link authentication (no password required) +- SEO-ready — meta tags, Open Graph, slug-based URLs with redirect history -* System dependencies +**Dashboard** +- Product management — create products, generate variants from options (Size × Color) +- Inventory tracking with movement history +- Order management with status flow (`pending → paid → shipped → completed`) +- Coupon/discount codes — percentage or fixed, with expiry and usage limits +- Collections and categories management +- User roles — Owner, Admin, Staff -* Configuration +**Technical** +- Rails 8.1, PostgreSQL, Hotwire (Turbo + Stimulus), Tailwind CSS +- Stripe Checkout + webhook handling +- Background jobs via Solid Queue, caching via Solid Cache +- FriendlyId slug URLs with history (301 redirects when slugs change) +- N+1 protection via Prosopite in development and test +- RSpec test suite -* Database creation +## Requirements -* Database initialization +- Ruby 4.0+ +- PostgreSQL 14+ +- Node.js (for Tailwind CSS watcher) +- A [Stripe](https://stripe.com) account -* How to run the test suite +## Quick Start -* Services (job queues, cache servers, search engines, etc.) +```bash +git clone my-store +cd my-store +bin/setup +``` -* Deployment instructions +`bin/setup` installs dependencies, creates and seeds the database, and starts the server at `http://localhost:3000`. -* ... +To reset the database and start fresh: + +```bash +bin/setup --reset +``` + +## Configuration + +All secrets are managed via Rails credentials. Open the credentials file: + +```bash +bin/rails credentials:edit +``` + +Add the following: + +```yaml +stripe: + secret_key: sk_test_... + webhook_secret: whsec_... + +smtp: + user_name: your@email.com + password: your-smtp-password +``` + +**Stripe webhook** — in development, use the Stripe CLI to forward events: + +```bash +stripe listen --forward-to localhost:3000/webhooks/stripe +``` + +Copy the webhook signing secret it prints and add it to credentials as `stripe.webhook_secret`. + +## Development + +```bash +bin/dev # Start server + Tailwind watcher (port 3000) +``` + +**Default admin account** (created by seed): + +``` +Email: admin@tokko.com +Password: password +``` + +Log in at `http://localhost:3000/dashboard`. + +## Testing + +```bash +bundle exec rspec # Full suite +bundle exec rspec spec/models/product_spec.rb # Single file +``` + +**Code quality:** + +```bash +bin/rubocop # Linting +bin/brakeman # Security audit +bin/bundler-audit # Gem vulnerability check +``` + +## Deployment + +This project includes a [Kamal](https://kamal-deploy.org) configuration. Update `config/deploy.yml` with your server IP and image registry, then: + +```bash +kamal setup # First deploy +kamal deploy # Subsequent deploys +``` + +Set `RAILS_MASTER_KEY` on your server (found in `config/master.key`): + +```bash +kamal env push +``` + +## Roadmap + +- [ ] Role-based authorization (Pundit) +- [ ] Audit log for admin actions (PaperTrail) +- [ ] Store settings (name, logo, currency) +- [ ] Custom error pages (404, 500) +- [ ] Product reviews +- [ ] Shipping rate configuration + +## License + +MIT From 6f4783be4f01fc3df933fa273bc37313334bf640 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 05:10:52 +0000 Subject: [PATCH 2/2] Bump bootsnap from 1.24.3 to 1.24.5 Bumps [bootsnap](https://github.com/rails/bootsnap) from 1.24.3 to 1.24.5. - [Release notes](https://github.com/rails/bootsnap/releases) - [Changelog](https://github.com/rails/bootsnap/blob/main/CHANGELOG.md) - [Commits](https://github.com/rails/bootsnap/compare/v1.24.3...v1.24.5) --- updated-dependencies: - dependency-name: bootsnap dependency-version: 1.24.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e4bb67d..72faef2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -83,7 +83,7 @@ GEM bcrypt_pbkdf (1.1.2) bigdecimal (4.1.2) bindex (0.8.1) - bootsnap (1.24.3) + bootsnap (1.24.5) msgpack (~> 1.2) brakeman (8.0.4) racc @@ -523,9 +523,10 @@ CHECKSUMS bcrypt_pbkdf (1.1.2) sha256=c2414c23ce66869b3eb9f643d6a3374d8322dfb5078125c82792304c10b94cf6 bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd bindex (0.8.1) sha256=7b1ecc9dc539ed8bccfc8cb4d2732046227b09d6f37582ff12e50a5047ceb17e - bootsnap (1.24.3) sha256=f7fa3d20597e2f0aa52b0a1aba83fb54d4f79e9c2e210ec4fa1e8895514dcad8 + bootsnap (1.24.5) sha256=36b677448524d279b470469aabd5dff4a980e3fa4931a0df68da4a500eb1b6c4 brakeman (8.0.4) sha256=7bf921fa9638544835df9aa7b3e720a9a72c0267f34f92135955edd80d4dcf6f builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f + bundler (4.0.12) sha256=7f8b757d28dfb636e7b24fba2344ac6dd13b5b24f4b46d62573d483f211825ac bundler-audit (0.9.3) sha256=81c8766c71e47d0d28a0f98c7eed028539f21a6ea3cd8f685eb6f42333c9b4e9 capybara (3.40.0) sha256=42dba720578ea1ca65fd7a41d163dd368502c191804558f6e0f71b391054aeef childprocess (5.1.0) sha256=9a8d484be2fd4096a0e90a0cd3e449a05bc3aa33f8ac9e4d6dcef6ac1455b6ec