API Reference OpenPace v0.0.1

modules

Modules

The Accounts context which is responsible for users, preferences, and credentials.

The Activities context.

TrackpointSection is a schema that represents a segment between two trackpoints. This is useful for calculating time or distance in pace zones.

This module matches new activities to existing activities.

This module defines the pipeline for auth allowing a shared error handler across all plugs.

Calendar module to help with visible_dates of calendar and other helper functions.

The Challenges context which is responsible for handling challenges and scores.

Color codes for different activities and gradients.

Module to handle company name and other similar strings.

This module defines the distances used in forms.

This duration module parses and formats strings for a time duration in hours, minutes, and seconds.

Provides a basic HTTP interface to allow easy communication with the Exponent Push Notification API, by wrapping Tesla.

Finds the fastest split in an trackpoints for a given distance.

Parses FIT files and returns metadata like distance, duration, trackpoints, and laps.

Parses TCX files and returns metadata like distance, duration, trackpoints, and laps.

A record representing an individual record in a FIT file.

Handles OAuth2 authentication flow for Fitbit integration. Implements the Squeeze.Fitbit.AuthBehaviour for standardized authentication methods.

Behaviour module defining callbacks for Fitbit OAuth authentication.

Tesla-based HTTP client for interacting with the Fitbit API.

Behaviour module defining callbacks for Fitbit API client operations.

Tesla middleware that handles OAuth2 token refresh for Fitbit API requests.

Garmin authentication integration.

Behaviour specification for Garmin authentication operations.

This module defines the pipeline for live view auth allowing a shared error handler across all plugs.

The Logger context.

This module contains the schema for logging webhook events.

This module renames activities

This module returns a string for an activity type

This module converts an activity into Morning, Afternoon, Evening, and Night

This module formats the distance

This module formats the duration

This module returns an emoji for an activity type

This module creates names for a user and activity.

This module converts an activity into Morning, Afternoon, Evening, and Night

Basic job to retry naming 3 times.

The Notifications context.

Module for OAuth 1.0 Expanded from oauther: https://github.com/lexmag/oauther

Credentials for OAuth 1.0

An OAuth2 strategy for Google.

Signs and verifies text

This module uses vo2max from Daniel's Running Formula to predict other races. With help from this article: http://www.simpsonassociatesinc.com/runningmath9.htm

The Races context.

This module defines the training paces. Currently this model is embedded.

Used for executing DB release tasks when run in production without Mix installed.

This module reports information to slack

Parses FIT files and returns metadata like distance, duration, trackpoints, and laps.

Creates the required stripe billing setup.

Generates unique slugs for object urls

The Social context.

This module is a schema for follows

The Stats context.

Wrapper around Strava.Activities

Translates a strava activity into an openpace activity

Loads data from strava and updates the activity

Squeeze.Strava.BulkImport.import_from_file(user, "export_1234.zip")

Loads data from strava and updates the activity

Loads data from strava and updates the activity

Convert strava stream sets into trackpoints

This ecto type allows for both integers and strings. This is used when we want to store segment_id (an external identifier) as a string and not an integer.

A task to create race goals from existing activities marked as races.

Task module for batch processing TrackpointSets to create trackpoint sections. This module is designed to process existing TrackpointSets and generate corresponding trackpoint sections in batches.

Create default training paces for all existing race goals. Putting this in a task without mix as it is not available on production.

A task to resync all strava activities for all users.

Module to handle time for a user based on their timezone preference.

Utility functions

This module defines the distances used in forms.

The entrypoint for defining your web interface, such as controllers, views, channels and so on.

Translates controller action results into valid Plug.Conn responses.

This is the module for the calendar live view

A component to generate Cloudflare image tags with the given image_id and options.

Provides core UI components.

Conveniences for translating and building error messages.

Controller for Fitbit authentication integration.

This module contains different helper functions for the different data types used in the app.

@moduledoc false This module defines helpers common running related formatting like pace, distance, duration.

Controller for Garmin authentication integration.

A module providing Internationalization with a gettext-based API.

Assign current_user from the session token.

Utility library to create a map url for mapbox which has a gradient line.

This module defines the auth plug pulls the user from the current session.

This plug sets the locale for Gettext using

This modules requires either

Use this plug to load a remember me cookie and convert it into an access token

This is the module for the settings live view

SVG Polyline component. Builds an svg path on the server based on a polyline.

Activities behavior to allow us to use mocks for Strava.Activities

Auth behavior to allow us to use mocks for Strava.Auth

Client behavior to allow us to use mocks for Strava.Client

Streams behavior to allow us to use mocks for Strava.Streams

Behavior to allow us to use mocks for Stripe.Card

mix-tasks

Mix Tasks

Creates the required stripe billing setup. This task must be run for both test and live stripe environment keys.

Creates the required subscriptions (webhooks) for different services to push activities and status to squeeze.