This is the main code project for Keto Train. You can find the separate design/release project for Keto Train here: https://github.com/petemcgowan/KetoTrain_Design_Release
Keto Train is a full-stack React Native / TypeScript app that provides tools and resources for monitoring daily keto limit. It uses Open Food Facts for nutritional information and features carb limit tracking, D3 charting, Lottie animations, custom motion design, and a Dockerized backend.
Under the hood, Keto Train now uses PostgreSQL with pgvector to power semantic food search:
- Food rows in
food_factshave anembedding vector(768)column populated via a Gemini embedding model (generateEmbeddings.mjs). - The GraphQL API exposes a
semanticFoodSearchquery that embeds the user query and performs similarity search overembeddingusing pgvector. - In production, the KetoLimit API server runs in Docker on EC2, connecting to the shared Postgres instance (with pgvector + IVFFlat index) that also backs the HealthyCalc app.
From the client’s perspective this shows up as a smarter search experience: fuzzy queries like “grilled chicken” or “salami snack” return relevant foods even when they don’t exactly match the original Open Food Facts names.








