Giter Club home page Giter Club logo

airbnb_clone's Introduction

hbnb Logo

AirBnB Clone

The goal of this project is to deploy on our server a simple copy of the AirBnB website.

We won’t implement all the features, only some of them to cover all fundamental concepts of the higher level programming track.

Our application will be composed by:

  • A command interpreter to manipulate data without a visual interface, like in a Shell
  • A website that shows the final: static and dynamic
  • A database or files that store data
  • An API that provides a communication interface between the front-end and our data

πŸ–₯ The command interpreter

Execution

The command interpreter can be launched in interactive or non-interactive mode as follows:

  • Interactive Mode: $ ./console.py
  • Non-interactive Mode: $ echo <command> | ./console.py

Usage

The command interpreter currently handles:

  • all [class_name] - prints all string representation of all instances (or of the specified class_name)
    • Can also be used as <class_name>.all()
  • create <class_name> - creates a new instance of BaseModel, saves it and prints the id
  • <class_name>.count() - prints the number of instances of a class
  • destroy <class_name> <id> - deletes an instance
    • Can also be used as <class_name>.destroy(<id>)
  • quit OR βŒƒ + D (EOF) - exits the program
  • show <class_name> <id> - prints the string representation of an instance
    • Can also be used as <class_name>.show(<id>)
  • update <class_name> <id> <attribute_name> <attribute_value> - updates an instance by adding or updating attribute
    • Can also be used as <class_name>.update(<id>, <attribute_name>, <attribute_value>) OR <class_name>.update(<id>, <dictionary_representation>)

Example of use

[vagrant@ubuntu AirBnB_clone ]$ ./console.py
(hbnb) help

Documented commands (type help <topic>):
========================================
EOF  all  create  destroy  help  quit  show  update

(hbnb) create User
d115b993-d908-4e26-8fab-959a52d49019
(hbnb) User.update("d115b993-d908-4e26-8fab-959a52d49019", {"first_name": "John", "last_name": "Doe", "Age": 42})
(hbnb) show User "d115b993-d908-4e26-8fab-959a52d49019"
[User] (d115b993-d908-4e26-8fab-959a52d49019) {'created_at': datetime.datetime(2021, 2, 17, 15, 28, 17, 826093), 'last_name': 'Doe', 'Age': 42, 'first_name': 'John', 'id': 'd115b993-d908-4e26-8fab-959a52d49019', 'updated_at': datetime.datetime(2021, 2, 17, 15, 29, 22, 539231)}
(hbnb) create Place
ed8d930d-33a2-4eba-9133-beb2ab8e633d
(hbnb) all
["[User] (d115b993-d908-4e26-8fab-959a52d49019) {'created_at': datetime.datetime(2021, 2, 17, 15, 28, 17, 826093), 'last_name': 'Doe', 'Age': 42, 'first_name': 'John', 'id': 'd115b993-d908-4e26-8fab-959a52d49019', 'updated_at': datetime.datetime(2021, 2, 17, 15, 29, 22, 539231)}", "[User] (dc1b70d8-282e-42dc-a25e-0e4893000705) {'created_at': datetime.datetime(2021, 2, 17, 15, 22, 36, 332889), 'id': 'dc1b70d8-282e-42dc-a25e-0e4893000705', 'updated_at': datetime.datetime(2021, 2, 17, 15, 22, 36, 332908)}", "[Place] (ed8d930d-33a2-4eba-9133-beb2ab8e633d) {'created_at': datetime.datetime(2021, 2, 17, 15, 30, 14, 168508), 'id': 'ed8d930d-33a2-4eba-9133-beb2ab8e633d', 'updated_at': datetime.datetime(2021, 2, 17, 15, 30, 14, 168520)}"]
(hbnb) quit
[vagrant@ubuntu AirBnB_clone ]$

🐞 Bugs

No known bugs at this time.

πŸ§‘β€πŸ’» Author

Pierre Forcioli

airbnb_clone's People

Stargazers

Anonymous1010 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.