The goal of the project is to deploy on the server a simple copy of the AirBnB website This is the first step towards building your first full web application: the AirBnB clone.
-
First, clone the repository into your directory.
$ git clone https://github.com/BenFaruna/AirBnB_clone
-
Run the executable
./console.py
-
Type help for a list of the commands available with console.py. help is an action provided by default by cmd. Enter help + command for information about respective command and usage.
========================================
Amenity City Place State all destroy quit update
BaseModel EOF Review User create help show
(hbnb) create City
4af7890c-007f-42ff-97d8-074214f1094f
(hbnb) show City 4af7890c-007f-42ff-97d8-074214f1094f
[City] (4af7890c-007f-42ff-97d8-074214f1094f) {'id': '4af7890c-007f-42ff-97d8-074214f1094f',
'updated_at': datetime.datetime(2017, 6, 11, 1, 6, 39, 679386), '__class__': 'City',
'created_at': datetime.datetime(2017, 6, 11, 1, 6, 39, 679362)}
(hbnb)$
-
quit -- exits the program
-
EOF -- exits the program
$ ./console.py
(hbnb) help
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
(hbnb)
(hbnb) quit
$
$ echo "help" | ./console.py
(hbnb)
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
$
$ cat test_help
help
$
$ cat test_help | ./console.py
(hbnb)
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
$
File | Description |
---|---|
console.py | entry point of the command interpreter |
models/init.py | creates an instance of FileStorage |
models/base_model.py | class BaseModel that defines all common attributes/methods for other classes |
models/amenity.py | class Amenity, inherits from BaseModel |
models/city.py | class City, inherits from BaseModel |
models/place.py | class Place, inherits from BaseModel |
models/review.py | class Review, inherits from BaseModel |
models/state.py | class State, inherits from BaseModel |
models/user.py | class User, inherits from BaseModel |
models/engine/file_storage.py | class FileStorage, serializes instances to a JSON file and deserializes JSON file to instances |
models/engine/file_storage.py | class FileStorage, serializes instances to a JSON file and deserializes JSON file to instances |
tests/ | folder where are all the tests of the program |
- Write a README.md
- You should have an AUTHORS file at the root of your repository, listing all individuals having contributed content to the repository.
- Write beautiful code that passes the PEP8 checks.
- All your files, classes, functions must be tested with unit tests
- Write a class BaseModel that defines all common attributes/methods for other classes
- Create an instance with the previous dictionary representation
- recreate a BaseModel from another one by using a dictionary representation
- Write a program called console.py that contains the entry point of the command interpreter
- Update your command interpreter (console.py) to have these commands:
- create
- show
- destroy
- all
- update
- Write a class User that inherits from BaseModel
- Write all those classes that inherit from BaseModel:
- State
- City
- Amenity
- Place
- Review
- Update FileStorage to manage correctly serialization and deserialization of all our new classes: Place, State, City, Amenity and Review
- Update your command interpreter (console.py) to retrieve all instances of a class by using: .all()
- Update your command interpreter (console.py) to retrieve the number of instances of a class: .count()
- Update your command interpreter (console.py) to retrieve an instance based on its ID: .show()
- Update your command interpreter (console.py) to destroy an instance based on his ID: .destroy()
- Update your command interpreter (console.py) to update an instance based on his ID: .update(, , )
- pdate your command interpreter (console.py) to update an instance based on his ID with a dictionary: .update(, )
- Write all unittests for console.py, all features!
- Faruna Benjamin Adejo - BenFaruna github