@dgpholdings/greatoak-shared
v2.0.0
Published
Shared TypeScript types and a few helpers for @dgpholdings projects
Readme
@dgpholdings/greatoak-shared
Types, constants and a few small helpers shared by the Fitfrix mobile app and the admin panel. It contains no algorithms: scoring, calories, records, recovery, the constellation and goal recommendations are computed by the Python backend (fitfrix-be-py), and the app reads their results through the API.
Anything the backend and a client both describe belongs to the API contract (the backend's OpenAPI schema, from which the app generates its request and response types), not to this package. What is left here is what the API does not describe.
What is inside
| Location | Contents |
| ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| src/types/commonTypes.ts | TRecord (the five set types), TExerciseConfig, TTemplateExercise, TDayKey |
| src/types/TApiExercise.ts | TExercise, TBodyPart, TBodyPartKeys, TTrainingType, TTimingGuardrails |
| src/types/TApiUser.ts, TUserPreferences.ts | TUserMetric and its preference types |
| src/types/TApiTemplateData.ts | TTemplate, TTemplateData, TExerciseLatestRecord, TAiPlanContext |
| src/types/TApiGoalContextRes.ts | Goal profile, context and recommendation types |
| src/types/TConstellation.ts | The constellation as the app receives it |
| src/types/TApiAdminAiHelp.ts, TApiAiExerciseAnalysis.ts, adminApi/ | Types used by the admin panel |
| src/constants/ | Body categories and names, AI vocabulary (equipment, body areas, injuries, intents), goal and phase display data |
| src/utils/ | isDefined, toError, isAnonymousEmail, getDaysAndHoursDifference, weight and height formatting and age (metricConversions) |
Rules
- No framework code: nothing from React or React Native.
- Strict types: no
any. - Do not add algorithms here. A rule about workouts belongs in the backend.
Renewing token
- Login using the token (recommended way)
In your Git Bash, run:
npm login
It will prompt:
Username: Password: Email:
Use this:
Username → your npm username
Password → paste the granular token (NOT your npm password)
Email → your npm email
After that, npm stores the token in:
shared\.npmrc
Then publishing works normally:
npm publish
