Skip to content

Instantly share code, notes, and snippets.

@gabrielloye
Last active July 27, 2020 16:11
Show Gist options
  • Save gabrielloye/673b96895e447dbcc23cdcc2700a9c56 to your computer and use it in GitHub Desktop.
Save gabrielloye/673b96895e447dbcc23cdcc2700a9c56 to your computer and use it in GitHub Desktop.

Encouraging meaningful social interactions through smart group-matching

Get it on Google Play

---

Section Description
Introduction Motivation, Tech stack
User Stories User stories, Use case
Components and Features Overview of the general App components and features
Setting Up Quick introduction to setting up the development environments
Testing Overview of setting up tests and test coverage
Future Plans Our next steps
Software Engineering Principles How certain considerations and principles were followed during our development
Appendix Links to the full User guide and Technical documentation guide

Introduction

Proposed Level of Achievement

Artemis

Motivation

In university, one of the many goals of students besides academic pursuits is meeting new people and making friends. In fact, there are many events in NUS that allow you to do so; You can try out new sports/clubs/activities. However, it is no surprise that there are people who attend such events with their existing friends. This makes the process of meeting new people difficult when existing social groups have already formed. You’re not sure who’s like you, just wanting to make new friends or who’s there to enjoy the time with their friend. So why isn’t there something that would allow you to connect with others similar to you, especially someone that wants to attend the same event you do? In fact, some faculty club-hosted activities involve participation in groups as well. Yet, no platform exists to facilitate the process of grouping people up unless they have already signed up in groups. Instead of having people be awkwardly acquainted with their group members on the day of the event, there could be a platform to facilitate this.

Tech Stack

  • React-Native
  • Express + GraphQL
  • MongoDB
  • Docker
  • Flask
  • Scikit-learn

DevOps

  • AWS EC2 (Node + Python backend)
  • Expo (Frontend)

User Stories

User

  1. As a student looking to explore university life, I want to be able to meet new people while I do so that enjoy the same activities as me.
  2. As a student looking to network with others, I want to be able to meet others similar to me in that regard.
  3. As a student wanting to make new friends, I want an activity or setting where I can do so with other people
  4. As a student looking for interesting events, I want to be able to browse them at my leisure.
  5. As a student looking for a particular event, I want to be able to filter events to look for something I want

Event Organiser

  1. As an event organiser that wants to encourage participation in my social event, I want a platform that I can utilise to incentivise people who may not be willing to go alone.
  2. As an event organiser that wants to promote my social event, I want to be able to create my events up for viewing.
  3. As an event organiser with an event that requires participation in groups, I want a platform that can help facilitate my groupings

Use Cases:

User wants to meet new people

  • User registers on our app and is authenticated.
  • User browses through events on our swiping page OR searches for a specific event
  • User registers for event and is matched up with others who similarly want to attend the event
  • User is grouped with other people and bond together over an activity

Event Organiser wants to promote a social/group event

  • Event Organiser registers on our app and is authenticated
  • Event Organiser provides details of his event on our application
  • Event Organiser receives a unique event code for his event
  • Event Organiser can publicise that event code for users to register with our platform
  • Event is publicly available on our application as well for users who are browsing

Components and Features

Main Components

  • Frontend
  • Node/Graphql Backend (Main API)
  • Python Backend (ML Engine)
  • Database

Features

Mobile Application

  • A fun swiping interface similar to that of Tinder for personalised events to the user
  • A search page where users can filter upcoming events based on its type to look for something that piques their interest
  • A create event page where users and potential event organisers can use to create their own events to utilise our matching algorithm
  • Allows users to create a profile that facilitates the matching process
    • Personality based questions
    • Gauge areas of interest of the user
  • A chat interface that allows grouped members to chat with each other before meeting up

Mechanism for grouping users

  • Initial grouping will be based on availability and basic greedy algorithms based on user profiles
  • Feedback and data will be gathered from users regarding their experience in the groups for us to personalize our matching and recommendation engine
  • Based on profiles of users, user embeddings will be generated to group users together using a statistics/machine learning-based model
  • From these user embeddings, we’ll match users based on their cosine similarity score and recommend events to them based on this metric as well
  • Improving upon the previous method to incorporate recommender systems based on feedback from previous grouping.

Recommendation engine for events for users

  • Based on user data collected through the initial sign up and their application interaction (including their event sign-ups/expressed interest) a recommendation system feature can be included to suggest events for users
  • Personalization of event suggestions to users

Setting Up

Frontend

Built with:

  • Expo for React Native
  • Typescript
  • Apollo-Client for GraphQL

Setting up the development enviroment

  1. Git Clone the repository
  2. do a yarn install within the directory.

Running the app for development

Once you are ready to run the app, follow the following steps:

  1. Run yarn start

Connecting the app to Docker backend on Windows

  1. Ensure that port forwarding is enabled so that you can access the backend server on localhost (Only for Docker Toolbox)
  2. Set up IP forwarding by going to regedit -> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters and setting value of IPEnableRouter to 1. Restart computer after this step.
  3. Open up command prompt with admin permissions
  4. Run netsh advfirewall firewall add rule name="TCP Port 3002" dir=in localport=3002 protocol=TCP action=allow
  5. Run netsh interface portproxy add v4tov4 listenport=3002 connectaddress=127.0.0.1 connectport=3002

Set up Port Forwarding for Docker Toolbox

  1. Open VirtualBox Manager for Windows
  2. On the default machine, open Settings -> Network -> Adapter 1 -> Advanced -> Port Forwarding
  3. Add a new rule with the following configuration. Protocol=TCP, Host IP=127.0.0.1, Host Port=3002, Guest IP=192.168.99.100, Guest Port=3002
  4. Click OK

Backend

Built with:

  • Express.js
  • Typescript
  • Apollo-Server for GraphQL
  • Mongoose for MongoDB
  • Nodemon

Setting up the development enviroment with Docker

  1. Git Clone the repository
  2. Ensure that Docker is installed on your computer

Running the backend for development

Once you are ready to run the backend, follow the following steps:

  1. Run docker-compose up --build
  2. View the graphql playground at your Docker host (192.168.99.100 for Toolbox users)
  3. Press CTRL + C to stop Docker
  4. Clean up with docker-compose down -v and docker volume prune

Setting up the development enviroment without Docker

  1. Git Clone the repository
  2. do a npm install within the directory.

Running the backend for development

Once you are ready to run the backend, follow the following steps:

  1. Run npm run dev
  2. View the graphql playground at http://localhost:3002/graphql

Deploying the backend.

Once you are ready to build a backend build follow the following steps:

  1. Run npm run build
  2. Run npm run start
  3. View the backend at http://localhost:3002/graphql

Testing

Frontend

Running tests

  1. To run tests, use the command yarn test

Backend

Running tests

We use integrated test with a MongoDB container.

  1. Make sure that images are built with docker-compose -f docker-compose-test.yml build
  2. To run a one-time test, docker-compose -f docker-compose-test.yml run --rm test npm run test
  3. To run tests in watch mode, docker-compose -f docker-compose-test.yml run --rm test npm run test:dev
  4. As always, remember to clean up existing containers with docker-compose -f docker-compose-test.yml down

Future Plans

Our next steps to improving the product will include:

  1. Further user testing with user validation and feedback loops
  2. Improved user experience based on user testing/feedback
  3. Deployment on Apple App store
  • Applying for a grant to attain funds to cover the costs
  • Excess money on grant could be used to hire freelance designers to improve our application user interface or for publicity and marketing
  1. Marketing efforts
  • Partnering with events within NUS/outside of NUS to host them on our platform.
  • Publicising our app and getting regular and active users onto our application

Software Engineering Principles

Single-responsibility principle

The libraries we used aided us in encapsulating responsibility to a certain class. MongoDB is very lenient where there is no predefined schema but using an object data modelling library like Mongoose helped us to clearly define our different classes of data and control their interactions with other classes. GraphQL’s schema similarly helped where we used the layer of abstraction provided by Mongoose to control the interactions between different object models.

Test Driven Development (TDD)

In certain key features of our application, we utilised TDD to ensure that we keep to the gist of what the feature is supposed to provide without premature over-engineering. We would specify tests to be done and refactor to make the test pass. Over time, we would add new requirements and refactor in turn.

Don’t Repeat Yourself

In our drafts, we make notes on possible shared components between different screens and layouts. In implementing these components, we attempt to make them as reusable as possible with only simple props being passed in to change the usage of the component. This allows us to reuse components across our application and reduces the repeated code. On the backend side, we also followed standard design principles found online to reduce code duplication. For example, we have a base resolver in GraphQL that checks if a user is authenticated and this can be easily combined with another resolver to only allow access to the second resolver if the user is authenticated.

Strongly Typed Language

We decided to go with Typescript in our project due to its typed nature. This helped us to reduce running into errors and going through the whole debugging process when the compiler (or transpiler) notifies any errors with our code. The use of typescript and typing our components / functions helps us to work together as the requirement parameters are made known to us by the compiler.

Appendix

Further technical details including a detailed developer's guide and user guide can be found in the below links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment