AirBnB_clone

  • This is a miniture version of the Airbnb website that uses the console as the main point interaction with the User(frontend)

  • 'frontend' - console: cmd module

  • 'Backend' - python OOP concepts

  • 'Database' - file storage: JSON module

  • 'Testing' - unitest module _ 'pycodestyle' - version 2.8.*

project structure

'''bash

├── AUTHORS ├── console.py ├── init.py ├── models │   ├── amenity.py │   ├── base_model.py │   ├── city.py │   ├── engine │   │   ├── file_storage.py │   │   ├── init.py │   │   └── pycache │   │   ├── file_storage.cpython-310.pyc │   │   ├── file_storage.cpython-311.pyc │   │   ├── init.cpython-310.pyc │   │   └── init.cpython-311.pyc │   ├── init.py │   ├── place.py │   ├── pycache │   │   ├── amenity.cpython-310.pyc │   │   ├── amenity.cpython-311.pyc │   │   ├── base_model.cpython-310.pyc │   │   ├── base_model.cpython-311.pyc │   │   ├── city.cpython-310.pyc │   │   ├── city.cpython-311.pyc │   │   ├── init.cpython-310.pyc │   │   ├── init.cpython-311.pyc │   │   ├── place.cpython-310.pyc │   │   ├── place.cpython-311.pyc │   │   ├── review.cpython-310.pyc │   │   ├── review.cpython-311.pyc │   │   ├── state.cpython-310.pyc │   │   ├── state.cpython-311.pyc │   │   ├── user.cpython-310.pyc │   │   └── user.cpython-311.pyc │   ├── review.py │   ├── state.py │   └── user.py ├── pycache │   ├── console.cpython-310.pyc │   ├── console.cpython-311.pyc │   └── test_base_mode.cpython-311.pyc ├── README.md └── tests ├── init.py ├── pycache │   ├── init.cpython-310.pyc │   ├── init.cpython-311.pyc │   ├── test_base_mode.cpython-310.pyc │   ├── test_base_model.cpython-310.pyc │   ├── test_base_model_dict.cpython-310.pyc │   ├── test_console.cpython-310.pyc │   ├── test_console.cpython-311.pyc │   └── test_save_reload_base_model.cpython-310.pyc ├── test_console.py ├── test_models │   ├── pycache │   │   └── test_user.cpython-311.pyc │   ├── test_amenity.py │   ├── test_city.py │   ├── test_place.py │   ├── test_review.py │   ├── test_state.py │   └── test_user.py └── ~.vimrc

'''

  • 'console,py' - this is the entry point of our program(where to use 'if name=="main")'

  • 'models/' - contains all classes used for the entire project

  • 'base_model' - This is the parent class and contains elements common to all other classes:

    attributes;

      'id':
      'created_at':
      'updated_at':
    

    methods;

      'save():'
      'to_json()':
    
  • 'init()' : this is a magic method that converts our module to a package.

  • 'engine/' - contains all storage classes

-'tests/' - Contains all our test files with the 'test_' prefix

How to use:

Examples: