KwabinaIverson / AirBnB_clone

AirBnB_clone

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AirBnB Clone

AirBnB Image

Purpose

The goal of the project is to deploy on our server a simple copy of the AirBnB website.

We won’t implement all the features, only some of them to cover all fundamental concepts of the higher level programming track.

After 4 months, we will have a complete web application composed by:

  • A command interpreter to manipulate data without a visual interface, like in a Shell (perfect for development and debugging)
  • A website (the front-end) that shows the final product to everybody: static and dynamic
  • A database or files that store data (data = objects)
  • An API that provides a communication interface between the front-end and your data (retrieve, create, delete, update them)

Final product

AirBnB Home page Image

AirBnB Feature page Image

Concepts to learn

  • Unittest - and please work all together on tests cases
  • Python packages concept page
  • Serialization/Deserialization
  • *args, **kwargs
  • datetime
  • More coming soon!

Steps

The console

  • create your data model
  • manage (create, update, destroy, etc) objects via a console / command interpreter
  • store and persist objects to a file (JSON file) The first piece is to manipulate a powerful storage system. This storage engine will give us an abstraction between “My object” and “How they are stored and persisted”. This means: from your console code (the command interpreter itself) and from the front-end and RestAPI you will build later, you won’t have to pay attention (take care) of how your objects are stored.

This abstraction will also allow you to change the type of storage easily without updating all of your codebase.

The console will be a tool to validate this storage engine

Web static

  • learn HTML/CSS
  • create the HTML of your application
  • create template of each object

MySQL storage

  • replace the file storage by a Database storage
  • map your models to a table in database by using an O.R.M.

Web framework - templating

  • create your first web server in Python
  • make your static HTML file dynamic by using objects stored in a file or database

RESTful API

  • expose all your objects stored via a JSON web interface
  • manipulate your objects via a RESTful API

Web dynamic

  • learn JQuery
  • load objects from the client side by using your own RESTful API

Execution

description of the command interpreter: The program starts by running the command ./console.py in the terminal. The program allows you to interact with your it by typing commands.

  • The program displays a prompt. The prompt symbol is (hbnb).
  • The user types a command and presses Enter.
  • The program parses the command into its component parts.
  • The program finds function that implements the command.
  • The program executes the command.
  • The program displays the output of the command.
  • The program returns to step 1. This happens until it's exited.

Interactive mode

$ ./console.py
(hbnb) help

Documented commands (type help <topic>):
========================================
EOF  help  quit

(hbnb) 
(hbnb) 
(hbnb) quit
$

Non-interactive mode

$ echo "help" | ./console.py
(hbnb)

Documented commands (type help <topic>):
========================================
EOF  help  quit
(hbnb) 
$
$ cat test_help
help
$
$ cat test_help | ./console.py
(hbnb)

Documented commands (type help <topic>):
========================================
EOF  help  quit
(hbnb) 
$

About

AirBnB_clone


Languages

Language:HTML 56.1%Language:Python 27.1%Language:CSS 16.9%