GreaseFit API

Backend API for the GreaseFit project.
More information: https://greasefit.com
Contact Info: [email protected]
Version: 1.0
All rights reserved
http://apache.org/licenses/LICENSE-2.0.html

Access

Methods

[ Jump to Models ]

Table of Contents

Foods

LogEntries

Login

MealEntries

Meals

Search

ShoppingList

ShoppingListItems

StepCount

Users

VerificationTokens

WeightEntries

Foods

Up
get /foods
(foodsGet)

Responses


Up
delete /foods/{id}
(foodsIdDelete)

Path parameters

id (required)
Path Parameter

Responses


Up
get /foods/{id}
(foodsIdGet)

Path parameters

id (required)
Path Parameter

Responses


Up
put /foods/{id}
(foodsIdPut)

Path parameters

id (required)
Path Parameter

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


Up
post /foods
(foodsPost)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


LogEntries

Up
get /log-entries
(logEntriesGet)

Example data

Content-Type: application/json
""

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The LogEntry index endpoint. Returns all Log Entries.

Up
delete /log-entries/{id}
(logEntriesIdDelete)

Path parameters

id (required)
Path Parameter

Responses


Up
get /log-entries/{id}
(logEntriesIdGet)

Path parameters

id (required)
Path Parameter

Responses


Up
put /log-entries/{id}
(logEntriesIdPut)

Path parameters

id (required)
Path Parameter

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


Up
post /log-entries
(logEntriesPost)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


Login

Up
post /login
Login (loginPost)

To log in to the API, the client must provide the user's email, password, and the client's public key. This request also serves as a key exchange step. After a successful login, the server responds with its own public key. All future requests from the client must be signed using their private key, and the server will verify them using the stored public key.

The algorithm used is Ed25519, as defined in RFC 8410. The public key must be encoded in X.509 format (SubjectPublicKeyInfo structure). Raw keys are not accepted.

The X.509 public key must be base64-encoded using a URL-safe variant (base64url) with padding characters (=) removed. This ensures compatibility with URL transmission and JWT formatting.

Google’s Tink cryptographic library can be used to generate Ed25519 key pairs. The public key can be exported in X.509 format using Tink's KeysetHandle and appropriate templates. Be sure to encode it correctly before sending.

This mechanism allows the server to authenticate and verify all future signed requests from the client in a stateless and secure way.

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Return type

com.greasefit.server.models.authMethod.AuthMethod

Example data

Content-Type: application/json
{
  "clientPublicKey" : "",
  "archivedAt" : {
    "epochSeconds" : "",
    "nanosecondsOfSecond" : ""
  },
  "createdBy" : "",
  "serverPublicKey" : ""
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Created authentication method com.greasefit.server.models.authMethod.AuthMethod

MealEntries

Up
get /meal-entries
(mealEntriesGet)

Example data

Content-Type: application/json
""

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The Meal index endpoint. Returns all meals.

Up
delete /meal-entries/{id}
(mealEntriesIdDelete)

Path parameters

id (required)
Path Parameter

Responses


Up
get /meal-entries/{id}
(mealEntriesIdGet)

Path parameters

id (required)
Path Parameter

Responses


Up
put /meal-entries/{id}
(mealEntriesIdPut)

Path parameters

id (required)
Path Parameter

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


Up
post /meal-entries
(mealEntriesPost)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


Meals

Up
get /meals
(mealsGet)

Example data

Content-Type: application/json
""

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The Meal index endpoint. Returns all meals.

Up
delete /meals/{id}
(mealsIdDelete)

Path parameters

id (required)
Path Parameter

Responses


Up
get /meals/{id}
(mealsIdGet)

Path parameters

id (required)
Path Parameter

Responses


Up
put /meals/{id}
(mealsIdPut)

Path parameters

id (required)
Path Parameter

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


Up
post /meals
(mealsPost)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


Search

Up
post /search
(searchPost)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


ShoppingList

Up
get /
(rootGet)

Responses


ShoppingListItems

Up
get /shopping-list
(shoppingListGet)

Example data

Content-Type: application/json
""

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The shopping list index endpoint. Returns all shopping list items.

Up
delete /shopping-list/{id}
(shoppingListIdDelete)

Path parameters

id (required)
Path Parameter

Responses


Up
post /shopping-list
(shoppingListPost)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


StepCount

Up
get /
(rootGet)

Responses


Users

Up
get /
(rootGet)

Responses


Up
get /users/current
(usersCurrentGet)

Responses


Up
put /users/current
(usersCurrentPut)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


VerificationTokens

Up
get /
(rootGet)

Responses


WeightEntries

Up
get /
(rootGet)

Responses


Up
get /weight-entries
(weightEntriesGet)

Example data

Content-Type: application/json
""

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The WeightEntry index endpoint. Returns all weightEntries.

Up
delete /weight-entries/{id}
(weightEntriesIdDelete)

Path parameters

id (required)
Path Parameter

Responses


Up
get /weight-entries/{id}
(weightEntriesIdGet)

Path parameters

id (required)
Path Parameter

Responses


Up
put /weight-entries/{id}
(weightEntriesIdPut)

Path parameters

id (required)
Path Parameter

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


Up
post /weight-entries
(weightEntriesPost)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

Body Parameter

Responses


Models

[ Jump to Methods ]

Table of Contents

  1. <error>
  2. com.greasefit.server.models.authMethod.AuthMethod
  3. com.greasefit.server.models.food.Food
  4. com.greasefit.server.models.logEntry.LogEntry
  5. com.greasefit.server.models.meal.Meal
  6. com.greasefit.server.models.mealEntry.MealEntry
  7. com.greasefit.server.models.shoppingList.ShoppingListItem
  8. com.greasefit.server.models.stepCount.StepCount
  9. com.greasefit.server.models.user.User
  10. com.greasefit.server.models.user.UserLogin
  11. com.greasefit.server.models.weightEntry.WeightEntry
  12. com.greasefit.shared.data.resources.searchResult.SearchRequest
  13. com.greasefit.shared.data.resources.stepCount.StepCountRequest
  14. java.time.Instant
  15. java.util.UUID
  16. kotlinx.datetime.Instant

<error> Up

com.greasefit.server.models.authMethod.AuthMethod Up

The AuthMethod class represents a method of authentication for a user. Without it, any request that requires authentication will fail.
archivedAt (optional)
clientPublicKey (optional)
createdAt (optional)
createdBy (optional)
id (optional)
serverPublicKey (optional)

com.greasefit.server.models.food.Food Up

amountInGrams (optional)
archivedAt (optional)
brand (optional)
caffeineInMilligrams (optional)
calciumInMilligrams (optional)
calories (optional)
carbohydratesPerGram (optional)
cholesterolPerMilligram (optional)
createdAt (optional)
createdBy (optional)
description (optional)
fatPerGram (optional)
fiberPerGram (optional)
folateB9InMicrograms (optional)
id (optional)
ironInMilligrams (optional)
magnesiumInMilligrams (optional)
monounsaturatedFatPerGram (optional)
name
niacinB3InMilligrams (optional)
phosphorusInMilligrams (optional)
polyunsaturatedFatPerGram (optional)
potassiumInMilligrams (optional)
proteinPerGram (optional)
riboflavinB2InMilligrams (optional)
saturatedFatPerGram (optional)
sodiumPerMilligram (optional)
sugarsPerGram (optional)
thiaminInMilligrams (optional)
transFatPerGram (optional)
vitaminAInMicrograms (optional)
vitaminB12CobalaminInMicrograms (optional)
vitaminB6PyridoxineInMilligrams (optional)
vitaminCInMilligrams (optional)
zincInMilligrams (optional)

com.greasefit.server.models.logEntry.LogEntry Up

adjustedTime (optional)
archivedAt (optional)
createdAt
createdBy (optional)
id (optional)
mealEntryId (optional)

com.greasefit.server.models.meal.Meal Up

archivedAt (optional)
createdAt
createdBy (optional)
description (optional)
id (optional)
mealType (optional)
name

com.greasefit.server.models.mealEntry.MealEntry Up

amountInGrams (optional)
archivedAt (optional)
createdAt
createdBy (optional)
id (optional)
itemId (optional)
mealId (optional)
preparationMethod (optional)
quantity (optional)
servingUnit (optional)
type (optional)

com.greasefit.server.models.shoppingList.ShoppingListItem Up

archivedAt (optional)
createdAt
createdBy (optional)
id (optional)
itemId (optional)

com.greasefit.server.models.stepCount.StepCount Up

archivedAt (optional)
count
createdAt
createdBy (optional)
id (optional)

com.greasefit.server.models.user.User Up

archivedAt (optional)
createdAt
email (optional)
emailIsVerified
firstName (optional)
googleSub (optional)
hashedPassword (optional)
id (optional)
profilePictureUrl (optional)
surname (optional)

com.greasefit.server.models.user.UserLogin Up

clientPublicKey (optional)
email (optional)
googleIdToken (optional)
googleSubjectId (optional)
passkeyJson (optional)
password (optional)

com.greasefit.server.models.weightEntry.WeightEntry Up

archivedAt (optional)
createdAt
createdBy
id (optional)
weightAmount

com.greasefit.shared.data.resources.searchResult.SearchRequest Up

query

com.greasefit.shared.data.resources.stepCount.StepCountRequest Up

count

java.time.Instant Up

java.util.UUID Up

kotlinx.datetime.Instant Up

epochSeconds
nanosecondsOfSecond