Giter Club home page Giter Club logo

adopt_dont_shop's Introduction

Adopt, Don't Shop

Background and Design

"Adopt Don't Shop" is a fictitious pet adoption application that allows users to apply for new pooches and for shelters to approve or deny applications on the server side. 26 User stories/learning goals were provided to guide the App's development. On top of this, I implemented active record callbacks and basic bootstrap front end design as independent challenges for myself.

Database Design

Database Design

Main goals for this project:

  • Build out CRUD functionality for a many to many relationship
  • Use ActiveRecord to write queries that join multiple tables of data together
  • Use MVC to organize code effectively, limiting the amount of logic included in views and controllers
  • Validate models and handle sad paths for invalid data input
  • Use flash messages to give feedback to the user
  • Use partials in views
  • Use within blocks in tests
  • Track user stories using GitHub Projects
  • Deploy an application to Heroku

Tools

Adopt, Don't Shop was built with Rails 5.2.6, in addition to PostgreSQL, HTML, CSS, and Ruby. The app is currently deployed through Heroku, which was managed using the Heroku CLI. RSpec (with Capybara and Shoulda-Matchers gems) was used for test-driven development (TDD). SimpleCov was used to track test coverage, and reported 100% coverage. Feature tests were used to drive the development and test the functionality of all controllers and views, as well as unit tests for all models and model-level methods. Seed data was generated with the help of the Faker package.

Local Deployment

Follow these instructions in your command line terminal:

  1. Clone this repo:
    git clone [email protected]:mbrandt00/adopt_dont_shop.git
    
  2. Install required gems:
    bundle install
    
  3. Start the database:
    rails db:{create,migrate,seed}
    
  4. To run test suite and view test coverage:
    rspec
    open coverage/index.html
    
  5. Start the Rails server:
    rails s
    
  6. In your browser, navigate to localhost:3000.

Skills Developed by Project

Rails

  • Describe use cases for a model that inherits from ApplicationRecord vs. a PORO
  • Use MVC to organize code effectively, limiting the amount of logic included in views and controllers
  • Make use of flash messages
  • Use Inheritance from ApplicationController or a student created controller to store methods that will be used in multiple controllers
  • Use Partials for views to DRY up code
  • Use POROs to logically organize code for objects not stored in the database

ActiveRecord and Databases

  • Use built-in ActiveRecord methods to create queries that calculate, select, filter, join, average, and order data from/through many tables
    • Here is an example of the querying needed to get pending applications for a shelter.
graph TD
    A(Applications) -->|Filter to get pending applications| B[Join applications with Pets through Pet Applications]
    B --> C(shelters)
    C -->|Shelter One| D[Pending Applications] --> pending_application:pending_pets
    C -->|Shelter Two| E[Pending Applications]
    C -->|Shelter Three| F[Pending Applications]
Loading
  • Describe database relationships and terms such as "Many to Many" and "Join Table"

Testing and Debugging

  • Write feature tests utilizing Capybara
  • Sad Path Testing
  • Write model tests with RSpec including validations, and class and instance methods

Web Applications

  • Describe and implement ReSTful routing
  • Identify use cases for, and implement non-ReSTful routes
  • Identify the different components of URLs(protocol, domain, path, query params)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.