Jungle is a mini e-commerce application built for the purpose of learning Rails by example.
Built with Rails 4.2, PostgreSQL, Bootstrap and CSS/ Sass. Tested using RSpec, Capybara ( Poltergeist, PhantomJS).
The idea behind this project was to inherit a partially-completed project and fix existing bugs, add new features, pages, and test different functionalities.
- Empty cart checkout
- Adding an out-of-stock item to cart
- Price formatting (humanized money formatting and leading '$' signs)
- Shop-wide sales that offer periodic discount on products
- "Sold Out" badge for products that are out of stock
- Basic http-athentication for Admin features
- Admin dashboard which offers viewing/adding new categories/sales
- User authentication for login/signup through bcrypt
- Order details to to view product summary after payment
-
Models:
- User
- Product
- Category
-
Features - Capybara (Poltergeist/PhantomJS):
- User login
- Add-to-cart
- Product details page
- Home page
- Clone or download this repository
git clone /~https://github.com/adamhirzalla/jungle
- Navigate to the project directory and install dependencies
cd jungle-rails && bundle
- Create
config/database.yml
cp config/database.example.yml config/database.yml
- Create
config/secrets.yml
cp config/secrets.example.yml config/secrets.yml
- Create, load, and seed the database
bin/rake db:reset
- Sign up for a Stripe account
- Create
.env
and update with your own Stripe & admin infocp .env.example .env
- Launch the development web server
bin/rails s -b 0.0.0.0
- Visit http://localhost:3000/ on your browser
-
Run BDD tests (RSpec)
rspec
-
Manually test Stripe checkout scenarios using the following info:
# Card number 4242 4242 4242 4242 # Expiration date (or any future date) 05/33 # CVC (any 3 numbers) 123
- Check out the Stripe docs for more info: https://stripe.com/docs/testing#cards
- Rails 4.2 Rails Guide
- PostgreSQL 9.x
- Stripe