Giter Site home page Giter Site logo

airbnb_clone's Introduction

AirBnB Clone Project

This project is intended to be a hands-on learning process of building a full-scale software application that consists of:

  • A web interface for user interaction
  • A Database Management System
  • A Server that hosts the main application
  • A debugging interface for the developer (in this case, a command line interpreter)
  • All the components above are built in stages. The first stage is to build a small prototype of the main system - a basic command line interpreter that is able to manipulate objects that are stored in a JSON file storage system. This would mainly be implemented in Python. Next, a static webpage would be built in HTML and CSS before functionality is added with Javascript. After that, a proper Database management system would be set up using MySQL. Finally, a server would be setup using tools like Puppet among others.

    The Command Interpreter

    The command interpreter provides a shell-like environment that allows the developer to manipulate data objects and dynamically test the application without too much abstraction in between. It is built in Python.
    Through the interpreter, you should be able to:
    • Create a new object
    • Retrieve an object from a file, a database etc…
    • Do operations on objects (count, compute stats, etc…)
    • Update attributes of an object
    • Destroy an object

    Usage

    • The console can be run in both interactive and non-interactive mode.
    • It prints a prompt (hbnb) and waits for the user for input.

    Interactive Mode

    $ ./console.py
    (hbnb) help
    
    Documented commands (type help <topic>):
    ========================================
    EOF  help  quit
    
    (hbnb)
    (hbnb)
    (hbnb) quit
    $

    Non-Interactive Mode

    $ echo "help" | ./console.py
    (hbnb)
    
    Documented commands (type help <topic>):
    ========================================
    EOF  help  quit
    (hbnb)
    $
    $ cat test_help
    
    help
    $
    $ cat test_help | ./console.py
    (hbnb)
    
    Documented commands (type help <topic>):
    ========================================
    EOF  help  quit
    (hbnb)
    $

    Commands

    Command Description
    quit Exits the program
    EOF Exits the program
    create <class> Creates an instance of a class
    show <class> <id> Prints the string representation of an instance of a class based on class name and id
    destroy <class> <id> Deletes instance of a class based on class name and id
    all Prints all string representations of all instances
    all <class> Prints all string representations of all instances based on class name
    update <class> <id> <attribute name> "<attribute value>" Updates an attribute of an instance based on class name and id

    How to Use

    1. First clone this repository.

    2. Once the repository is cloned locate the "console.py" file and run it as follows:

    /AirBnB_clone$ ./console.py
    
    1. When this command is run the following prompt should appear:
    (hbnb)
    
    1. This prompt designates you are in the "HBnB" console. There are a variety of commands available within the console program as described in the table above.


    Examples

    Primary Command Syntax

    Example 0: Create an object

    Usage: create <class_name>

    (hbnb) create BaseModel
    
    (hbnb) create BaseModel
    3aa5babc-efb6-4041-bfe9-3cc9727588f8
    (hbnb)                   
    
    Example 1: Show an object

    Usage: show <class_name> <_id>

    (hbnb) show BaseModel 3aa5babc-efb6-4041-bfe9-3cc9727588f8
    [BaseModel] (3aa5babc-efb6-4041-bfe9-3cc9727588f8) {'id': '3aa5babc-efb6-4041-bfe9-3cc9727588f8', 'created_at': datetime.datetime(2020, 2, 18, 14, 21, 12, 96959), 'updated_at': datetime.datetime(2020, 2, 18, 14, 21, 12, 96971)}
    (hbnb)  
    
    Example 2: Destroy an object

    Usage: destroy <class_name> <_id>

    (hbnb) destroy BaseModel 3aa5babc-efb6-4041-bfe9-3cc9727588f8
    (hbnb) show BaseModel 3aa5babc-efb6-4041-bfe9-3cc9727588f8
    ** no instance found **
    (hbnb)   
    
    Example 3: Update an object

    Usage: update <class_name> <_id>

    (hbnb) update BaseModel b405fc64-9724-498f-b405-e4071c3d857f first_name "person"
    (hbnb) show BaseModel b405fc64-9724-498f-b405-e4071c3d857f
    [BaseModel] (b405fc64-9724-498f-b405-e4071c3d857f) {'id': 'b405fc64-9724-498f-b405-e4071c3d857f', 'created_at': datetime.datetime(2020, 2, 18, 14, 33, 45, 729889), 
    'updated_at': datetime.datetime(2020, 2, 18, 14, 33, 45, 729907), 'first_name': 'person'}
    (hbnb)
    

    Note

    This project is not in its final form and will continue to be updated and improved over time

    airbnb_clone's People

    Contributors

    roncollins-mm 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.