Git Product home page Git Product logo

airbnb_clone's Introduction

0x00. AirBnB clone - The console

Project Description

Welcome to the AirBnB clone project! Before starting, please read the AirBnB concept page.

First step: Write a command interpreter to manage your AirBnB objects. This is the first step towards building your first full web application: the AirBnB clone. This first step is very important because you will use what you build during this project with all other following projects: HTML/CSS templating, database storage, API, front-end integration…

Each task is linked and will help you to:

  • put in place a parent class (called BaseModel) to take care of the initialization, serialization and deserialization of your 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

Command Interpreter

The command interpreter, implemented in console.py, is built using Python and the cmd module. It provides a simple and interactive interface for users to interact with the Airbnb application. The interpreter supports various commands to perform CRUD (Create, Read, Update, Delete) operations on different object types.

How to Start

To start the Airbnb Console, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/your-username/airbnb-console.git
    
     Navigate to the project directory:
    
    
    
  2. cd airbnb-console

    • ./console.py
    (hbnb)
    
    Documented commands (type help <topic>):
    ========================================
    EOF  all  count  create  destroy  help  quit  show update
    (hbnb) create User
    Welcome User You instane have been created with a Unique_id =>> d043530b-2c4d-48aa-9a63-5a967daf07a0
    
    (hbnb) show User d043530b-2c4d-48aa-9a63-5a967daf07a0
    
    [User] (d043530b-2c4d-48aa-9a63-5a967daf07a0) {'id': 'd043530b-2c4d-48aa-9a63-5a967daf07a0', 'created_at': datetime.datetime(2023, 12, 9, 15, 30, 4, 33351), 'updated_at': datetime.datetime(2023, 12, 9, 15, 30, 4, 33396)}
    
    (hbnb) all
    
    ["[User] (1d952865-4e44-46de-8268-94d3bc6e0a39) {'id': '1d952865-4e44-46de-8268-94d3bc6e0a39', 'created_at': datetime.datetime(2023, 12, 9, 13, 35, 3, 414232), 'updated_at': datetime.datetime(2023, 12, 9, 14, 57, 49, 509761), 'name': 'tee'}", "[User] (d043530b-2c4d-48aa-9a63-5a967daf07a0) {'id': 'd043530b-2c4d-48aa-9a63-5a967daf07a0', 'created_at': datetime.datetime(2023, 12, 9, 15, 30, 4, 33351), 'updated_at': datetime.datetime(2023, 12, 9, 15, 30, 4, 33396)}"]
    
    (hbnb) update User d043530b-2c4d-48aa-9a63-5a967daf07a0 name "omotayo"
    
    (hbnb) show User d043530b-2c4d-48aa-9a63-5a967daf07a0
    
    [User] (d043530b-2c4d-48aa-9a63-5a967daf07a0) {'id': 'd043530b-2c4d-48aa-9a63-5a967daf07a0', 'created_at': datetime.datetime(2023, 12, 9, 15, 30, 4, 33351), 'updated_at': datetime.datetime(2023, 12, 9, 15, 31, 9, 509446), 'name': 'omotayo'}
    (hbnb)
    (hbnb) (hbnb) count User
    2
    (hbnb) quit

How to Use

Once the console is running, you can use the following commands:

create: Create a new instance of a specified class.
Example: create User

show: Display details of a specific instance.
Example: show User 123

destroy: Delete a specified instance.
Example: destroy User 123

all: Display all instances or instances of a specific class.
Example: all or all User

update: Update an instance with new attribute values.
Example: update User 123 first_name "John"

count: Retrieve the number of instances of a specified class.
Example: count User

quit or EOF: Exit the console.

Contributors

The following people contributed to this repository.

  • Omotobora omotayo

    • Added support for user authentication.
    • Fixed a bug in the update functionality.
  • Aniekan-abasi

    • Implemented the count command for various object types.
    • Updated documentation for clarity.

If you'd like to contribute to this project, please refer to our Contribution Guidelines.

airbnb_clone's People

Contributors

teeclever avatar dgamee avatar

Watchers

 avatar

Forkers

dgamee

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.