Day-72 Working on TradeByte referral system using cookies. ||#100DaysOfCode
August 25, 2020
Hey Fam, I hope y’all are doing good. If you want to connect with me then search for the username @fabcodingzest on any platform like Twitter, GitHub and you’ll find me.
So I was assigned to implement a referral system in the app where when the user can share a referral link for the app, if someone signs up using that link he gets 50$ and the one who shared the link will get 100$ added in his account balance. It wasn’t a hard task but I was confused at starting as how to do it, when I broke down the task it became easier to implement. Some work for link generation was done by a team member but they couldn’t complete it so I modified it and customized the sharing link so that the current user id who is sharing the link will get passed in the link. When a user uses that link, it will create a cookie containing the user id that was passed which will expire in 60 minutes of creation, we will check for the cookie at the dashboard and if it exists and isn’t empty then we update the Database for the user who signed up and the user who shared the link earlier.
It was a fun task to do and I figured it out by evening but couldn’t polish it until the night after majlis, some things were missing but I managed to fix all the bugs and made it work. Yes, I was working till very late and made a PR near 2 something a.m. and kept making some improvements further.
The day was good, I completed my week 4 task in a day itself and that is a big deal even if I think the task wasn’t that hard but I had to research a lot as I never used cookies till now, they are cool. This project was a challenge and I actually managed to build stuff and implement what I learned which I wouldn’t have done this earlier if it wasn’t for this project.
Challenges are scary but life is too short to worry about what-ifs, do whatever challenges you! You’ll be surprised how good you actually are. ~Fab
If you are reading my stupid blogs then just know, I appreciate you a lot💙.