ROOM.IO is a Flask-based web application designed to simplify the search for apartment units while considering pet policies. It allows users to register, login, search for apartments, and register their pets to ensure compatibility with apartment policies.
- User Authentication: Register and login to access personalized features.
- Apartment Search: Search for apartment units based on specific criteria.
- Pet Registration: Register pets and automatically check against apartment pet policies.
- Interest and Pet Management: Update pet and interest information seamlessly.
- Advanced Search Functionality: Zip Code, City, State, Rent Range, Bedroom count, Bathroom count, Amenities
- Display more detailed building and apartment information
- Mark interest: View who is interested in an apartment and mark your own interest.
- Display average rent prices in the zip code
- Monthly Rent Estimator based on zip code and bedroom / bathroom count
- Secure from SQL Injections and XSS attacks
- Where the Flask routing and majority of business logic is held. Simple SQL queries are also held here
- Handles user authentication / registration services and the complex business logic for Searching
- Searching slowly adds search criteria to the query as needed based on what search parameters were selected in
/search_units
- Creates a config class to read in the
config.properties
file insrc/resources/config.properties
- Configurable variables include Flask Secret Key, Flask Debug Mode, Flask Host Address, Flask Port, and database configuration settings
- Handles connection to database and MySQL handling of queries. Does not implement any business logic.
- Handling for password hashing and checking against hashed passwords.
Prerequisite packages listed in requirements.txt
- Python 3.6+
- Flask
- pymysql
- bcrypt
- configparser
Before running the application, ensure you have MySQL installed and running. Create a database named ROOMIO
and import any necessary schema or data (table definitions and sample data are located in the src/resources/sql/
folder).
Update the MYSQL connection parameters
in the src/resources/config.properties
file with your MySQL user, password, and other details as needed.
Install the required Python packages (as described in requirements.txt
) by running:
pip install Flask pymysql bcrypt configparser
To start the application, navigate to the directory containing the Flask application file and run:
python run.py
The application will start running on http://127.0.0.1:5000
by default. You can access the web application by visiting this URL in a web browser. You can modify the server and port in src/resources/config.properties
-
Homepage
- Endpoint:
/
- Description: Displays the main homepage.
- Endpoint:
-
Login
- Endpoint:
/login
- Methods: GET, POST
- Description: Handles user login. Displays login form on GET and processes login on POST.
- Endpoint:
-
Register
- Endpoint:
/register
- Methods: GET, POST
- Description: Handles new user registration. Displays registration form on GET and processes registration on POST.
- Endpoint:
-
Login Failure
- Endpoint:
/login_failure
- Description: Displays a login failure message.
- Endpoint:
-
Logout
- Endpoint:
/logout
- Description: Clears the user session and redirects to the homepage.
- Endpoint:
-
Dashboard
- Endpoint:
/dashboard
- Description: Displays user-specific dashboard information. Requires login.
- Endpoint:
-
Search Units
- Endpoint:
/search_units
- Description: Allows logged-in users to search for apartment units.
- Endpoint:
-
Unit Results
- Endpoint:
/unit_results
- Methods: GET, POST
- Description: Shows results for apartment units based on search criteria. Requires login.
- Endpoint:
-
Show Details
- Endpoint:
/show_details
- Description: Displays detailed information about a specific apartment unit. Requires login.
- Endpoint:
-
Pet Details
- Endpoint:
/pet_details
- Methods: GET, POST
- Description: Shows and allows modification of pet details. Requires login.
- Endpoint:
-
Delete Pet
- Endpoint:
/delete_pet
- Description: Deletes a specific pet based on user input. Requires login.
- Endpoint:
-
New Interest
- Endpoint:
/new_interest
- Methods: GET, POST
- Description: Allows users to express interest in an apartment unit. Requires login.
- Endpoint:
-
Edit Interests
- Endpoint:
/edit_interests
- Description: Allows users to view and edit their interests in apartment units. Requires login.
- Endpoint:
-
Delete Interest
- Endpoint:
/delete_interest
- Description: Deletes a specific interest based on user selection. Requires login.
- Endpoint:
-
Estimate Rent
- Endpoint:
/estimate_rent
- Methods: GET, POST
- Description: Allows users to estimate rent based on input parameters. Requires login.
- Endpoint:
- The application utilizes session management to maintain user state across requests.
- Certain routes are protected with a
login_required
decorator to ensure that only authenticated users can access them.
This application uses bcrypt for hashing and salting passwords, providing a layer of security for user authentication. Ensure that the Flask secret key and MySQL connection details are kept secure and not exposed publicly.
For further customization and development, I will consider adding more features such as:
- SQL queries stored in a static sql file to access, rather than directly in the Python code
- Email verification for new users.
- User profile page
- Integration with external APIs for additional apartment data (Perhaps Streeteasy?)