100DaysOfCloud / 100DaysOfCloudBackendLegacy

MIT License
16 stars 5 forks source link

Tracking Progress from Cloud Journey Template and Displaying it on our app. #12

Open omenking opened 4 years ago

omenking commented 4 years ago

This is our Cloud Journey Template. It needs to be forked by each participant. https://github.com/100DaysOfCloud/100DaysOfCloud

We need a way to programmatically track people's progress when they update their fork with progress.

We don't have to worry about displaying it in our app just storing in a DB that will be accessed by AWS Amplify

what-name commented 4 years ago

Fork repo or use template - I'm 100% on the fork side.

Keep track of activity

Backend database

Need to commit all this for now. Will add further info in a bit.

what-name commented 4 years ago

See GitHub Gist with related info here.

what-name commented 4 years ago

Okay, I've been fighting so much with understanding Amplify and I propose we go Serverless instead. To give a little context, I've put a lot of work into understanding Amplify. I can totally see it being a great tool if you know the small (and very unintuitive) quirks of it, but since nobody on our team is at that place (I honestly don't even want to be), it would add a lot of time and unnecessary headache IMO. Most of us are pretty familiar with serverless however, and since this is a Gatsby project, it works perfectly as well.

Architecture idea:

That's a bit of braindump for now, I'm going to start working on the Serverless app. In the meantime, I'd suggest checking out the following video: OAUTH and OIDC in plain english. - This will make you go from "what is happening" to OAUTH pro in an hour.

I didn't mention any of the frontend requirements to work with this solution but I could look into that as well. Technically it's only a couple; the input form (for now), the leaderboard window and the OAUTH authentication (which is cleared up by that video just above).

antoniolofiego commented 4 years ago

Let me go through all of these in order.

I would definitely need help with the frontend coding eventually just to speed up everything. I am starting to work on it right now again after a few days of MIA but more hands and brains can be helpful. Given that we are going fully serverless, can we have a chat on how to structure our endpoints and similar things? Also, were are we going to store things like avatars and articles?

what-name commented 4 years ago

Also, were are we going to store things like avatars and articles? As far as I know, articles on Gatsby should be easy to do from our end. When it comes to articles written by others, we could store it's title and necessary info in DynamoDB and store their thumbnails in S3. If we want to make them appear on our site insted of simply being redirected to their original location (which is not a good idea from an SEO standpoint), can store that in DynamoDB as well actually or store a markdown version of that in S3 and just pull it from there (weird I know lol) - but this is all for the future, just wanted to mention that it's feasable.

In terms of fast turnaround, Cognito is still a feasible option for the MVP. We can figure out OAuth at a later stage, but to get the product out of the door we can go with email/password combination That depends what we want to do first. If just a simple input form like @omenking suggested, no need for either at first. After seeing how that works and will be displayed, we can go for more authentication - in my opinion. I think a simple input form would be a great starting point. I can't really see the authentication part from a user perspective without knowing how the data generated by it will be used, but that's just me.

antoniolofiego commented 4 years ago
import datetime

class Score:
  def __init__(self):
    self.twitter = 0    # Current score accrued through Twitter
    self.github = 0    # Current score accrued through GitHub

    self.old_twitter = datetime.datetime(2020, 1, 1)    # Second to last Twitter activity
    self.new_twitter = datetime.datetime(2020, 1, 1)    # Last Twitter activity

    self.old_github = datetime.datetime(2020, 1, 1)     # Second to last GitHub activity
    self.new_github = datetime.datetime(2020, 1, 1)    # Last GitHub activity

    self.twitter_streak = 0
    self.github_streak = 0

  def github_activity(self):
    # Rotate activity dates
    self.old_github = self.new_github
    self.new_github = datetime.datetime.now()

   # If less than 3 days passed from the previous activity, add 1 to the streak, else reset the streak to 1
    if (self.new_github - self.old_github).days <= 3:
      self.github_streak += 1
    else:
      self.github_streak = 1

    # If this is the first activity of the day, add 2 points multiplied by the streak length  
    if (self.new_github - self.old_github).days != 0:
      self.github += 2 * self.github_streak

    print("GitHub points for today:", 2 * self.github_streak)
    print("Total GitHub points:", self.github)
    print("GitHub streak:", self.github_streak)

  def twitter_activity(self):
    # Rotate activity dates
    self.old_twitter = self.new_twitter
    self.new_twitter = datetime.datetime.now()

   # If less than 3 days passed from the previous activity, add 1 to the streak, else reset the streak to 1
    if (self.new_twitter - self.old_twitter).days <= 3:
      self.twitter_streak += 1
    else:
      self.twitter_streak = 1

    # If this is the first activity of the day, add 2 points multiplied by the streak length  
    if (self.new_twitter - self.old_twitter).days != 0:
      self.twitter += 1 * self.twitter_streak

    print("Twitter points for today:", 1 * self.twitter_streak)
    print("Total Twitter points:", self.twitter)
    print("Twitter streak:", self.twitter_streak)

  def get_score(self):
    # Get full score
    return self.twitter + self.github

Draft for the leaderboard logic.

what-name commented 4 years ago

Notes of the Zoom meeting on 23.07.2020

Current objectives mostly in order

  1. Recreate the current site with links, own articles.
  2. Log in with Cognito username/pass and get all info from participant (github, twitter, full name, linkedin, [email with consent box?]) Save this info in Cognito and in it's [own] DynamoDB database (for now seperated DB tables). This will allow us to have a list of participants and their social from the beginning.
  3. Input form for today's tweet/commit entry. This is given that we don't get to automatic collection first.
  4. Show Twitter feed for #100DaysOfCloud - should be easy enough as Twitter provides drop-ins AFAIK
  5. Leaderboard - total days OR calculated based on commits and tweets and streak

LEADERBOARD

TL;DR we need more diversity in knowledge, experience and ideas on what the leaderboard should be based on. @omenking @cmgorton @rishabkumar7 @madebygps

This feature is a bit down the road, but it needs to be somewhat planned for in advance. - For knowing the flow of the system and what to work on.

1:

2:

I'm personally recommending the first one, where only the total number of days are kept track of. My opinion is based on a case study from Jocko Willink's book Extreme Ownership, where a company was underperforming because their bonus system was too confusing. Employees didn't understand it, got totally random bonuses with each paycheck and therefore didn't perform well. After the company revised their bonus system to be dead-simple, they all took off because they understood the system behind it and they could work with that well.

Misc

what-name commented 4 years ago

Possible problems for the future with the leaderboard: