This project aims to create a clone of the popular accommodation rental platform Airbnb. The project is implemented using Python and SQLAlchemy for managing the database, and it includes various tasks to develop different features and functionalities.
- Introduction
- Installation
- Tasks
- Task 0: Set up Environment
- Task 1: Create BaseModel
- Task 2: Create User Model
- Task 3: Console Command Interpreter
- Task 4: Create Place Model
- Task 5: Advanced Console Commands
- Task 6: File Storage
- Task 7: Database Storage - User
- Task 8: Database Storage - Place
- Task 9: Database Storage - Review
- Task 10: Database Storage - Amenity
- AirBnB Clone Deployment
- Contributing
- License
Airbnb Clone Project is a comprehensive endeavor to replicate the core functionalities of the Airbnb platform. It involves creating models for users, places, reviews, amenities, and implementing features like database storage, console command interpreter, and file storage. Each task builds upon the previous one, gradually enhancing the functionality and usability of the application.
To run this project locally, follow these steps:
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd AirBnB_clone_v2
-
Install dependencies:
pip install -r requirements.txt
-
Set up the database:
# For MySQL database sudo apt-get install mysql-server sudo mysql_secure_installation
-
Run the application:
# For database storage HBNB_ENV=test HBNB_MYSQL_USER=hbnb_dev HBNB_MYSQL_PWD=hbnb_dev_pwd HBNB_MYSQL_HOST=localhost HBNB_MYSQL_DB=hbnb_dev_db HBNB_TYPE_STORAGE=db ./console.py
- Set up the development environment with Python, SQLAlchemy, and Flask.
- Define a base model class with common attributes/methods for all other classes.
- Implement a User model with attributes like email, password, first name, and last name.
- Develop a command-line interpreter to interact with the application.
- Create a Place model with various attributes representing rental properties.
- Enhance the console commands to support advanced functionalities.
- Implement file storage to store application data.
- Set up database storage for the User model.
- Configure database storage for the Place model with relationships to other models.
- Implement database storage for the Review model with foreign key relationships.
- Establish a many-to-many relationship between Place and Amenity models using a separate table.
This repository contains scripts and configurations for deploying the AirBnB Clone project. Below you'll find information about the project, its requirements, and how to use the provided scripts.
This project focuses on deploying the AirBnB Clone project using Fabric for Python3. The deployment involves setting up web servers, compressing files, distributing archives, and managing Nginx configurations.
- Continuous Integration/Continuous Deployment (CI/CD)
- AirBnB clone
- Fabric for Python3
- Nginx configuration
In this deployment project, you will deploy your web_static work using Fabric, a Python library for streamlining SSH usage for deployment tasks. This involves setting up Nginx, creating necessary directories, and configuring Nginx to serve the content properly.
- Python Scripts
- PEP 8 style
- Fabric3 version 1.14.post1
- Executable files with proper shebang
- Documentation for all functions and classes
- Bash Scripts
- Pass Shellcheck without errors
- Executable files with proper shebang
- Documentation for scripts
To install Fabric for Python 3, follow these steps:
$ pip3 uninstall Fabric
$ sudo apt-get install libffi-dev
$ sudo apt-get install libssl-dev
$ sudo apt-get install build-essential
$ sudo apt-get install python3.4-dev
$ sudo apt-get install libpython3-dev
$ pip3 install pyparsing
$ pip3 install appdirs
$ pip3 install setuptools==40.1.0
$ pip3 install cryptography==2.8
$ pip3 install bcrypt==3.1.7
$ pip3 install PyNaCl==1.3.0
$ pip3 install Fabric3==1.14.post1
Run the provided Bash script to set up your web servers for the deployment of web_static:
$ sudo ./0-setup_web_static.sh
Generate a .tgz archive from the contents of the web_static folder of your AirBnB Clone repo using the provided Fabric script:
$ fab -f 1-pack_web_static.py do_pack
Distribute the archive to your web servers using the provided Fabric script:
$ fab -f 2-do_deploy_web_static.py do_deploy:archive_path=<archive_path>
Create and distribute an archive to your web servers using the provided Fabric script:
$ fab -f 3-deploy_web_static.py deploy
Delete out-of-date archives using the provided Fabric script:
$ fab -f 100-clean_web_static.py do_clean:number=<number>
Redo the setup task using Puppet:
$ puppet apply 101-setup_web_static.pp
Contributions are welcome! Feel free to open issues or submit pull requests to help improve this project.
This project is licensed under the MIT License.