Coder Social home page Coder Social logo

flask-challenge-apartments's Introduction

Flask Practice Challenge - Apartments

Setup

To download the dependencies for backend, run:

$ pipenv install

You can run your Flask API on localhost:3000 by entering the development environment with pipenv shell, then after changing into the server directory running:

$ python app.py

There are no tests for this application, so you'll need to check your progress by running the server and using Postman or JavaScript fetch to 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)
  • Lease
    • rent

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.

flask-challenge-apartments's People

Contributors

ihollander avatar adam-larosa avatar vidhisharma3193 avatar graciemcguire avatar lizbur10 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.