A mini e-commerce application that sells plants, built with Rails 6.1. It had an already existing code-base where new features and UI changes needed to be implemented, plus bugs that needed to be fixed.
Money Formatting: All the prices need to have the same format (=> $24.99).Missing Admin Security: Implement HTTP Basic Authentication in all the pages accessible to an Admin.Sold Out Item added to Cart: Disable the "Add" to Cart button for all products that are sold out.
Admin Dashboard: Add a Dashboard for Admin where they can see the products and categories count.About Page: Add an About page for the website.Admin Categories: Add a page where an Admin can check the current categories and add a new one via a form.User Authentication: Implement 'Login', 'Register' and 'Logout' buttons. When a user is logged-in, the nav bar displays a message: 'Welcome, #username!'.Email Receipt: When a user successfully places an order, an email with the order's details is sent to them automatically.Product Rating: A visitor can see a product's average rating while browsing the catalog. They can also see a list of ratings and reviews when they visit the product's page. When logged-in, a user can leave a review or delete past reviews.
Empty Cart: When the cart is empty, it displays to the user a friendly message stating that their cart is empty, plus a button to go back to Home Page.Sold Out Badge: When a product is sold out, a red badge showing "Sold Out" is displayed when you browse the catalog.Order Details: When a user successfully places an order, they get redirected to a page where the ordered items, their image, name, description, quantities, final amount and email used by the user, are displayed.
Rspecwas used to test the Product and User Models.Cypresswas used to test the Home Page, Product Details, Add to Cart and User Login.
git clonethe project- Run
bundle installto install dependencies - Create
config/database.ymlby copyingconfig/database.example.yml - Create
config/secrets.ymlby copyingconfig/secrets.example.yml - Run
bin/rails db:resetto create, load and seed db - Create .env file based on .env.example
- Sign up for a Stripe account
- Put Stripe (test) keys into appropriate .env vars
- Run
bin/rails s -b 0.0.0.0to start the server
Use Credit Card # 4111 1111 1111 1111 for testing success scenarios.
More information in their docs: https://stripe.com/docs/testing#cards
- Rails 6.1 Rails Guide
- Bootstrap 5
- PostgreSQL 9.x
- Stripe
- bycrypt
- Cypress
- Rspec
