Tokko is an open-source Rails e-commerce starter kit built with Rails 8.1, PostgreSQL, Hotwire, and Stripe. It includes the core commerce building blocks — products with variants, Stripe checkout, customer accounts, discount coupons, inventory tracking, and an admin dashboard — as a starting point for your own store.
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
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
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
- Ruby version from
.ruby-version(currently Ruby 4.0.3) - PostgreSQL 14+, running locally
For Stripe checkout/webhook development (optional — see Stripe development below):
- A Stripe account
- Stripe CLI
Make sure PostgreSQL is running locally, then:
git clone https://github.com/omkz/tokko.git
cd tokko
bin/setupbin/setup will:
- install gems, if needed
- initialize local Rails credentials, if
config/credentials.yml.encdoesn't exist yet - prepare the development database
- run development seed data on a new database
- clear temp/log files
- start
bin/dev
Use bin/setup --skip-server to run setup without starting the development server.
bin/setup --reset is also available, but it's destructive: it deletes and recreates the development database. Don't reach for it as a routine troubleshooting step.
Rails application credentials are used only for Stripe secrets. config/master.key decrypts them and must never be committed — a fresh bin/setup creates its own credentials/key pair automatically, so there's usually nothing to do here for local development.
To add Stripe credentials yourself:
bin/rails credentials:editstripe:
secret_key: sk_test_...
webhook_secret: whsec_...(These are placeholders — never commit real credentials.)
Production database and SMTP configuration use environment variables instead of credentials — see docs/operations/deployment.md for deployment details.
bin/dev # Start server + Tailwind watcher (port 3000)Development-only demo account (created by db/seeds/development.rb):
Email: admin@tokko.com
Password: password
This account is created only by the development seed and is never created in production.
Log in at http://localhost:3000/dashboard.
Stripe is optional until you want to exercise checkout or webhook flows. bin/dev does not start the Stripe CLI.
- Add test Stripe credentials:
bin/rails credentials:edit
stripe: secret_key: sk_test_... webhook_secret: whsec_...
- In a separate terminal, forward webhook events:
Copy the webhook signing secret it prints into
stripe listen --forward-to localhost:3000/webhooks/stripe
stripe.webhook_secretabove.
Without Stripe credentials configured, checkout will not complete — everything else in the storefront and dashboard works fine on its own.
A clean checkout needs Tailwind CSS built once before request/system specs that render layouts:
RAILS_ENV=test bin/rails tailwindcss:build
bundle exec rspec # Full suite
bundle exec rspec spec/models/product_spec.rb # Single fileCode quality:
bin/rubocop # Linting
bin/brakeman # Security audit
bin/bundler-audit # Gem vulnerability checkThis project includes a Kamal configuration. Update config/deploy.yml with your server IP, image registry, domain, mail settings, and PostgreSQL connection (DB_HOST/DB_PORT/DB_USERNAME), then set the production database password and deploy:
export TOKKO_DATABASE_PASSWORD='...'
bin/kamal config # sanity-check the resolved configuration locally
bin/kamal setup # first deployRAILS_MASTER_KEY (from config/master.key) is read from .kamal/secrets automatically by Kamal 2 whenever a command needs it — there's no separate push step. Don't commit real secrets; .kamal/secrets only contains variable references, and actual values come from your shell environment or secret manager.
For subsequent deploys:
bin/kamal deploySee docs/operations/deployment.md for PostgreSQL provisioning, healthcheck details, mail/SMTP environment variables, SSL options, and a post-deploy verification checklist.
Production does not create a default administrator. Bootstrap the first owner explicitly; see docs/operations/deployment.md.
See docs/operations/backup-and-restore.md for the disaster recovery runbook — what to back up, how to verify a backup, and how to restore production.
Contributions are welcome. See CONTRIBUTING.md.
MIT — see LICENSE.