{"id":20002843,"url":"https://github.com/codewithmide/airbnb_clone_v4","last_synced_at":"2025-03-02T00:22:00.767Z","repository":{"id":62304703,"uuid":"559260975","full_name":"codewithmide/AirBnB_clone_v4","owner":"codewithmide","description":"Final version of the Airbnb clone project😁","archived":false,"fork":false,"pushed_at":"2022-10-30T20:01:12.000Z","size":291,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T13:23:47.743Z","etag":null,"topics":["api","html-css-javascript","jquery","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/codewithmide.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}},"created_at":"2022-10-29T15:05:07.000Z","updated_at":"2022-11-21T22:51:01.000Z","dependencies_parsed_at":"2023-01-21T00:00:23.569Z","dependency_job_id":null,"html_url":"https://github.com/codewithmide/AirBnB_clone_v4","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmide%2FAirBnB_clone_v4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmide%2FAirBnB_clone_v4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmide%2FAirBnB_clone_v4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmide%2FAirBnB_clone_v4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewithmide","download_url":"https://codeload.github.com/codewithmide/AirBnB_clone_v4/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241441056,"owners_count":19963345,"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":["api","html-css-javascript","jquery","python"],"created_at":"2024-11-13T05:23:17.103Z","updated_at":"2025-03-02T00:22:00.739Z","avatar_url":"https://github.com/codewithmide.png","language":"Python","readme":"# AirBnB Clone - The Console\nThe console is the first segment of the AirBnB project at Holberton School that will collectively cover fundamental concepts of higher level programming. The goal of AirBnB project is to eventually deploy our server a simple copy of the AirBnB Website(HBnB). A command interpreter is created in this segment to manage objects for the AirBnB(HBnB) website.\n\n#### Functionalities of this command interpreter:\n* Create a new object (ex: a new User or a new Place)\n* Retrieve an object from a file, a database etc...\n* Do operations on objects (count, compute stats, etc...)\n* Update attributes of an object\n* Destroy an object\n\n## Table of Content\n* [Environment](#environment)\n* [Installation](#installation)\n* [File Descriptions](#file-descriptions)\n* [Usage](#usage)\n* [Examples of use](#examples-of-use)\n* [Bugs](#bugs)\n* [Authors](#authors)\n* [License](#license)\n\n## Environment\nThis project is interpreted/tested on Ubuntu 14.04 LTS using python3 (version 3.4.3)\n\n## Installation\n* Clone this repository: `git clone \"https://github.com/alexaorrico/AirBnB_clone.git\"`\n* Access AirBnb directory: `cd AirBnB_clone`\n* Run hbnb(interactively): `./console` and enter command\n* Run hbnb(non-interactively): `echo \"\u003ccommand\u003e\" | ./console.py`\n\n## File Descriptions\n[console.py](console.py) - the console contains the entry point of the command interpreter. \nList of commands this console current supports:\n* `EOF` - exits console \n* `quit` - exits console\n* `\u003cemptyline\u003e` - overwrites default emptyline method and does nothing\n* `create` - Creates a new instance of`BaseModel`, saves it (to the JSON file) and prints the id\n* `destroy` - Deletes an instance based on the class name and id (save the change into the JSON file). \n* `show` - Prints the string representation of an instance based on the class name and id.\n* `all` - Prints all string representation of all instances based or not on the class name. \n* `update` - Updates an instance based on the class name and id by adding or updating attribute (save the change into the JSON file). \n\n#### `models/` directory contains classes used for this project:\n[base_model.py](/models/base_model.py) - The BaseModel class from which future classes will be derived\n* `def __init__(self, *args, **kwargs)` - Initialization of the base model\n* `def __str__(self)` - String representation of the BaseModel class\n* `def save(self)` - Updates the attribute `updated_at` with the current datetime\n* `def to_dict(self)` - returns a dictionary containing all keys/values of the instance\n\nClasses inherited from Base Model:\n* [amenity.py](/models/amenity.py)\n* [city.py](/models/city.py)\n* [place.py](/models/place.py)\n* [review.py](/models/review.py)\n* [state.py](/models/state.py)\n* [user.py](/models/user.py)\n\n#### `/models/engine` directory contains File Storage class that handles JASON serialization and deserialization :\n[file_storage.py](/models/engine/file_storage.py) - serializes instances to a JSON file \u0026 deserializes back to instances\n* `def all(self)` - returns the dictionary __objects\n* `def new(self, obj)` - sets in __objects the obj with key \u003cobj class name\u003e.id\n* `def save(self)` - serializes __objects to the JSON file (path: __file_path)\n* ` def reload(self)` -  deserializes the JSON file to __objects\n\n#### `/tests` directory contains all unit test cases for this project:\n[/test_models/test_base_model.py](/tests/test_models/test_base_model.py) - Contains the TestBaseModel and TestBaseModelDocs classes\nTestBaseModelDocs class:\n* `def setUpClass(cls)`- Set up for the doc tests\n* `def test_pep8_conformance_base_model(self)` - Test that models/base_model.py conforms to PEP8\n* `def test_pep8_conformance_test_base_model(self)` - Test that tests/test_models/test_base_model.py conforms to PEP8\n* `def test_bm_module_docstring(self)` - Test for the base_model.py module docstring\n* `def test_bm_class_docstring(self)` - Test for the BaseModel class docstring\n* `def test_bm_func_docstrings(self)` - Test for the presence of docstrings in BaseModel methods\n\nTestBaseModel class:\n* `def test_is_base_model(self)` - Test that the instatiation of a BaseModel works\n* `def test_created_at_instantiation(self)` - Test created_at is a pub. instance attribute of type datetime\n* `def test_updated_at_instantiation(self)` - Test updated_at is a pub. instance attribute of type datetime\n* `def test_diff_datetime_objs(self)` - Test that two BaseModel instances have different datetime objects\n\n[/test_models/test_amenity.py](/tests/test_models/test_amenity.py) - Contains the TestAmenityDocs class:\n* `def setUpClass(cls)` - Set up for the doc tests\n* `def test_pep8_conformance_amenity(self)` - Test that models/amenity.py conforms to PEP8\n* `def test_pep8_conformance_test_amenity(self)` - Test that tests/test_models/test_amenity.py conforms to PEP8\n* `def test_amenity_module_docstring(self)` - Test for the amenity.py module docstring\n* `def test_amenity_class_docstring(self)` - Test for the Amenity class docstring\n\n[/test_models/test_city.py](/tests/test_models/test_city.py) - Contains the TestCityDocs class:\n* `def setUpClass(cls)` - Set up for the doc tests\n* `def test_pep8_conformance_city(self)` - Test that models/city.py conforms to PEP8\n* `def test_pep8_conformance_test_city(self)` - Test that tests/test_models/test_city.py conforms to PEP8\n* `def test_city_module_docstring(self)` - Test for the city.py module docstring\n* `def test_city_class_docstring(self)` - Test for the City class docstring\n\n[/test_models/test_file_storage.py](/tests/test_models/test_file_storage.py) - Contains the TestFileStorageDocs class:\n* `def setUpClass(cls)` - Set up for the doc tests\n* `def test_pep8_conformance_file_storage(self)` - Test that models/file_storage.py conforms to PEP8\n* `def test_pep8_conformance_test_file_storage(self)` - Test that tests/test_models/test_file_storage.py conforms to PEP8\n* `def test_file_storage_module_docstring(self)` - Test for the file_storage.py module docstring\n* `def test_file_storage_class_docstring(self)` - Test for the FileStorage class docstring\n\n[/test_models/test_place.py](/tests/test_models/test_place.py) - Contains the TestPlaceDoc class:\n* `def setUpClass(cls)` - Set up for the doc tests\n* `def test_pep8_conformance_place(self)` - Test that models/place.py conforms to PEP8.\n* `def test_pep8_conformance_test_place(self)` - Test that tests/test_models/test_place.py conforms to PEP8.\n* `def test_place_module_docstring(self)` - Test for the place.py module docstring\n* `def test_place_class_docstring(self)` - Test for the Place class docstring\n\n[/test_models/test_review.py](/tests/test_models/test_review.py) - Contains the TestReviewDocs class:\n* `def setUpClass(cls)` - Set up for the doc tests\n* `def test_pep8_conformance_review(self)` - Test that models/review.py conforms to PEP8\n* `def test_pep8_conformance_test_review(self)` - Test that tests/test_models/test_review.py conforms to PEP8\n* `def test_review_module_docstring(self)` - Test for the review.py module docstring\n* `def test_review_class_docstring(self)` - Test for the Review class docstring\n\n[/test_models/state.py](/tests/test_models/test_state.py) - Contains the TestStateDocs class:\n* `def setUpClass(cls)` - Set up for the doc tests\n* `def test_pep8_conformance_state(self)` - Test that models/state.py conforms to PEP8\n* `def test_pep8_conformance_test_state(self)` - Test that tests/test_models/test_state.py conforms to PEP8\n* `def test_state_module_docstring(self)` - Test for the state.py module docstring\n* `def test_state_class_docstring(self)` - Test for the State class docstring\n\n[/test_models/user.py](/tests/test_models/test_user.py) - Contains the TestUserDocs class:\n* `def setUpClass(cls)` - Set up for the doc tests\n* `def test_pep8_conformance_user(self)` - Test that models/user.py conforms to PEP8\n* `def test_pep8_conformance_test_user(self)` - Test that tests/test_models/test_user.py conforms to PEP8\n* `def test_user_module_docstring(self)` - Test for the user.py module docstring\n* `def test_user_class_docstring(self)` - Test for the User class docstring\n\n\n## Examples of use\n```\nvagrant AirBnB_clone$./console.py\n(hbnb) help\n\nDocumented commands (type help \u003ctopic\u003e):\n========================================\nEOF  all  create  destroy  help  quit  show  update\n\n(hbnb) all MyModel\n** class doesn't exist **\n(hbnb) create BaseModel\n7da56403-cc45-4f1c-ad32-bfafeb2bb050\n(hbnb) all BaseModel\n[[BaseModel] (7da56403-cc45-4f1c-ad32-bfafeb2bb050) {'updated_at': datetime.datetime(2017, 9, 28, 9, 50, 46, 772167), 'id': '7da56403-cc45-4f1c-ad32-bfafeb2bb050', 'created_at': datetime.datetime(2017, 9, 28, 9, 50, 46, 772123)}]\n(hbnb) show BaseModel 7da56403-cc45-4f1c-ad32-bfafeb2bb050\n[BaseModel] (7da56403-cc45-4f1c-ad32-bfafeb2bb050) {'updated_at': datetime.datetime(2017, 9, 28, 9, 50, 46, 772167), 'id': '7da56403-cc45-4f1c-ad32-bfafeb2bb050', 'created_at': datetime.datetime(2017, 9, 28, 9, 50, 46, 772123)}\n(hbnb) destroy BaseModel 7da56403-cc45-4f1c-ad32-bfafeb2bb050\n(hbnb) show BaseModel 7da56403-cc45-4f1c-ad32-bfafeb2bb050\n** no instance found **\n(hbnb) quit\n```\n\n## 0x06. AirBnB clone - Web dynamic\n`Python` `Front-end` `JavaScript`\n|By: Guillaume, CTO at Holberton School|\n|:--|\n|Weight: 2|\n|Project to be done in teams of 2 people (your team: Barona Mosweu, Olumide Micheal)|\n|Project will start Oct 27, 2022 6:00 AM, must end by Oct 31, 2022 6:00 AM|\n|was released at Oct 28, 2022 6:00 AM|\n|Manual QA review must be done (request it when you are done with the project)|\n|An auto review will be launched at the deadline|\n\n## Resources\n**Read or watch:**\n- [Selector](https://jquery-tutorial.net/selectors/using-elements-ids-and-classes/)\n- [Get and set content](https://jquery-tutorial.net/dom-manipulation/getting-and-setting-content/)\n- [Manipulate CSS classes](https://jquery-tutorial.net/dom-manipulation/getting-and-setting-css-classes/)\n- [Manipulate DOM elements](https://jquery-tutorial.net/dom-manipulation/the-append-and-prepend-methods/)\n- [Document ready](https://learn.jquery.com/using-jquery-core/document-ready/)\n- [Introduction](https://jquery-tutorial.net/ajax/introduction/)\n- [GET \u0026 POST request](https://jquery-tutorial.net/ajax/the-get-and-post-methods/)\n- [HTTP access control (CORS)](https://alx-intranet.hbtn.io/rltoken/tzqJx5SS5cF1BW_lAnXqqg)\n  \n## Learning Objectives\nAt the end of this project, you are expected to be able to explain to anyone, without the help of Google:\n\n### General\n- How cool it is to request your own API\n- How to modify an HTML element style\n- How to get and update an HTML element content\n- How to modify the DOM\n- How to make a GET request with JQuery Ajax\n- How to make a POST request with JQuery Ajax\n- How to listen/bind to DOM events\n- How to listen/bind to user events\n\n## Copyright - Plagiarism\n- You are tasked to come up with solutions for the tasks below yourself to meet with the above learning objectives.\n- You will not be able to meet the objectives of this or any following project by copying and pasting someone else’s work.\n- You are not allowed to publish any content of this project.\n- Any form of plagiarism is strictly forbidden and will result in removal from the program.\n\n## Requirements\n## General\n- Allowed editors: vi, vim, emacs\n- All your files will be interpreted on Chrome (version 57.0)\n- All your files should end with a new line\n- A README.md file, at the root of the folder of the project, is mandatory\n- Your code should be semistandard compliant with the flag --global $: semistandard *.js --global $\n- All your JavaScript must be in the folder scripts\n- You must use JQuery version 3.x\n- You are not allowed to use var\n- HTML should not reload for each action: DOM manipulation, update values, fetch data…\n\n## GitHub\nThere should be one project repository per group. If you clone/fork/whatever a project repository with the same name before the second deadline, you risk a 0% score.\n\n### More Info\nImport JQuery\n```\n\u003chead\u003e\n    \u003cscript src=\"https://code.jquery.com/jquery-3.2.1.min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n```\nBefore starting the project…\nYou will work on a codebase using Flasgger, you will need to install it locally first before starting the RestAPI:\n```\n$ sudo apt-get install -y python3-lxml\n$ sudo pip3 install flask_cors # if it was not installed yet\n$ sudo pip3 install flasgger\n```\nIf the RestAPI is not starting, please read the error message. Based on the(ses) error message(s), you will have to troubleshoot potential dependencies issues.\n\nHere some solutions:\n\njsonschema exception\n```\n$ sudo pip3 uninstall -y jsonschema \n$ sudo pip3 install jsonschema==3.0.1\n```\nNo module named `'pathlib2'`\n```\n$ sudo pip3 install pathlib2\n```\nExpose ports from your Vagrant\nIn your Vagrantfile, add this line for each port forwarded\n```\n# I expose the port 5001 of my vm to the port 5001 on my computer\nconfig.vm.network :forwarded_port, guest: 5001, host: 5001 \nif you need to expose other ports, same line but you will need to replace the “guest port” (inside your vagrant) and your “host port” (outside your vagrant, used from your browser for example)\n```\n\nIt’s important in your project, to use the AirBnB API with the port 5001\n\n## Bugs\nNo known bugs at this time. \n\n## Authors\n- Alexa Orrico - [Github](https://github.com/alexaorrico) / [Twitter](https://twitter.com/alexa\\_orrico)\n- Jennifer Huang - [Github](https://github.com/jhuang10123) / [Twitter](https://twitter.com/earthtojhuang)  \n- Jhoan Zamora - [Github](https://github.com/jzamora5) / [Twitter](https://twitter.com/JhoanZamora10)  \n- David Ovalle - [Github](https://github.com/Nukemenonai) / [Twitter](https://twitter.com/disartDave)\n- Olumide Micheal - [Github](https://github.com/codewithmide) / [Twitter](https://twitter.com/OlumideMicheal_)\n- Barona Mosweu - [Github](https://github.com/mosweubarona\nSecond part of Airbnb: Joann Vuong\n## License\nPublic Domain. No copy write protection. \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithmide%2Fairbnb_clone_v4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithmide%2Fairbnb_clone_v4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithmide%2Fairbnb_clone_v4/lists"}