{"id":19827103,"url":"https://github.com/mohamed-mostafaaa/airbnb_clone","last_synced_at":"2026-06-08T18:31:34.451Z","repository":{"id":216571638,"uuid":"741461464","full_name":"Mohamed-Mostafaaa/AirBnB_clone","owner":"Mohamed-Mostafaaa","description":"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":"2024-01-23T02:26:18.000Z","size":246,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T20:56:07.360Z","etag":null,"topics":["console","hbnb","oop","python3","webstatic"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mohamed-Mostafaaa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-10T12:53:23.000Z","updated_at":"2025-02-20T14:08:52.000Z","dependencies_parsed_at":"2025-02-28T16:52:11.822Z","dependency_job_id":"e2796722-be93-47cb-af4e-741949d0ce8c","html_url":"https://github.com/Mohamed-Mostafaaa/AirBnB_clone","commit_stats":null,"previous_names":["mohamed-mostafaaa/airbnb_clone"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mohamed-Mostafaaa/AirBnB_clone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohamed-Mostafaaa%2FAirBnB_clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohamed-Mostafaaa%2FAirBnB_clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohamed-Mostafaaa%2FAirBnB_clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohamed-Mostafaaa%2FAirBnB_clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mohamed-Mostafaaa","download_url":"https://codeload.github.com/Mohamed-Mostafaaa/AirBnB_clone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohamed-Mostafaaa%2FAirBnB_clone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34075953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["console","hbnb","oop","python3","webstatic"],"created_at":"2024-11-12T11:12:29.262Z","updated_at":"2026-06-08T18:31:34.435Z","avatar_url":"https://github.com/Mohamed-Mostafaaa.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- @format --\u003e\n\n![img](https://assets.imaginablefutures.com/media/images/ALX_Logo.max-200x150.png)\n\n\u003e AirBNB clone Console\n\n![hbnb](./images/hbtn.png)\n\n## Description :house:\n\nAirBnb is a complete web application, integrating database storage,\na back-end API, and front-end interfacing in a clone of AirBnB.\n\nThe project currently only implements the back-end console.\n\n## About\n\nThis is the First Project towards our AirBnB clone project at [ALX](alxafrica.com). Done by [Mohamed](https://github.com/Mohamed-Mostafaaa) and [Eman](https://github.com/emanelkamel)\n\nThis 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\n\n## General Use\n\nStep 1.\nClone the repository and cd into the repository\n\nStep 2.\nInside the repository, there is a \"console.py\" file which contains the command line interpreter. Run this command in the terminal to see how it works\n\"$ python3 console.py\"\n\nStep 3.\nWhen this command is run this appears\n(hbnb)\n\nStep 4.\nType ? to view all the commands in the interpreter\n\n## Resources\n\n**Read or watch**:\n\n1. [cmd module](https://docs.python.org/3.8/library/cmd.html)\n2. [cmd module in depth](http://pymotw.com/2/cmd/)\n3. [uuid module](https://docs.python.org/3.8/library/uuid.html)\n4. [datetime](https://docs.python.org/3.8/library/datetime.html)\n5. [unittest module](https://docs.python.org/3.8/library/unittest.html#module-unittest)\n6. [args/kwargs](https://yasoob.me/2013/08/04/args-and-kwargs-in-python-explained/)\n7. [python test cheatsheet](https://www.pythonsheets.com/notes/python-tests.html)\n8. [cmd module wiki page](https://wiki.python.org/moin/CmdModule)\n9. [python unittests](https://realpython.com/python-testing/)\n\n## Classes :cl:\n\nAirBnB utilizes the following classes:\n\n|                                | BaseModel                            | FileStorage                          | User                                                 | State                     | City                      | Amenity                   | Place                                                                                                                                                                      | Review                            |\n| ------------------------------ | ------------------------------------ | ------------------------------------ | ---------------------------------------------------- | ------------------------- | ------------------------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |\n| **PUBLIC INSTANCE ATTRIBUTES** | `id`\u003cbr\u003e`created_at`\u003cbr\u003e`updated_at` |                                      | Inherits from `BaseModel`                            | Inherits from `BaseModel` | Inherits from `BaseModel` | Inherits from `BaseModel` | Inherits from `BaseModel`                                                                                                                                                  | Inherits from `BaseModel`         |\n| **PUBLIC INSTANCE METHODS**    | `save`\u003cbr\u003e`to_dict`                  | `all`\u003cbr\u003e`new`\u003cbr\u003e`save`\u003cbr\u003e`reload` | \"\"                                                   | \"\"                        | \"\"                        | \"\"                        | \"\"                                                                                                                                                                         | \"\"                                |\n| **PUBLIC CLASS ATTRIBUTES**    |                                      |                                      | `email`\u003cbr\u003e`password`\u003cbr\u003e`first_name`\u003cbr\u003e`last_name` | `name`                    | `state_id`\u003cbr\u003e`name`      | `name`                    | `city_id`\u003cbr\u003e`user_id`\u003cbr\u003e`name`\u003cbr\u003e`description`\u003cbr\u003e`number_rooms`\u003cbr\u003e`number_bathrooms`\u003cbr\u003e`max_guest`\u003cbr\u003e`price_by_night`\u003cbr\u003e`latitude`\u003cbr\u003e`longitude`\u003cbr\u003e`amenity_ids` | `place_id`\u003cbr\u003e`user_id`\u003cbr\u003e`text` |\n| **PRIVATE CLASS ATTRIBUTES**   |                                      | `file_path`\u003cbr\u003e`objects`             |                                                      |                           |                           |                           |                                                                                                                                                                            |                                   |\n\n## Storage :baggage_claim:\n\nThe above classes are handled by the abstracted storage engine defined in the\n[FileStorage](./models/engine/file_storage.py) class.\n\nEvery time the backend is initialized, AirBnB instantiates an instance of\n`FileStorage` called `storage`. The `storage` object is loaded/re-loaded from\nany class instances stored in the JSON file `file.json`. As class instances are\ncreated, updated, or deleted, the `storage` object is used to register\ncorresponding changes in the `file.json`.\n\n## Console :computer:\n\nThe console is a command line interpreter that permits management of the backend\nof AirBnB. It can be used to handle and manipulate all classes utilized by\nthe application (achieved by calls on the `storage` object defined above).\n\n### Using the Console\n\nThe AirBnB console can be run both interactively and non-interactively.\nTo run the console in non-interactive mode, pipe any command(s) into an execution\nof the file `console.py` at the command line.\n\n```\n$ echo \"help\" | ./console.py\n(hbnb)\nDocumented commands (type help \u003ctopic\u003e):\n========================================\nEOF  all  count  create  destroy  help  quit  show  update\n\n(hbnb)\n$\n```\n\nAlternatively, to use the AirBnB console in interactive mode, run the\nfile `console.py` by itself:\n\n```\n$ ./console.py\n```\n\nWhile running in interactive mode, the console displays a prompt for input:\n\n```\n$ ./console.py\n(hbnb)\n```\n\nTo quit the console, enter the command `quit`, or input an EOF signal\n(`ctrl-D`).\n\n```\n$ ./console.py\n(hbnb) quit\n$\n```\n\n```\n$ ./console.py\n(hbnb) EOF\n$\n```\n\nAll tests should also pass in non-interactive mode:` $ echo \"python3 -m unittest discover tests\" | bash`\n\n![console](./images/console.png)\n\n## Testing :straight_ruler:\n\nUnittests for the AirBnB project are defined in the [tests](./tests)\nfolder. To run the entire test suite simultaneously, execute the following command:\n\n```\n$ python3 unittest -m discover tests\n```\n\nAlternatively, you can specify a single test file to run at a time:\n\n```\n$ python3 unittest -m tests/test_console.py\n```\n\n## Authors :black_nib:\n\n- **Mohamed Mostafa** \u003c[Mohamed-Mostafaaa](https://github.com/Mohamed-Mostafaaa)\u003e\n- **Eman Elkamel** \u003c[emanelkamel](https://github.com/emanelkamel)\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamed-mostafaaa%2Fairbnb_clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohamed-mostafaaa%2Fairbnb_clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamed-mostafaaa%2Fairbnb_clone/lists"}