zperez0 / marios_foods

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mario's Speciality Foods

By Z Perez

A web application providing CRUD functionality for the store's products. Each product can also have reviews added to it.

Technologies Used

  • HTML
  • bootstrap scss
  • Ruby
  • Rails
  • rspec
  • pry
  • Capybara
  • PostgreSQL
  • faker
  • devise
  • rails admin

Description

This application was created to demonstrate my understanding of using Rails, authorization and authentication with devise and setting up CRUD functionality. It was designed for a fictional specialized food store that wishes to keep track of its products and customer feedback. Products and reviews can be added, removed, and edited by an admin. A user must sign in in order to add a review.

User Stories

  • As an admin, I want to view, add, update and delete products.
  • As an admin, I should be able to log in and log out of the application.
  • As an admin, I should be able to add, update and delete products.
  • As an admin, I should be able to add reviews.
  • As a user, I want to be able to create an account and add a review to a product.

Setup/Installation Requirements

  • You will need to install the following before proceeding (click on the link to follow the installation process): Ruby, PostgreSQL

  • Go to GitHub

  • Clone git repository to local machine

  • Navigate to root folder and open directory either with VScode or your terminal

  • Install packages (type in the terminal):

bundle install
  • Open up postgres (type in the terminal):
postgres

Database setup:

  • Open up a new terminal tab
  • create database (type in terminal):
rake db:setup
  • To create migration (type in terminal):
  • for more inforamation on migrations check out Rails Guides
rake db:migrate
rake db:test:prepare
  • seed database with faker gem (type in terminal):
rake db:seed

Server:

  • Start server (type in terminal):
rails s
  • Open up your browser and go to:
http://localhost:3000/

Test:

  • Run test with rpsec (type in terminal):
rspec

Users:

  • To create a new user visit the webpage, on the navbar click 'Sign up' and fill out the form
To update a user to admin status
  • open rails console (type in terminal):
rails c
  • To update an admin status in the terminal:
User.where(email:"Insert your email here").update(admin: true)
  • Once an admin is created you can add users as admins. Go to the webpage, on the nav bar click on:
"Admin"
  • This will take you to the Site Administration. click on:
"Users"
  • Click on the pencil icon next to the user you want to edit.
  • Scroll down and hit the check box next to "Admin".
Alternatively, if you seeded the database
  • you can sign in as the admin that is provided:
email: "hotwaffle@gomail.com"
password: "password"

Known Bugs

  • No known issues

License

MIT

Copyright (c) 2022, Z Perez

About


Languages

Language:Ruby 67.7%Language:HTML 26.5%Language:SCSS 4.4%Language:JavaScript 1.1%Language:CoffeeScript 0.2%