Git Product home page Git Product logo

phase-4-rails-practice-challenge-apartments's Introduction

Rails Practice Challenge - Apartments

Setup

To download the dependencies for backend, run:

bundle install

There is some starter code in the db/seeds.rb file so that once you've generated the models, you'll be able to create data to test your application.

You can run your Rails API on localhost:3000 by running:

rails s

There are no tests for this application, so you'll need to check your progress by running the server and using Postman make requests.

Introduction

We're going to build an API for an apartment management company. Create the following database structure. You will have three models (and their corresponding tables), Apartment, Tenant and Lease, with the following relationships:

  • A tenant has many apartments and has many leases
  • An apartment has many tenants and has many leases
  • A lease belongs to an apartment and belongs to a tenant

The models should have the following attributes (along with any attributes needed to create the relationships defined above):

  • Apartment
    • number
  • Tenant
    • name (must be present)
    • age (must be >= 18)

Make sure to define validations for your models so that no bad data can be saved to the database.

Deliverables

As a user, I can:

  • Create, read, update and delete Apartments
  • Create, read, update and delete Tenants
  • Create and delete Lease

Follow good API design practices and use RESTful routing conventions. Make sure to handle errors and invalid data by returning the appropriate status code along with a message.

Instructions

  • Time yourself while working on the deliverables
  • Commit when you hit 75 minutes
  • When you have finished all deliverables, commit again.

phase-4-rails-practice-challenge-apartments's People

Contributors

ihollander avatar vidhisharma3193 avatar

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.