We have sets of records representing football players' rushing statistics. All records have the following attributes:
Player(Player's name)Team(Player's team abbreviation)Pos(Player's postion)Att/G(Rushing Attempts Per Game Average)Att(Rushing Attempts)Yds(Total Rushing Yards)Avg(Rushing Average Yards Per Attempt)Yds/G(Rushing Yards Per Game)TD(Total Rushing Touchdowns)Lng(Longest Rush -- aTrepresents a touchdown occurred)1st(Rushing First Downs)1st%(Rushing First Down Percentage)20+(Rushing 20+ Yards Each)40+(Rushing 40+ Yards Each)FUM(Rushing Fumbles)
In this repo is a sample data file rushing.json.
-
Create a web app. This must be able to do the following steps
- Create a webpage which displays a table with the contents of
rushing.json - The user should be able to sort the players by Total Rushing Yards, Longest Rush and Total Rushing Touchdowns
- The user should be able to filter by the player's name
- The user should be able to download the sorted data as a CSV, as well as a filtered subset
- Create a webpage which displays a table with the contents of
-
The system should be able to potentially support larger sets of data on the order of 10k records.
-
Update the section
Installation and running this solutionin the README file explaining how to run your code
To start the project is necessary to have make available and docker-compose, this way the project can be executed with make run, else docker-compose up can do the trick.
- Open your browser at
http://localhost:5001. - First screen allows you to select
perPageandpagerequired attributes, as well as optionalnameto search. - Second screen allows you to select all fields you wish to see in the report.
- Third screen, if
namewas not inserted, will allow you to select a sorting method. - Forth screen is the Table report.
- To download CSV you should click in the blue button at the bottom right.
- For sorting
Longest Rush, I considered a touchdown a bonus of 100 points. - Did not use flutter graphql client due to configuration time. Same for flutter web specific tests.
- I did not focus on pretty frontends, just functionality.
- Backed was developed in Rust with Actix for web server and Juniper for GraphQL support. The project is divided in
main, where the server is started and files loaded,readerIO related module,modelis the module responsible forPlayerandErrors, andwebis the module containing GraphQL queries and routes configuration. - Frontend is a little more complex. It starts with
mainthat runs theApp, that it callScreenswhere all screens are located,Viewsis where sharedScreenparts, like scaffold, are located, common components are stored incomponents,blocis a where the app data is being stored, andrepositoryis wherehttpandcsvfunctions are stored. - Due to disponibility reasons, query
sortByNamedoesn't have its own frontend.
To run tests just execute cargo test.
Benchmarks are done via criterion = "0.3" and can be obtained by cargo bench.
read_json microbenchmark:
rushing.json time: [2.2553 ms 2.2586 ms 2.2622 ms]