Authors: Kyle Pinkerton (8122569) David Hew-wing (300013907)
This project is an "AirBnB clone" created for our CSI2132 (Databases) Winter 2020 Final Project.
The focus of this project was to apply the fundamentals of database design to create a valid domain-specific schema which could then be utilized for the implementation of a web application resembling airbnb.com.
The following is a video overview of the project: https://www.youtube.com/watch?v=FUaoXAJs5TY
-
pip install -r requirements.txt (PYTHON 3)
-
go to the
db.py
file in thedb
directory, at the top you will see the following:
dbname = "kpink074"
user = "kpink074"
password = os.environ.get("UOTTAWA_PW")
host = "web0.site.uottawa.ca"
port = "15432"
schema = "project"
Enter your relevant information to the above parameters in order to connect to your specific database instance.
-
run
python3 generate_table_data.py
in thedb
directory to automatically create all tables and fill them with generated data (generating the data takes some time... see specific instructions for this setup script below). -
As an alternative to Step 3 (generating your own own data using
generate_table_data.py
), you can instead restore your database using the backup filesdefaultdata.backup
anddefaultdata.sql
located in thedb/backups
directory (for more information on how to do this visit https://www.postgresql.org/docs/9.1/backup-dump.html). This data was generated usinggenerate_table_data.py large
. A caveat to using this approach to populate your database is the fact that during the generation of data user/property pictures are saved tostatic/images
in order to be served in the application. This means that your application will not have generated pictures. The benefit of this approach is that you will not have to wait for data to be generated using the data generation script. -
Run the app
python3 app.py
and then go to127.0.0.1:5000/
, you will be on the homepage of the app and ready to go!
When running python 3 generate_table_data.py
a "medium" dataset will be generated as default, however several command-line arguments can be passed to alter how much data will be generated:
python3 generate_table_data.py small
- a relatively small amount of generated data ~250 mb of free space requiredpython3 generate_table_data.py medium
- (DEFAULT - RECOMMENDED) a relatively larger amount amount of generated data compared tosmall
~550 mb of free space requiredpython3 generate_table_data.py large
- a relatively larger amount amount of generated data compared tomedium
~2.5 gb of free space required
If an error occurs during data generation, use python3 generate_table_data.py reset
to reset the schema, and then run the script again (if the script "hangs" when using reset
(i.e. makes no progress), there is most likely issues regarding corrupt cursors in postgresql... try again in a couple minutes or manually the fix cursors using your DBMS interface).