{"id":21571030,"url":"https://github.com/victor0089/airbnb_clone","last_synced_at":"2025-04-10T14:20:25.452Z","repository":{"id":199360844,"uuid":"701330636","full_name":"victor0089/AirBnB_clone","owner":"victor0089","description":"0x00. AirBnB clone - The console This is the first step towards building your first full web application: the AirBnB clone. This first step is very important because you will use what you build during this project with all other following projects: HTML/CSS templating, database storage, API, front-end integration…","archived":false,"fork":false,"pushed_at":"2023-11-22T20:52:27.000Z","size":333,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T12:56:23.203Z","etag":null,"topics":["python","python-3","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/victor0089.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null}},"created_at":"2023-10-06T12:17:31.000Z","updated_at":"2024-03-17T20:12:25.000Z","dependencies_parsed_at":"2023-10-20T17:38:22.452Z","dependency_job_id":null,"html_url":"https://github.com/victor0089/AirBnB_clone","commit_stats":null,"previous_names":["victor0089/airbnb_clone"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victor0089%2FAirBnB_clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victor0089%2FAirBnB_clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victor0089%2FAirBnB_clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victor0089%2FAirBnB_clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victor0089","download_url":"https://codeload.github.com/victor0089/AirBnB_clone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248233935,"owners_count":21069493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","python-3","python3"],"created_at":"2024-11-24T11:14:41.320Z","updated_at":"2025-04-10T14:20:25.429Z","avatar_url":"https://github.com/victor0089.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AirBnB_clone\n# Team Project By Victor Adly \u0026 Maryam Amrani\n * One of the significant undertakings within the ALX Software Engineering program is the first project related to web development.\nThe console functions as a command interpreter, akin to a standard Python interactive shell or REPL (Read-Eval-Print Loop). It provides us with the means to execute commands and engage with the web application via a command-line interface, typically within a terminal. Through this command interpreter, our goal is to efficiently manage the objects within our project. This encompasses various tasks, such as creating new objects (e.g., users or places), retrieving objects from storage (like files or databases), performing operations on objects, such as counting and computing statistics, updating object attributes, and when necessary, deleting objects. Furthermore, the console serves as a valuable tool for debugging and identifying logic errors, as it enables us to experiment with the web application using different inputs and commands.\n\n * In a nutshell, \"the console\"refers to a command-line interface that facilitates interaction with our web application's objects by executing commands and receiving corresponding outputs.\n\n * In our Python-based Airbnb web application, we adhere to the principle that everything is treated as an object, indicating that they are instances of specific classes. This approach ensures a structured representation of various entities within our application. For instance, in our database:\n * 1-An instance (object) of the \"User\" class represents an individual who has registered an account on the web app. It encompasses essential information such as name, email, and password.\n\n * 2-Similarly, an instance (object) of the \"State\" class signifies a state or province, while an instance of the \"City\" class denotes a city within that state.\n\n * 3-Additionally, we have instances of the \"Place\" class, which represent temporary accommodations available for booking on the web app. These instances contain pertinent details like the room or suite's name, description, location, price, and availability dates.\n\n * This object-oriented approach ensures a structured and organized representation of data within our Airbnb web application.\n\n * In this project, we encountered approximately 18 distinct tasks to solve. The advantage of these tasks lies in their ability to dissect the overall project into more manageable segments, allowing us to focus on each task individually.\n\n * Furthermore, as these tasks come with clear prompts to guide us , their execution often becomes relatively straightforward.\nThis project have to be  ended in 7 days and demanded a team consisting of two members.\nWe began with a thorough review of the concept pages and extensive brainstorming sessions to formulate our project approach. Ultimately, we made the decision to convene daily for as many hours as possible, dedicating our available time and effort to the project.\n\n * The initial tasks we tackled were relatively straightforward. However, there were some among them for which we lacked prior knowledge, prompting us to search online for resources that could provide us with explanations. I distinctly recall one such task: \"How to utilize the UUID module in Python.\"\n\u003cimg align=\"center\" alt=\"hbnb\" width=\"850\" src=\"https://github.com/victor0089/AirBnB_clone/blob/main/hbnb.png\"\u003e\n\u003cimg align=\"center\" alt=\"hbnb\" width=\"850\" src=\"https://github.com/victor0089/AirBnB_clone/blob/main/hbnb2.png\"\u003e\n## 0x00.Table of contents\n\n* [0x01 Introduction](#0x01-Introduction)\n* [0x02 Environment](#0x02-Environment)\n* [0x03 Installation](#0x03-Installation)\n* [0x04 Testing](#0x04-Testing)\n* [0x05 Usage](#0x05-Usage)\n* [0x06 Authors](#0x06-Authors)\n\n## 0x01 Introduction\n\nTeam project to build a clone of [AirBnB](https://www.airbnb.com/).\n\nThe console is a command interpreter to manage objects abstraction between objects and how they are stored.\n\nTo see the fundamental background of the project visit the [Wiki](https://github.com/ralexrivero/AirBnB_clone/wiki).\n\nThe console will perform the following tasks:\n\n* create a new object\n* retrive an object from a file\n* do operations on objects\n* destroy an object\n\n### Storage\n\nAll the classes are handled by the `Storage` engine in the `FileStorage` Class.\n\n## 0x02 Environment\n\n\u003c!-- ubuntu --\u003e\n\u003ca href=\"https://ubuntu.com/\" target=\"_blank\"\u003e \u003cimg height=\"\" src=\"https://img.shields.io/static/v1?label=\u0026message=Ubuntu\u0026color=E95420\u0026logo=Ubuntu\u0026logoColor=E95420\u0026labelColor=2F333A\" alt=\"Suite CRM\"\u003e\u003c/a\u003e \u003c!-- bash --\u003e \u003ca href=\"https://www.gnu.org/software/bash/\" target=\"_blank\"\u003e \u003cimg height=\"\" src=\"https://img.shields.io/static/v1?label=\u0026message=GNU%20Bash\u0026color=4EAA25\u0026logo=GNU%20Bash\u0026logoColor=4EAA25\u0026labelColor=2F333A\" alt=\"terminal\"\u003e\u003c/a\u003e \u003c!-- python--\u003e \u003ca href=\"https://www.python.org\" target=\"_blank\"\u003e \u003cimg height=\"\" src=\"https://img.shields.io/static/v1?label=\u0026message=Python\u0026color=FFD43B\u0026logo=python\u0026logoColor=3776AB\u0026labelColor=2F333A\" alt=\"python\"\u003e\u003c/a\u003e \u003c/a\u003e \u003c!-- vim --\u003e \u003ca href=\"https://www.vim.org/\" target=\"_blank\"\u003e \u003cimg height=\"\" src=\"https://img.shields.io/static/v1?label=\u0026message=Vim\u0026color=019733\u0026logo=Vim\u0026logoColor=019733\u0026labelColor=2F333A\" alt=\"Suite CRM\"\u003e\u003c/a\u003e \u003c!-- vs code --\u003e \u003ca href=\"https://code.visualstudio.com/\" target=\"_blank\"\u003e \u003cimg height=\"\" src=\"https://img.shields.io/static/v1?label=\u0026message=Visual%20Studio%20Code\u0026color=5C2D91\u0026logo=Visual%20Studio%20Code\u0026logoColor=5C2D91\u0026labelColor=2F333A\" alt=\"Suite CRM\"\u003e\u003c/a\u003e \u003c/a\u003e\u003c!-- git --\u003e \u003ca href=\"https://git-scm.com/\" target=\"_blank\"\u003e \u003cimg height=\"\" src=\"https://img.shields.io/static/v1?label=\u0026message=Git\u0026color=F05032\u0026logo=Git\u0026logoColor=F05032\u0026labelColor=2F333A\" alt=\"git distributed version control system\"\u003e\u003c/a\u003e \u003c!-- github --\u003e \u003ca href=\"https://github.com\" target=\"_blank\"\u003e \u003cimg height=\"\" src=\"https://img.shields.io/static/v1?label=\u0026message=GitHub\u0026color=181717\u0026logo=GitHub\u0026logoColor=f2f2f2\u0026labelColor=2F333A\" alt=\"Github\"\u003e\u003c/a\u003e\n \u003c!-- Style guidelines --\u003e\n* Style guidelines:\n  * [pycodestyle (version 2.7.*)](https://pypi.org/project/pycodestyle/)\n  * [PEP8](https://pep8.org/)\n\nAll the development and testing was runned over an operating system Ubuntu 20.04 LTS using programming language Python 3.8.3. The editors used were VIM 8.1.2269, VSCode 1.6.1 and Atom 1.58.0 . Control version using Git 2.25.1.\n\n## 0x03 Installation\n\n```bash\ngit clone https://github.com/victor0089/AirBnB_clone.git\n```\n\nchange to the `AirBnb` directory and run the command:\n\n```bash\n ./console.py\n```\n\n### Execution\n\nIn interactive mode\n\n```bash\n$ ./console.py\n(hbnb) help\n\nDocumented commands (type help \u003ctopic\u003e):\n========================================\nEOF  help  quit\n\n(hbnb)\n(hbnb)\n(hbnb) quit\n$\n```\n\nin Non-interactive mode\n\n```bash\n$ echo \"help\" | ./console.py\n(hbnb)\n\nDocumented commands (type help \u003ctopic\u003e):\n========================================\nEOF  help  quit\n(hbnb)\n$\n$ cat test_help\nhelp\n$\n$ cat test_help | ./console.py\n(hbnb)\n\nDocumented commands (type help \u003ctopic\u003e):\n========================================\nEOF  help  quit\n(hbnb)\n$\n```\n\n## 0x04 Testing\n\nAll the test are defined in the `tests` folder.\n\n### Documentation\n\n* Modules:\n\n```python\npython3 -c 'print(__import__(\"my_module\").__doc__)'\n```\n\n* Classes:\n\n```python\npython3 -c 'print(__import__(\"my_module\").MyClass.__doc__)'\n```\n\n* Functions (inside and outside a class):\n\n```python\npython3 -c 'print(__import__(\"my_module\").my_function.__doc__)'\n```\n\nand\n\n```python\npython3 -c 'print(__import__(\"my_module\").MyClass.my_function.__doc__)'\n```\n\n### Python Unit Tests\n\n* unittest module\n* File extension ``` .py ```\n* Files and folders star with ```test_```\n* Organization:for ```models/base.py```, unit tests in: ```tests/test_models/test_base.py```\n* Execution command: ```python3 -m unittest discover tests```\n* or: ```python3 -m unittest tests/test_models/test_base.py```\n\n### run test in interactive mode\n\n```bash\necho \"python3 -m unittest discover tests\" | bash\n```\n\n### run test in non-interactive mode\n\nTo run the tests in non-interactive mode, and discover all the test, you can use the command:\n\n```bash\npython3 -m unittest discover tests\n```\n\n\n## 0x05 Usage\n\n* Start the console in interactive mode:\n\n```bash\n$ ./console.py\n(hbnb)\n```\n\n* Use help to see the available commands:\n\n```bash\n(hbnb) help\n\nDocumented commands (type help \u003ctopic\u003e):\n========================================\nEOF  all  count  create  destroy  help  quit  show  update\n\n(hbnb)\n```\n\n* Quit the console:\n\n```bash\n(hbnb) quit\n$\n```\n\n### Commands\n\n\u003e The commands are displayed in the following format *Command / usage / example with output*\n\n* Create\n\n\u003e *Creates a new instance of a given class. The class' ID is printed and the instance is saved to the file file.json.*\n\n```bash\ncreate \u003cclass\u003e\n\n```\n\n```bash\n(hbnb) create BaseModel\n6cfb47c4-a434-4da7-ac03-2122624c3762\n(hbnb)\n```\n\n* Show\n\n```bash\nshow \u003cclass\u003e \u003cid\u003e\n```\n\n```bash\n(hbnb) show BaseModel 6cfb47c4-a434-4da7-ac03-2122624c3762\n[BaseModel] (a) [BaseModel] (6cfb47c4-a434-4da7-ac03-2122624c3762) {'id': '6cfb47c4-a434-4da7-ac03-2122624c3762', 'created_at': datetime.datetime(2021, 11, 14, 3, 28, 45, 571360), 'updated_at': datetime.datetime(2021, 11, 14, 3, 28, 45, 571389)}\n(hbnb)\n```\n\n* Destroy\n\n\u003e *Deletes an instance of a given class with a given ID.*\n\u003e *Update the file.json*\n\n```bash\n(hbnb) create User\n0c56g2b8-7ffa-42b7-8709-d9d54b76j472\n(hbnb) destroy User 0c56g2b8-7ffa-42b7-8709-d9d54b76j472\n(hbnb) show User 0c56g2b8-7ffa-42b7-8709-d9d54b76j472\n** no instance found **\n(hbnb)\n```\n\n* all\n\n\u003e *Prints all string representation of all instances of a given class.*\n\u003e *If no class is passed, all classes are printed.*\n\n```bash\n(hbnb) create BaseModel\ne45ddfg9-eb80-6558-99a9-226d4f08s329\n(hbnb) all BaseModel\n[\"[BaseModel] (4c8f7ebc-257f-4ed1-b26b-e7aacr457697) [BaseModel] (4c8f7ebc-257f-4ed1-b26b-e7aacr457697) {'id': '4c8f7ebc-257f-4ed1-b26b-e7aace457697', 'created_at': datetime.datetime(2021, 11, 13, 22, 19, 19, 447155), 'updated_at': datetime.datetime(2021, 11, 13, 22, 19, 19, 557257), 'name': 'My First Model', 'my_number': 45}\"]\n[\"[BaseMode\n```\n\n* count\n\n\u003e *Prints the number of instances of a given class.*\n\n```bash\n(hbnb) create City\n4e01c33e-2564-42c2-b61c-47e512898dad\n(hbnb) create City\ne952b772-80a5-41e9-b728-6bc2dc5c21f4\n(hbnb) count City\n1\n(hbnb)\n```\n\n* update\n\n\u003e *Updates an instance based on the class name, id, and kwargs passed.*\n\u003e *Update the file.json*\n```\n## Authors\n\u003cdetails\u003e\n    \u003csummary\u003eVictor Adly\u003c/summary\u003e\n    \u003csummary\u003eMaryam Amrani\u003c/summary\u003e\n    \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"https://www.github.com/victor0089\"\u003eGithub\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"mailto:victor.mecdoors@gmail.com\"\u003ee-mail\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"https://www.github.com/AMaaryam\"\u003eGithub\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"mailto:a.maaryam@gmail.com\"\u003ee-mail\u003c/a\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/details\u003e\n\n## How to add Author file\n`Bash script for generating the list of authors in git repo`\n```\n#!/bin/sh\n\ngit shortlog -se \\\n  | perl -spe 's/^\\s+\\d+\\s+//' \\\n  | sed -e '/^CommitSyncScript.*$/d' \\\n  \u003e AUTHORS\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictor0089%2Fairbnb_clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictor0089%2Fairbnb_clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictor0089%2Fairbnb_clone/lists"}