Intake24 Documentation

website·Indexed 33 days ago

https://docs.intake24.org

Developer and researcher guidance for building and using Intake24. Includes documentation on the TypeScript-based API server, Vue.js survey client, PostgreSQL database configuration, Redis-backed queueing and caching, and CLI tools for environment initialization and ACL synchronization.

Tokens
44.5K
Snippets
238
Records
408
Agent score
60%

What's inside Intake24

  1. Overview of Intake24 Database Architecture

    Intake24 uses PostgreSQL as its database engine. The API Server interacts with the database using a combination of the Sequelize ORM and the Kysely query builder. The system is split into two primary databases:

    • foods: Contains all food-related data (foods, food groups, nutrients, etc.).
    • system: Contains system-related data (users, permissions, roles, feedback schemes, surveys, etc.).
  2. Overview of Intake24 image processing strategy

    Intake24 accepts image uploads of any size or resolution. To ensure consistency and performance, images are resized to standardized dimensions and cached before being served to clients. Original source images are stored separately, allowing standard-sized images to be recreated at any time without data loss.
  3. Overview of Portion Size Estimation Properties

    Portion size estimation methods in Intake24 are defined by several core properties:

    • Estimation method: The specific method ID used for estimation.
    • Description: The localized text displayed to the respondent during the selection process.
    • Pathways: The context in which the method is available. Supported pathways include addon food (addon-foods-prompt), associated foods, food search, and recipe ingredient.
    • Conversion factor: A multiplier applied during the final portion size calculation.
  4. Overview of SurveyNutrientsRecalculation job

    SurveyNutrientsRecalculation is used to update nutrient snapshots stored within submitted recalls. It modifies the snapshots in the submission data but does not alter the underlying locale foods, food mappings, or food composition records in the foods database. Food codes and saved food names (code, englishName, localName) are never changed by this job.
  5. Perform a dry-run of the SurveyNutrientsRecalculation job

    To test job setup and parameter validation without modifying live data, use mode: "none" and syncFields: false. This configuration validates that the survey ID exists and emits statistics about the submissions to be processed, but makes no changes to the SurveySubmissionFood records in the database.
    {
      "surveyId": "59",
      "mode": "none",
      "syncFields": false
    }
  6. Understand Intake24 Access Control List (ACL) mechanisms

    Intake24 manages access control using two distinct mechanisms: Resources and Securables. Resource-level access provides broad permissions across all records of a specific type, while Securables allow for granular, per-record permission grants within a resource.
  7. Understand the Survey (Recall) technical architecture

    The Survey (Recall) module is built with Vue.js and utilizes Vuetify for its grid system layout. Custom prompts are defined as types and loaded as components mapped into Recall.vue, where they are rendered dynamically using the Vue <component :is="..."> pattern.
  8. Manage Drinkware sets to assign localized labels and weights

    A Drinkware set is an enhanced record based on an image map. It allows administrators to assign localized labels and weights to each object defined within a specific Image map record.
  9. Understand Intake24 system-level permissions management

    The Permissions resource defines system-level access control. Because these permissions are tied directly to the source code implementation, they are managed via database migrations to ensure system stability. Users should generally not manually create, edit, or delete permission records.
  10. Understand Intake24 API design and content types

    The Intake24 API follows RESTful principles. Depending on the endpoint, you must provide the correct Content-Type header:

    • For standard data requests, use application/json.
    • For endpoints that expect file uploads, use multipart/form-data.
    GET /api/endpoint
    Content-Type: application/json
    GET /api/endpoint
    Content-Type: multipart/form-data
  11. Understand Intake24 API rate limit types

    Intake24 applies two distinct levels of rate limiting:

    1. Global limits: More relaxed limits applied across all API endpoints.
    2. Sensitive endpoint limits: More strict rate limits applied to specific sensitive endpoints to prevent abuse.
  12. Monitor system-wide job status in Intake24

    The Jobs resource in the Intake24 admin system allows administrators to view the system-wide status of all jobs processed through the platform. The 'Detail' tab provides specific information for a selected job.