title |
---|
AirBnB Clone Project - Command Interpreter |
Welcome to the AirBnB clone project! In this project, you'll embark on a journey to build a web application inspired by the famous AirBnB platform. Before delving into the details, let's familiarize ourselves with the key concepts behind this endeavor. If you haven't already, take a moment to read the AirBnB concept page.
The primary objective of this initial phase is to construct a command interpreter to manage AirBnB objects. This foundational step lays the groundwork for the subsequent development of a full-fledged web application. Throughout the project, you'll integrate various elements such as HTML/CSS templating, database storage, API implementation, and front-end integration.
⇒ tree
.
├── AUTHORS
├── console.py
├── models
│ ├── base_model.py
│ └── engine
│ └── file_storage.py
├── README.md
└── tests
3 directories, 5 files
To achieve this goal, we'll follow a systematic approach:
-
BaseModel Class: Create a parent class,
BaseModel
, responsible for the initialization, serialization, and deserialization of future instances. -
Serialization Flow: Establish a simple flow for serialization and deserialization, allowing smooth conversion between instances, dictionaries, JSON strings, and files.
-
AirBnB Classes: Develop classes for each key entity in the AirBnB system, such as User, State, City, and Place. These classes will inherit from the
BaseModel
. -
Storage Engine: Implement the first abstracted storage engine for the project – File storage.
-
Unit Tests: Create comprehensive unit tests to validate the functionality of all classes and the storage engine.
Think of the command interpreter as a specialized Shell, limited to managing objects within your AirBnB project. It allows you to:
- Create new objects (e.g., User or Place).
- Retrieve objects from files, databases, etc.
- Perform operations on objects (count, compute stats, etc.).
- Update attributes of an object.
- Destroy an object.
By completing these tasks, you'll establish a robust foundation for the subsequent phases of the AirBnB clone project. Let's dive into the details and bring our AirBnB vision to life!
- Clone this repository:
git clone "https://github.com/stephen-nene/AirBnB_clone.git"
- Access AirBnb directory:
cd AirBnB_clone
- Run hbnb(interactively):
./console
and enter command - Run hbnb(non-interactively):
echo "<command>" | ./console.py
$ ./console.py
(hbnb) help
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
(hbnb)
(hbnb) quit
$
- NeneCorp © 2023
- LICENSE