Skip to content

CKCarr/holbertonschool-AirBnB_clone

Repository files navigation

Project: AirBnB clone - The console

Logo_Airbnb

Description

This is the first step a command interpreter to manage our AirBnB objects towards building our first full web application: the AirBnB clone. We will use what we built in this project with all other following projects: HTML/CSS templating, database storage, API, front-end integration…

About

  • We put in place a parent class (called BaseModel) to take care of the initialization, serialization and deserialization of your future instances
  • We created a simple flow of serialization/deserialization: Instance <-> Dictionary <-> JSON string <-> file
  • we created all classes used for AirBnB (User, State, City, Place…) that inherit from BaseModel
  • We created the first abstracted storage engine of the project: File storage.
  • We created all unittests to validate all our classes and storage engine

Diagram AirBnB clone (The Console)

console_Airbnb

Files in this Repository

No. File File Hierarchy Description
1 console.py The main console, command interpreter (EOF, all, create, destroy, help, quit, show, update.)
2 Authors File with the name of Authors
3 README.md Readme file proyect
4 'init.py' models/init.py File to mark a directory as a package
5 amenity.py models/amenity.py The amenity subclass
6 base_model.py models/base_model.py Defines all common attributes/methods for other classes
7 city.py models/city.py The city subclass
8 place.py models/place.py The place subclass
9 review.py models/review.py The review subclass
10 state.py models/state.py The state subclass
11 user.py models/user.py The user subclass
12 init.py models/engine/init.py File to mark a directory as a package
13 file_storage.py models/engine/file_storage.py The file storage class
14 test_amenity.py tests/test_models/test_amenity.py The unittest module for amenity
15 test_base_model.py tests/test_models/base_model.py The unittest module for base model
16 test_city.py tests/test_models/city.py The unittest module for city
17 test_place.py tests/test_models/place.py The unittest module for place
18 test_review.py tests/test_models/review.py The unittest module for review
19 test_state.py tests/test_models/state.py The unittest module for state
20 test_user.py tests/test_models/user.py The unittest module for user
21 'init.py' tests/test_models/test_engine/init.py File to mark a directory as a package
22 test_file_storage.py tests/test_models/test_engine/test_file_storage.py The unittest module for file storage

How to Use Console

Execution

The console in interactive mode:

/holbertonschool-AirBnB_clone#  ./console.py
(hbnb) help

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

(hbnb)

To use in non-interactive mode:

 /holbertonschool-AirBnB_clone# echo "help" | ./console.py
(hbnb)
Documented commands (type help ):
========================================
EOF  all  create  destroy  help  quit  show  update

(hbnb)

help command use:

 
(hbnb)
(hbnb) help destroy

        Deletes an instance based on the
        class name and id, and saves the change into
        the JSON file.

(hbnb) help EOF
Exit command to exit the program
(hbnb)

Commands in terminal

Instructions on how to use them in your own application are linked below.

Command Description
Quit Quit the Prompt
Help Display help the console
Create Create New object
Show Show the info object
All Display All objects
Update Update objects
Destroy Destroy Objects

AUTHORS


Crystal Carrillo 6108@holbertonstudents.com
Carlos Alarcon 6138@holbertonstudents.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published