Skip to content

john-carlo-flores/jungle-rails

Repository files navigation

Jungle

A mini e-commerce application built with Rails 6.1 for purposes of teaching Rails by example. Items marketed for sale on this application are residential, indoor plants.

Overview

Home Page/Categories

overview.mp4

Product Details

product_details.mp4

Registration/Login

registration_login.mp4

Add Items to Cart and Order

cart_order.mp4

Admin Privileges

admin.mp4

Dependencies

Getting Started

In order to run this application, you will need to have Ruby and Rails installed. If you do not know how to set it up or if you would like to learn more about it, visit this website.

Installation

Prior to installation make sure you go into the directory where you would like jungle-rails to reside.

  1. Clone the repo
git clone https://github.com/tothenextcode/jungle-rails.git
  1. Install dependencies
bundle install
  1. Setup database configuration
cp config/database.example.yml config/database.yml
  1. Setup secrets to sign and authenticate cookies
cp config/secrets.example.yml config/secrets.yml
  1. Create, load and seed database
bin/rails db:reset
  1. Setup environment variables
cp .env.example .env
  1. Sign up for a Stripe account
  2. Put Stripe (test) keys into appropriate .env vars
  3. Start the server
bin/rails s -b 0.0.0.0

Database

If Rails is complaining about authentication to the database, uncomment the user and password fields from config/database.yml in the >development and test sections, and replace if necessary the user and password development to an existing database user.

Stripe Testing

Use Credit Card # 4111 1111 1111 1111 for testing success scenarios.

More information in their docs: https://stripe.com/docs/testing#cards

Usage

Once the server is running, you will be able to view, add plants to card and order as a user. The following features are available upon application launch:

Users:

  • Plants for sale are listed on the main page.
  • Plants can also be viewed based on assigned category.
  • Users can click on a plant to view more detailed information and includes reviews from users based on selected product.
  • Users logged in can add reviews in each product details page.
  • Users can delete their own reviews.
  • Users can add items to cart by clicking on the Add button - My Cart total values are updated.
  • Users can view their cart by clicking on the My Cart.
  • Once done adding plants, users can pay for order by clicking on Pay With Card.
  • Users will be redirected to order summary page after payment and if logged in, will be sent a detailed email receipt of the order.
  • Users can register and login with provided credentials.

Admin:

  • Admins are required to sign-in with admin credentials to access admin pages.
  • Admins are provided with jungle statistics on dashboard page.
  • Admins can add/delete products.
  • Admins can add new categories.

Keep in mind that this application just simulates e-commerce for plants based on arbitrary data. Jungle-rails itself is not tied to a real e-commerce platform.

Roadmap

✔️ Bug Fix: Money Formatting

✔️ Feature: Empty Cart

✔️ Feature: Sold-out Badge

✔️ Feature: Order details

✔️ Bug Fix: Admin Security

✔️ Feature: Admin Dashboard Statistics

✔️ Feature: About Page

✔️ Feature: Admin Categories

✔️ Feature: User Authentication

✔️ Testing: Rspec Model - Product

✔️ Testing: Rspec Model - User

✔️ Testing: Cypress - Home Page

✔️ Testing: Cypress - Product Details

✔️ Testing: Cypress - Add to Cart

✔️ Testing: Cypress - User Login

✔️ Feature: Email Receipt

✔️ Feature: Product Ratings

✔️ Feature: Inventory Adjustment

❕ Bug Fix: Prevent Orders > Store Quantity

❕ Project deployment to Heroku + Netlify