Giter Club home page Giter Club logo

brawn-api-code-test's Introduction

Workout Progress API Endpoint

Overview

Users would like to be able to track their workout progress over time. We need to create a new API endpoint to enable our mobile app to consume the data and show a graph. The endpoint should return volume (reps * weight) per workout session. The data should be restricted to the authenticated user. It should be ordered by the latest workout session first. The data should be paginated for performance reasons.

Data Structure

  • workout_sessions: Contains high-level data about workout sessions, such as when it occurred and which user it belongs to.
  • sets: Contains set-level data, including the number of reps, lift ID, weight, and workout session ID.
  • lifts: Contains data about the lifts performed.

Filtering Parameters

  • lift: Filter by the lift performed.
  • reps: Filter by the number of reps.
  • dates: Filter by date range.

Note: Future parameters may be added.

Pagination

  • Results are paginated, showing 15 entries per page.
  • Entries are ordered by the latest first.

Additional Data

The paginated response should include the volume by workout session. Additionally, the following stats are also required.

  • Max volume (reps x weight) for a single session across all time.
  • Max weight lifted across all time.

Data Calculation

  • Volume (weight x reps) is calculated per workout session.

Error Handling

  • Utilizes Laravel's error handling for graceful error messages.
  • Authentication issues are handled by the Laravel framework.

Parameter Validation

  • Validate incoming parameters to ensure they meet the expected criteria.

Feel free to explore the code for a better understanding of the data structure.

Brief

Create the required endpoint and classes to create a solution to the problem listed above. Please take a fork of this repo and submit a pull request with your solution. Please include a brief explanation of your solution and any assumptions you made in your pull request.

This task should take no longer than 2 hours. If there is anything you run out of time to complete please list on the PR what you would have done if you had more time.

If you have any questions, or anything is unclear please reach out for additional support.

brawn-api-code-test's People

Contributors

sinclairt avatar

Watchers

 avatar

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.