Skip to content

zperez0/bike_gallery

 
 

Repository files navigation

Bike Gallery

By Todd Pangilinan, Marcus Ferreira, Z Perez, Erika Mogollon, & Kyle Miller

Technologies Used

  • Ruby-on-Rails
  • Rspec
  • Pry
  • Capybara
  • Faker
  • shoulda-matchers
  • Devise
  • HTML
  • CSS
  • PSQL

Description:

Using Ruby on Rails and Postgres, this website allows a customer or employee(admin) to sign into Bike Gallery website. From there, admins can manage bikes and general users can add reviews of bikes. Admins posess full CRUD capabilities for both bikes and reviews; signed in users can create reviews; all visitors(admins, signed-in users, or visitors not signed in) can view bikes and reviews. Overall, this website demonstrates our understanding of one-to-many relationship between bikes and Reviews using authentication, scopes, validations, callbacks, seeding, and flash messages.

User Stories

  • As an admin, I want to view, add, update and delete bikes.
  • 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 bikes.
  • 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 bike.

Setup/Installation Requirements for Windows

  • You will need to install the following before proceeding (click on the link to follow the installation process): Ruby, PostgreSQL
  • Clone or download this repository onto your desktop.
  • Navigate to the top-level of directory.
  • Open VScode.
  • Type "bundle" to install the gems
  • In Config/database.yml file, add username & password to the development:, test:, & production:
  • An Example:
development:
  <<: *default
database: marios-food_development
username: <%= ENV['POSTGRES_USERNAME'] %> 
password: <%= ENV['POSTGRES_PASSWORD'] %> 
  • To Run the App in Browser:
    1. Run pg_ctl start in the terminal to run a server.
    2. rake db:create
    3. rake db:test:prepare
    4. rake db:migrate
    5. rake db:seed
    6. Then run rails s to start up rails, which you can access by entering localhost:3000 in your browser.
  • To Run Tests: In the root directory of this project, run rspec in your command line.

Setup/Installation Requirements for Mac

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

  • Clone or download this repository onto your desktop.

  • Navigate to the top-level of directory.

  • Open VScode.

  • Type "bundle" to install the gems

  • 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:
https://localhost:3000/
  • To Run Tests: In the root directory of this project, run rspec in your command line.

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: "[email protected]"
password: "password"

Known Bugs

  • N/A

License

  • N/A Copyright (c) 7/13/2022, Todd Pangilinan, Marcus Ferreira, Z Perez, Erika Mogollon, & Kyle Miller
  • MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 65.1%
  • HTML 32.7%
  • JavaScript 1.3%
  • SCSS 0.9%