A mini e-commerce application built with Rails 6.1. Jungles allows a consumer to add and remove products from a cart. In addition the shop owner can create new categories of products, and add new products to each caterogry. Finally the consumer can sum their order and checkout using stripe's api to process the payment.
- 🔗 Jungle
- Table of Content
- 🌟 Features
- 🚀 Getting Started
- ⚫ Endpoints
- 🧱 Main Structure
- 📦 Tech Stack (Dependencies)
⚠️ Disclaimer
- A consumer can browse, view, and add to cart a number of proudcts from different categories.
- A consumer can pay for their order and recieve an order summary.
- A store owner can view a dashboard which shows the number of categories, products, and sales currently in their store.
- A store owner can add or delete sales, catergories, and proudcts to and from their store.
- A store owner would need to authenticate before being able to access sensitive areas such as thier dashboard.
- Fork and clone the repository.
- Install all dependencies using the
bundle install
command1. - Create
config/database.yml
by copyingconfig/database.example.yml
- Create
config/secrets.yml
by copyingconfig/secrets.example.yml
- Run
bin/rails db:reset
to 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.0
to start the server - Visit http://127.0.0.1:3000 or localhost:3000 in your browser (port defaults to 3000).
- To authenticate user use
Jungle
andbook
when prompted.
- 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 passworddevelopment
to an existing database user.
- Use Credit Card # 4111 1111 1111 1111 for testing success scenarios. More information in the stripe docs
- Base URL : http://127.0.0.1:3000
Http method | path | Description |
---|---|---|
GET |
/ |
products#index |
GET |
/login |
sessions#new |
POST |
/login |
sessions#create |
GET |
/logout |
sessions#destroy |
GET |
/signup |
users#new |
POST |
/users |
users#create |
GET |
/admin |
admin/dashboard#show |
GET |
/admin/products |
admin/products#index |
POST |
/admin/products |
admin/products#create |
GET |
/admin/products/new |
admin/products#new |
DELETE |
/admin/products/:id |
admin/products#destroy |
GET |
/admin/categories |
admin/categories#index |
POST |
/admin/categories |
admin/categories#create |
GET |
/admin/categories/new |
admin/categories#new |
DELETE |
/admin/categories/:id |
dmin/categories#destroy |
GET |
/admin/sales |
admin/sales#index |
POST |
/admin/sales |
admin/sales#create |
GET |
/admin/sales/new |
admin/sales#new |
DELETE |
/admin/sales/:id |
admin/sales#destroy |
GET |
/about |
about#index |
GET |
/products |
products#index |
GET |
/products/:id |
products#show |
GET |
/categories/:id |
categories#show |
POST |
/orders |
orders#create |
GET |
/orders/:id |
orders#show |
POST |
/users |
users#create |
GET |
/users/new |
users#new |
POST |
/cart/add_item |
carts#add_item |
POST |
/cart/remove_item |
carts#remove_item |
GET |
/cart |
carts#show |
├─── .github
├─── app
├─── bin
├─── config
├─── cypress
├─── db
├─── lib
├─── log
├─── public
├─── spec
├─── storage
├─── test
├─── tmp
├─── vendor
├─── .browserlistrc
├─── .env.example
├─── .gitignore
├─── .ruby-version
├─── Gemfile
├─── Gemfile.lock
├─── README.md
├─── Rakefile
├─── babel.config.js
├─── config.ru
├─── cypress.json
├─── package-lock.json
├─── package.json
└─── postcss.config.js
- This is a project for LHL web development bootcamp and is not meant for production use.
Footnotes
-
If running this command fails due to rmagick unable to install, then run this command
sudo apt-get install libmagickwand-dev imagemagick
and then repeat step 2. ↩