Skip to content

Joakim-animate90/AirBnB_clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AirBnB clone - The console

Description

This team project is part of the ALX School Full-Stack Software Engineer program. It's the first step towards building a first full web application: an AirBnB clone. This first step consists of a custom command-line interface for data management, and the base classes for the storage of this data.

Usage

The console works both in interactive mode and non-interactive mode, much like a Unix shell. It prints a prompt (hbnb) and waits for the user for input.

command example
Run the console ./console.py
Quit the console (hbnb) quit
Display the help for a command (hbnb) help
Create an object (prints its id) (hbnb) create
Show an object hbnb) show or (hbnb) .show()
Destroy an object (hbnb) destroy or (hbnb) .destroy()
Show all objects, or all instances of a class (hbnb) all or (hbnb) all
Update an attribute of an object (hbnb) update ""

Models

The folder models contains all the classes used in this project.

File Description Attributes
base_model.py BaseModel class for all the other classes id, created_at, updated_at
user.py User class for future user information email, password, first_name, last_name
amenity.py Amenity class for future amenity information name
city.py City class for future location information state_id, name
state.py State class for future location information name
place.py Place class for future accomodation information city_id, user_id, latitude, longitude, amenity...
review.py Review class for future user/host review information place_id, user_id, text

File storage

The folder engine manages the serialization and deserialization of all the data, following a JSON format.

A FileStorage class is defined in file_storage.py with methods to follow this flow: -> to_dict() -> -> JSON dump -> -> FILE -> -> JSON load -> ->

The init.py file contains the instantiation of the FileStorage class called storage, followed by a call to the method reload() on that instance. This allows the storage to be reloaded automatically at initialization, which recovers the serialized data.

Tests

All the code is tested with the unittest module. The test for the classes are in the test_models folder.

Authors

Joakim Bwire - joakimbwire23@gmail.com

Amen Yerdaw

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published