Giter VIP home page Giter VIP logo

airbnb_clone's Introduction

AirBnB_clone

Airbnb

Description

This is a complete web application, integrating database storage, a back-end API, and front-end interfacing in a clone of AirBnB. this is the first step towards building your first full web application: the AirBnB clone. The aim of the project is to deploy a replica of the Airbnb Website using my server.

A command interpreter to manipulate data without a visual interface, like a shell (for development and debugging) A website (front-end) with static and dynamic functionalities A comprehensive database to manage the backend functionalities An API that provides a communication interface between the front and backend of the system.

Aims & Objectives of this project

This will help to be able to manage the objects of our project:

Creation of a new object (ex: a new "User" or a new "Place") Retrieval of an object from a file storage, a database etc… Perform operations on objects (count, compute stats, etc…) Update attributes of an object Destroy an object

The created objects

The list of the objects (instances) that can be created are as follows:

BaseModel User City Amenity State Review Place

Files and Directories

models directory contains all classes used for the entire project. A class, called “model” in a OOP project is the representation of an object/instance. tests directory contains all unit tests. console.py file is the entry point of our command interpreter. models/base_model.py file is the base class of all our models. It contains common elements: attributes: id, created_at and updated_at methods: save() and to_json() models/engine directory contains all storage classes (using the same prototype). For the moment I will have only one: file_storage.py. The project's implementation will happen in the following phases:

Phase One

The first phase is to manipulate a powerful storage system to give an abstraction between objects and how they are stored and persisted. To achieve this, I will:

put in place a parent class (called BaseModel) to take care of the initialization, serialization and deserialization of my future instances create a simple flow of serialization/deserialization: Instance <-> Dictionary <-> JSON string <-> file create all classes used for AirBnB (User, State, City, Place…) that inherit from BaseModel create the first abstracted storage engine of the project: File storage. create all unittests to validate all our classes and storage engine Create a data model Manage (create, update, destroy, etc) objects via a console/command interpreter Store and persist objects to files (JSON files)

Commands Implemented

Description of the command interpreter

Commands Description quit This command quits or exits the console EOF This command quits or exits the console interpreter when pressed Ctrl+D help or help Displays all commands or Displays instructions for a specific command (Ex: help or help quit). create Creates an object of type, saves it to a JSON file, and prints the objects ID (Ex: create BaseModel or BaseModel.create()) show Shows string representation of an object (Ex: show BaseModel 1234-1234-1234 or BaseModel.show("1234-1234-1234")) destroy Deletes an objects based on the class name and id (Ex: destroy BaseModel 1234-1234-1234 or BaseModel.destroy("1234-1234-1234")). all or all Prints all string representations of all objects or Prints all string representations of all objects of a specific class (Ex: all BaseModel or all or User.all()). update "" Updates an object with a certain attribute (new or existing) (Usage: update "). .all() Same as all .count() Retrieves the number of objects of a certain class (Usage: .count(), Example: User.count()). .show() Same as show .destroy() Same as destroy .update(, , Same as update .update(, ) Updates an objects based on a dictionary representation of attribute names and values

airbnb_clone's People

Contributors

paulzay avatar

Watchers

 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.