E-commerce app using Rails 7, PostgreSQL, Hotwire (Turbo + Stimulus), Tailwind CSS, Cloudinary, and Stripe
MIT License
E-commerce app. Shop online with Shopline. You shop, we ship!
Prerequisites
Create .env
file at the root of the project directory. Copy the content of .env.template.erb
to .env
then update the username
and password
based on your database credentials. Get STRIPE_SECRET_KEY
and STRIPE_WEBHOOK_SECRET
from your Stripe account
Install dependencies and setup database
bin/setup
Start local web server
bin/dev
Go to http://localhost:3000
Use Stripe CLI to simulate Stripe events in your local environment or learn more about Webhooks
stripe listen --forward-to localhost:3000/stripe_webhooks
To test Stripe payments, use the following test card details:
4242 4242 4242 4242
https://yourdomain.com/stripe_webhooks
).checkout.session.completed
, customer.created
).Setup test database
bin/rails db:test:prepare
Default: Run all spec files (i.e., those matching spec/**/*_spec.rb)
bin/rspec
Run all spec files in a single directory (recursively)
bin/rspec spec/models
Run a single spec file
bin/rspec spec/models/product_spec.rb
Use the plain-English descriptions to generate a report of where the application conforms to (or fails to meet) the spec
bin/rspec --format documentation spec/models/product_spec.rb
Run a single example from a spec file (by line number)
bin/rspec spec/models/product_spec.rb:8
See all options for running specs
bin/rspec --help