This proejct is a sublet finder application where tenants and potential subtenants can easily find each other through user friendly filters to find their perfect match! The targetted users of our application are students in the KW region who attend the University of Waterloo and Wilfrid Laurier University. Users will be able to create their own accounts to upload postings, view postings, as well as search by keywords, filter by term, rooms, and gender to sort through available sublets that are currently in the system!
- Secure Login/Signup flow using state-of-hart salting and hashing using
bcrypt
- Creating multimedia postings for authorized users
- Index postings with intuitive filtering and sorting capibilities
- Index postings with complete sentence searches based on score based text matching
- Show information for a single posting and supporting images for user postings using AWS S3
We support scraping of all the paginated postings from https://bamboohousing.ca using https://canadapostalcode.net/ for postal code validation and https://randomuser.me/ for user generation.
Here are some statistics about the dataset:
- There are a total of ~100 postings scraped from www.bamboohousing.ca
- There are ~60 different addresses for those postings.
- There are ~500 scraped photographs for those postings.
With a fresh db instance (detailed instructions below), you can use the npm run db_pop_sample.js
script to scrape the real sublet posting data (as desribed in the report).
./server/app/controllers/user.controller.js
./server/app/controllers/posting.controller.js
./server/app/controllers/photo.controller.js
./client/src/components
contains all the different components for the web app../client/src/App.js
contains all the routes (private and public) for the app.
- MySQL connection:
./server/app/models/db.js
- AWS S3 upload to bucket:
./server/app/models/s3.js
- Our production database uses MySQL & is hosted on an AWS RDS instance, which functions through the user
admin
admin
is a super user which allows them to create triggers
- Install MySQL locally and run sql:
CREATE USER 'admin'@'%' IDENTIFIED BY 'rds_password_here'
- Make
admin
a super user by running:
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%';
FLUSH PRIVILEGES;
- Use
server/.sample-env
file as a template to create your ownserver/.env
file - Install dependencies by running the following in the project root:
cd server && npm i
andcd client && npm i
- Setting up the db -
cd server
and you can set up your local database in 2 ways:
- FYI: to point to the local mysql db you need to set
NODE_ENV
todev
and to point to RDS just set it toprod
in theserver/.env
(NODE_ENV=dev
orNODE_ENV=prod
in yourserver/.env
)
- Set database credentials in
.env
to point to RDS instance npm run db_dump <file_path>
to store database dump at<file_path>
(recommend file name ends indump.sql
so that it can be gitignored)- Set database credentials in
.env
to point to local instance npm run db_import <file_path>
to import database dump (MAKE SURE YOU'RE NOT POINTING AT RDS)
- Set database credentials in
.env
to point to local instance (MAKE SURE YOU'RE NOT POINTING AT RDS) - (optional, but highly recommended)
npm run db_backup
to back up local database instance npm run db_setup
to get a fresh database instance- (optional, but highly recommended)
npm run db_migrate_addresses
to migrateAddress
table from the backup database to new database - (optional)
npm run db_pop_sample
to populate the database with scraped sample data
Run the following npm run dev
from the server
directory to launch the backend and the frontend for the app.
You can run any SQL script using one of these two ways:
mysql -h <HOSTNAME> -u <USER> -p < <sql_file>
# or
npm run db_exec <sql_file>
Used this repository: https://github.com/bezkoder/nodejs-express-mysql/tree/d8cef0f9dace78d1a78da58611526e6474cb2a52 to set the project structure and a simple CRUD api.