Twitter Notifications
Fullstack generalized notification system for communicating with users of Twitter's Ads Management tool.
Twitter Notifications
Fullstack generalized notification system for communicating with users of Twitter's Ads Management tool.
June - September 2017
X





About The Project:
Technology & Mediums:
Scala, JavaScript in the React Framework, HTML/CSS
During the summer of 2017 I was given the opportunity to do a three month internship at Twitter's San Francisco campus.
I was on the audiences team within the greater ads revenue team. My project was to do a fullstack implementation of a notfication that would be displayed on the webpage where advertisers manage their advertising campaigns on Twitter. Though the notification system was generalized so that others could easily reuse it, the specific notification I was creating was meant to motivate users to try a new tool that had recently been added to Twitter's advertising campaign system. The notification showed insights about audiences a user had been interested in the past or a generic message. Because the notification showed information from a database maintained by another team, I ended up having to collaberate with multiple teams to complete the project.
During this project I learned a variety of new skills. On a practical level I gained a lot of experience with Scala, a functional programming language much of Twitter uses, and JavaScript, neither of which I had used before. However, the most valuable thing I learned over the course of my internship was how to be an effective programmer at a large company. Working on an open ended project when your code impacts other people's code is quite different from working on a Computer Science project for a class or doing a project on your own. The practices I learned around communication, understanding how to work with other's code, and ensuring my code is useful to others are invaluable
Technology & Mediums:
June - September 2017
PROCESS:

Initial Concept
The initial idea I was presented with was to create a notification system to entice advertisers into trying a tool called Audience Explorer. During my first week a designer also mocked up some notification concepts

CRAWL, WALK, RUN PLANNING
To clarify my plan, my mentor at Twitter helped me create a design doc and break up the project using a method called "Crawl, Walk, Run," where the crawl stage represented the bare minimum I wanted to complete and run represented my stretch goal.
The crawl stage was to create a basic notification that linked the user to Audience Explorer. The walk stage was to migrate my notification into a generalized notification service and add personalized information to the notification. The run stage was to add more ways of sending notifications, like email, and make it easier to show the notification in other places.


CREATING A BASIC BACKEND
Above is a page called Ads Manager. To create the backend I figured how notifications worked in Ads Manager to begin with and added my desired functionality. Ads Manager turned out to only be able to show simple text notifications so I ended up creating a new class of notifications so most decisions about my notifications appearance would be made in one centralized place in the backend.


FRONTEND & JAVASCRIPT WOES
Once I could send a notification with correct information to the front end, I worked on making the notification look the way I wanted it to. I hadn't done much frontend work before, and had never worked in JavaScript so this was actually one of the more challenging parts of the project for me. I used a React element called "Upsell" created by Twitter's user interface team, but as it was a brand new element I ended up having to alter it a lot to make it look right (to the left is my first attempt at making the notification appear).


GETTING BLOCKED & UNBLOCKED
At this point I had completed the first stage of the project and was ready for push it to production, but my code kept failing to merge at the last minute. It turned out that I was using a React element that hadn't yet been added to the production version of Twitter's website and wouldn't be added for a couple of weeks.
To ensure my work wouldn't fall behind others' commits, I instead pushed a turned off version of my notification with the offending React element removed. I continued working on my project and once Twitter was updated I was able to alter a few lines of code and turn on my notification.

MIGRATING BACKEND & GENERALIZING
So my notifications wouldn't be limited to the webpage I made the basic version of my notification in, I migrated the backend of the notification to a separate notification service. Initially I was going to create the service from scratch, but I ended up finding a half finished notification service that another team was working on in Twitter's shared code base. This notification service had been set up to periodically push notifications, but the part that was meant to handle web notifications had never been completed. I chose to build off of it and add functionality so the webpage I was working in could check if there was a notification to show every time the page reloaded.



PERSONALIZING NOTIFICATIONS & COLLABORATING
In order to show information in the notification that would be more relevant to the user I personalized the notifications by using another intern's project. One of the teams I was working with had an intern who was working on generating things relevant to certain groups on Twitter like commonly used hashtags or commonly engaged with handles. I made my notifications access the database she was working on so the notifications would show information specific to a user's followers.
At the time, a new Game of Thrones season was airing so I ended up having to randomize which of the top ten results were shown because only things about Game of Thrones would be shown otherwise.

ADDING EMAIL NOTIFICATIONS
As a final step I began experimenting with creating email notifications. I didn't have time to get a design for the email so this part was never completed, but I was able to add basic email capabilities to the backend of my project.







