Introducing Roomstack: Building an effective room and roommates finder with Django and Linode

Introducing Roomstack: Building an effective room and roommates finder with Django and Linode

Inspiration

At some point in college, we've all had some bad experiences finding a room or living with a bad roommate while others(mostly freshmen) who are just moving in their freshman year either had difficulties with getting an hostel or moving in with an ideal roommate (so as to cut cost) as they are new to the environment, apparently. Here is where ROOMSTACK comes in.

Introducing Roomstack

Roomstack is a student marketplace that revolutionizes room and roommates searching by connecting students(who are either listers or renters) through filtering and preferential algorithms. It is targeted toward a young demographic who either needs a room or a roommate to share with while in college/university. Users on ROOMSTACK also known as ROOMSTACKers apply for verification after background checks while they can also add preference and interest which help with finding an ideal room or roommate.

Tech Stack

Features

  • Setting a profile

    For roommate searching, filtering and matching to be made possible; parameters are needed. Hence the need for users to set up profiles and submit relevant piece of information which is being powered by django-forms. Roomstack basically have two account/profile roles, either own a profile as a renter(looking to rent a full space/share with a room owner) or Lister(listing a room space to let /share). Below is a typical object notation of a Roomstack user.
TTP 200 OK
Allow: GET, POST, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

[
    {
        "id": 1,
        "email": "imowasinuola@gmail.com",
        "first_name": "mowa",
        "last_name": "mowa",
        "avatar": "https://us-southeast-1.linodeobjects.com/roomstack/users/girlimage.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=D95AN0GRHUONF7KYKIL2%2F20220628%2Fus-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20220628T005939Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=85735919da975c47c8fc1e1e4bdd84a85be9b7a7183f6bcabe5a85bc43b756a8",
        "date_joined": "2022-06-14T10:50:07.471247Z",
        "is_active": true,
        "is_staff": true,
        "email_verified": true,
        "action": "Own a room/Need a roommate",
        "sex": "Female",
        "pref_room_gender": "1",
        "pets_allowed": "Pets are not allowed",
        "smoking_allowed": "Not allowed",
        "pref_age_range": "null",
        "pref_religion": "I am ok with any",
        "room_clean": "null",
        "room_noise": "frequent quiet time",
        "out_of_towners": "null",
        "family_visits": null,
        "course_of_interest": "Computer Science",
        "bio": "A regular djangonaut, Hashnode blogger and  Linode lover ",
        "phone_no": "08123456789",
        "school": "Adekunle Ajasin University",
    }
]
  • Listing a room

    To every action, there is equal and opposite reaction; for every renter, there is a lister. Every room on the webapp is either listed by someone who wants to share a room or totally give it out for rent. listing a room involves specifying some preferences and parameters.
  • Searching for a room/roommate

    Roomstack features a well structured filtering system through the search bar/filtering options on the homepage, room page and roommates page. The room filter allow users to browse through rooms based on different options like school, room type, rent range, amenities, et cetera. search.PNG Finding an ideal roommate is made possible by providing matches and results from filtering options that includes if smoking and pet is allowed, age range, religion, interest, course of study, et cetera.

search2.PNG

At the time of writing this article, the database(PostgeSQL) is being populated with a few number of profiles and rooms.

Role of Linode

Static files are among the most important part of this webapp. However, Django itself should not serve static files( CSS, Javascript, images, videos..) but rather should reference these files from a production-efficient static file server. Linode provides a service that makes it very easy to serve static files. One cool thing about Linode Object Storage is its S3 compatibility, so the guides for setting up Django with S3 works pretty well.

/settings.py

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'

LINODE_BUCKET=os.environ.get('LINODE_BUCKET')
LINODE_BUCKET_REGION=os.environ.get('LINODE_BUCKET_REGION')
LINODE_BUCKET_ACCESS_KEY=os.environ.get('LINODE_BUCKET_ACCESS_KEY') 
LINODE_BUCKET_SECRET_KEY=os.environ.get('LINODE_BUCKET_SECRET_KEY') 


AWS_S3_ENDPOINT_URL=f'https://{LINODE_BUCKET_REGION}.linodeobjects.com'
AWS_ACCESS_KEY_ID=LINODE_BUCKET_ACCESS_KEY
AWS_SECRET_ACCESS_KEY=LINODE_BUCKET_SECRET_KEY
AWS_S3_REGION_NAME=LINODE_BUCKET_REGION
AWS_S3_USE_SSL=True
AWS_STORAGE_BUCKET_NAME=LINODE_BUCKET

Above is the setting setup on how Object Storage on Linode is being used in this project having gone through the following:

  • Created an account on Linode.
  • Created a new bucket in Object Storage.
  • Created an Object Storage Access key.
  • Installed necessary requirements in the projects environment(django-storages, boto, boto3 and of course django itself).
(venv) $ pip install django django-storages boto boto3

Struggles

The main challenge I faced while building this webapp was getting the full list of preference and host of other things students look out for while getting a room or roommates to share with. Most of this preference differ with individuals and are mostly relative, what user A consider really important while searching for a roommate might be less important to user B. To solve this problem, I decided to ask a group of potential users to take a quick survey and list out the things they always look out for while looking for a new room and also describe what an ideal roommate looks like to them.

Future Plans

I hope to put in more work and time, hopefully it becomes a fully functional startup helping students to get ideal roommates.

Noteworthy: Linode offers a free account setup which is available here

Finally , a big thank you to Hashnode and Linode for setting up this opportunity.