This repository contains the first step in creating a full-stack clone of the AirBnB web application. The focus of this project is on building a command-line interface (CLI) for managing objects, as well as implementing the backend logic and storage systems.
- Project Overview
- Technologies Used
- Features
- Project Structure
- Installation & Usage
- Examples
- Learning Objectives
- Collaborators
- Author
The AirBnB Clone - The Console is the first phase of a larger project to develop a clone of the AirBnB platform. This phase focuses on creating a Command Line Interface (CLI) that allows users to:
- Create, read, update, and delete objects (CRUD operations).
- Store and retrieve data using a custom file storage system.
- Manage different classes for various AirBnB components (e.g., Users, Places, States).
- Language: Python 3.7+
- Storage: JSON-based file storage system
- Paradigm: Object-Oriented Programming (OOP)
- Testing:
unittestmodule for unit testing - Development Tools:
pycodestyle(PEP 8 compliance)cmdmodule for CLI implementation
- Interactive Command-Line Interface (CLI) for managing objects.
- Persistent data storage using a custom JSON serialization and deserialization system.
- Implementation of core AirBnB models:
- User
- Place
- State
- City
- Amenity
- Review
- Object-Oriented Programming principles:
- Class inheritance
- Polymorphism
- Encapsulation
- Comprehensive unit tests for all modules and features.
AirBnB_clone/
├── console.py # Entry point of the command-line interface
├── models/ # Package containing all model classes
│ ├── __init__.py # Initialization file for the models package
│ ├── base_model.py # Base class for all models
│ ├── user.py # User class
│ ├── place.py # Place class
│ ├── state.py # State class
│ ├── city.py # City class
│ ├── amenity.py # Amenity class
│ └── review.py # Review class
├── models/engine/ # Package for storage engines
│ ├── __init__.py
│ ├── file_storage.py # File storage engine
├── tests/ # Unit tests for all modules
├── README.md # Project documentation
└── AUTHORS # List of project contributors
- Python 3.7 or higher
pip(Python package manager)
git clone https://github.com/realFrankieWilson/AirBnB_clone.git
cd AirBnB_cloneStart the interactive console by running:
./console.pyThe following commands are available in the console:
create <class_name>: Creates a new instance of a class.show <class_name> <id>: Displays the string representation of an instance.destroy <class_name> <id>: Deletes an instance based on its ID.all [class_name]: Displays all instances (or instances of a specific class).update <class_name> <id> <attribute_name> <attribute_value>: Updates an instance.
Below are some examples of how to use the console:
$ ./console.py
(hbnb) create User
6f9f1c4a-9a68-4e6e-8c07-8d3f1b7c5c29
(hbnb) show User 6f9f1c4a-9a68-4e6e-8c07-8d3f1b7c5c29
[User] (6f9f1c4a-9a68-4e6e-8c07-8d3f1b7c5c29) {'id': '6f9f1c4a-9a68-4e6e-8c07-8d3f1b7c5c29', 'created_at': '2025-12-18T09:43:00', 'updated_at': '2025-12-18T09:43:00'}
(hbnb) all User
["[User] (6f9f1c4a-9a68-4e6e-8c07-8d3f1b7c5c29) {'id': '6f9f1c4a-9a68-4e6e-8c07-8d3f1b7c5c29', 'created_at': '2025-12-18T09:43:00', 'updated_at': '2025-12-18T09:43:00'}"]
(hbnb) destroy User 6f9f1c4a-9a68-4e6e-8c07-8d3f1b7c5c29
(hbnb) quitBy working on this project, you will:
- Understand the fundamentals of object-oriented programming (OOP).
- Learn how to implement a command-line interface (CLI) using Python's
cmdmodule. - Build a custom serialization and deserialization engine for persistent storage.
- Gain experience in creating and managing Python packages and modules.
- Write and execute unit tests to ensure code reliability and correctness.
This project was developed by the following contributors:
- Frankie Wilson - @realFrankieWilson
- Collaborator Name - @CollaboratorGitHub
Migrated from early ALX backend specialization (2023–2024). Collaborative project with @Gold-Israel. Demonstrates Backend skills: Command interpreter console for managing AirBnB objects CRUD operations: Create, Read (show/all), Update, and Delete objects Support for multiple object classes (BaseModel, User, State, City, Amenity, Place, Review) Interactive and non-interactive shell modes Object persistence and retrieval from storage Help system with command documentation Comprehensive test suite for validation
| NAME | |
|---|---|
| Frank Ugwu Williams | frankuwill101@gmail.com |
| Gold Israel | techiegold101@gmail.com |
