Giter Club home page Giter Club logo

serpentary2018's Introduction

serpentary 2018

This is the 2018 version of the serpentary football pool software.

I'm basically writing a new one every year to try out new technologies.

This year it uses AWS Lambdas written in Go as its backend, Protocol Buffers as the data exchange format, and a React/Redux app written in TypeScript as a user interface.

It also makes use of several other AWS services. The base project was created using AWS CodeStar, the file layout is loosely based on the Go web application template, but with many changes and additions. The app uses Cognito for user management, API Gateway for routing requests to the backend Lambdas, S3 to host the web app and CloudFront to distribute it, and CodePipeline, CodeBuild and CloudFormation to build and deploy it. The web app is compiled and packaged using webpack.

serpentary2018's People

Stargazers

Richard Burke avatar

Watchers

James Cloos avatar

serpentary2018's Issues

Allow fine-grained updates of state objects

(Or explore whether this is actually useful somewhere.)

There might be cases where we should not only compare timestamps on the new and existing records. For example, whenever a field is set on the record received from the API that is not yet known in the local state, there's no harm in putting that data there. However, whether there's actually situations where this is worth the effort is a different question.

Improve lazy loading components

In addition to what they currently do ( #11 ), it would be cool to

  • when data is available, check whether it hasn't been updated in a while and auto-refresh on mount if it is too old
  • make a more specific distinction between loading states, for example to differentiate between "error occurred while loading data" and "request was successful, but the required data was not available"
  • allow custom checks on the data, not just "these props must not be null" but maybe also "this prop must be a non-empty array" or "this field on this prop must be set"

Add data for special bets to models

The pool record needs to be extended by a set of special bet definitions, and we need a new sort of bet bucket that stores a pool's participants' bets for these.

Create basic views for match day pages

Need one "public" page for a match day which shows the matches it contains, and two for a given match day and squad, one with the matrix of bets and one with the match day ranking.

Make a logo

It shouldn't have the SCMPS logo forever.

Add input forms for extra questions

Users need to be able to submit their bets for the extra questions and edit their bets later on, as long as the deadline has not yet passed.

Load bets from database

No handlers for that yet, all from the sample state so far. That needs to change obviously.

Create form to enter and edit bets

On the match day bets page, when a user clicks on one of their own cells, a form should open that allows them to enter a new bet or edit the existing one.

Connect database

The Lambdas should obviously retrieve their data from a database rather than from hard-coded sample values.

Find another cheapskate solution for the initial load of a non-root page

With React Router in place, the URLs of all the sub-pages are generated dynamically. When you copy a URL and want to go back to it later, it normally won't find it because no such files exist in the hierarchy. We need to map all requests to index.html. S3 allows one index page and one error page for the Public Website Hosting mode, so setting index.html for both will make it always show up. However, even though users may not see it if they just type in the URL or click the bookmark, the browser will still receive a 404 response for all sub-pages. Ideally this should not happen, but ideally that better alternative shouldn't cost money either.

Add models for squads and bets

Need a way to represent squads, membership of users in squads, and the bets of users in a squad for a given match day.

Add API routes for extra questions

The API must allow to query extra questions for a pool and submit bets. It also needs to deliver team data which is required for these.

Load data on navigating to a page

When the user navigates to a valid URL, but the data that is to be expected there is not in the state or hasn't been updated in a long time, query the server and show some kind of activity indicator in the mean time.

Enable caching of state

For large parts of the data, it should be safe to cache them in the page's local storage to reduce API load. And from some hints on the Redux documentation, it sounded like it was easy to set up as well.

Update timestamp on write in database

To make the update mechanism work, we need to make sure the timestamp is actually increased when something is written to an object in the database.

Add information to models that is useful for determining the need to refresh

When data is cached locally, it may be more or less reasonable to ask the API for a refresh. For example, if a tournament has already begun, it is quite unlikely that the basic data on the Tournament instance itself is going to change. And even more so when it is over. When all matches of a match day are over (or at least the last ones have already begun) it is unlikely that the bets are going to change. An additional "last refresh" field (that is only used on the client side) might be very useful for that too.

Send protobuf-serialised data base64-encoded

Sending binary data through API Gateway seems to be not very well supported, and setting the option doesn't change anything really. So for now, use base64 encoding on the data that is sent.

Optimise DynamoDB structure, de-normalise some information

Given that this application should ideally run with AWS's Free Tier, it does not make sense to store all data in DynamoDB in a normalised kind of way. For example, for most use cases the only information that needs to be retrieved from the users table is the preferred username, but it will require a batch read operation that will consume lots of read capacity each time. These preferred usernames might be stored with the pool and squads records, for example.

Build pool details page

This page should contain a link to the squad, the list of squad members that have signed up for this particular pool, and links to the bets pages by match day. Later maybe include a current ranking.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.