https://github.com/tayloradam1999/airbnb_clone
The console for AirBnB in python made in collaboration with Adam Brimer.
https://github.com/tayloradam1999/airbnb_clone
console-application css html5 json python3 unittesting
Last synced: 2 months ago
JSON representation
The console for AirBnB in python made in collaboration with Adam Brimer.
- Host: GitHub
- URL: https://github.com/tayloradam1999/airbnb_clone
- Owner: tayloradam1999
- Created: 2021-05-17T21:32:04.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-18T05:00:38.000Z (about 5 years ago)
- Last Synced: 2025-02-28T01:13:39.801Z (over 1 year ago)
- Topics: console-application, css, html5, json, python3, unittesting
- Language: Python
- Homepage:
- Size: 75.2 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AnA-BnB
## Adam and Adam's AirBnB
## Project Description
First step: Write a command interpreter to manage your AirBnB objects.
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…
## Description of the command interpreter
### What’s a command interpreter?
Do you remember the Shell? It’s exactly the same but limited to a specific use-case. In our case, we want to be able to manage the objects of our project:
* Create a new object (ex: a new User or a new Place)
* Retrieve an object from a file, a database etc…
* Do operations on objects (count, compute stats, etc…)
* Update attributes of an object
* Destroy an object
### Starting the command interpreter
You are able to start the command interpreter by running the following command:
```
./console
```
### Using the command interpereter
Once you have ran
```
./console
```
you are now able to run commands within the interpreter while using the following format!
```
create BaseModel
```
```
show BaseModel
```
```
help create
```
## File Structure
The file structure of this program is quite simple.
We have our console inside of the home directory, and within the home directory, there are two parent directories called 'models' and 'tests'.
'models' holds files for all of the classes that will be used within our program. Also, within this directory, there is another parent directory called 'engine'.
'engine' is a directory that holds 'file_storage.py' which holds a class that serializes instances to a JSON file and deserializes JSON files to instances.
Now, if we go back to our home directory, we can then go into 'tests' which is a directory that holds ANOTHER directory called 'test_models', which holds all of our unittesting files. Unittesting is important, never forget to unittest.