Giter VIP home page Giter VIP logo

gym-workload-api's Introduction

Fitness Studio Workload API

This Node.js Express application is designed to fetch and aggregate workload information from multiple fitness studios based on their IDs. It dynamically queries specific endpoints to retrieve current workload data, including terms and percentages of occupancy, and compiles them into a unified response format. This application is currently configured and optimized specifically for retrieving workload data from a single fitness studio chain, and may require adjustments to work with other organizations or data formats.

Features

  • Fetch workload data from multiple studios simultaneously using their unique IDs.
  • Aggregate and return a simplified JSON object containing the name, term, and percentage of workload for each queried studio.
  • Support for query parameters to dynamically select studios for workload data retrieval.

Getting Started

Prerequisites

Ensure you have Node.js and npm (Node Package Manager) installed on your system. You can download and install them from Node.js official website.

Installation

  1. Clone the repository to your local machine:
git clone https://github.com/t8p/gym-workload-api.git
  1. Navigate into the project directory:
cd gym-workload-api
  1. Install the required dependencies:
npm install
  1. Start the application:
npm start

The server will start running on http://localhost:3000.

Usage

To fetch workload information from studios, use the following endpoint structure:

GET /api/workload?studios=ID1,ID2,ID3

Replace ID1,ID2,ID3 with the actual IDs of the studios you want to query. The response will be a JSON object containing the aggregated workload data for each studio.

Example Request

curl http://localhost:3000/api/workload?studios=12,14,16

Response Structure

The response will be a JSON array where each object represents a studio's workload data:

[
  {
    "studioId": "12",
    "name": "Studio Name 1",
    "term": "low",
    "percentage": 24
  },
  {
    "studioId": "14",
    "name": "Studio Name 2",
    "term": "medium",
    "percentage": 50
  }
]

Contributing

Feel free to fork the repository and submit pull requests with improvements or new features.

License

This project is open-sourced under the MIT License. See the LICENSE file for more details.

gym-workload-api's People

Contributors

t8p 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.