EDIT 2026-05-03: v1.0.0-rc.14 is out and adds a native Android app.

Full announcement: https://lemmy.world/post/46382994

(original post below)


Hey all, sharing what I’ve been working on. NutriTrace is a self-hosted nutrition and wellness tracker that runs entirely on your own server in a single Docker container.

I built it because every commercial nutrition app has the same shape. You hand them years of food data, body measurements, and biometrics, and your data is held hostage when they pivot or paywall. I wanted to track macros and pull in my Fitbit data without participating in that.

Daily food diary with multi-ingredient meals, recipes, body stats, water tracking, day-level notes. Personal food database, barcode scanner, imports from Open Food Facts and USDA, plus optional Mealie integration. Statistics with trend charts, full backup, exports as CSV / JSON / full ZIP.

Optional wellness device sync from Fitbit, Withings, Garmin, and Android Health Connect. Sleep / readiness / stress scores computed from your data.

Optional AI assistant where you bring your own Claude / OpenAI / Gemini key. It queries your real data via tool use so it can answer things like “what was my average protein this month” without making numbers up. There’s a voice food logger too. Both fully optional, off by default.

Tech: Svelte 4 + Express + better-sqlite3, multi-stage Dockerfile, AGPL-3.0. Native Android app is in active development; PWA installs to home screen on any modern browser today.

Repo and docker-compose example: https://github.com/TraceApps/nutritrace

Happy to answer questions.

      • TraceApps@lemmy.worldOP
        link
        fedilink
        English
        arrow-up
        5
        arrow-down
        6
        ·
        7 days ago

        Yes, vibe coded and proud of it. This is a labor of love that I genuinely don’t think I could have completed without Claude Code. The first commit is large because I was working out of a private dev repo and synced everything to the public repo just before the 1.0 RC release. Hope you give it a chance and that it suits your needs. Thanks!

  • ProfessorScience@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 days ago

    I have exports of my nutrition and weight info from other apps as csv files, and I’d like to import that data if I can. It looks like Nutritrace can export to csv but not import that. There is the option to import from a json backup though. If I can massage my data into that json format, does it seem reasonable to use that as a way to import my historical data?

    If the answer isn’t “omg don’t do that”, then I have a couple of questions about the json:

    • Does each item in the diary array require a matching foodList/meals/recipes entry? Or could I just generate items in the diary array?
    • How much do I need to worry about IDs? The “import JSON” option says that it merges with existing data; how would it handle ID conflicts (which I assume could happen normally when exporting and importing anyway)?
    • Are there any gotchas you can think of that I should watch out for?
    • TraceApps@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 days ago

      The JSON-massage route may work. Diary items are self-contained snapshots, IDs in your file are ignored on import, and the only real catch is that re-importing a date overwrites the existing entry. Happy to drop the field-by-field shape if you want to go that route.

      That said, native CSV importers for the popular apps (MFP, LoseIt, Cronometer, etc) are now on the near-term roadmap (thanks to your suggestion) as the proper path for this. If you can hold off a bit (and use one of the above), that’ll be much easier.

        • TraceApps@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          4 days ago

          Import feature has been added to app as experimental in latest build (1.0.0-rc9). Please test and let me know how it works for you.

          • ProfessorScience@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            3 days ago

            I gave this a shot, but when I press the “preview” button I just get a little popup that says “Invalid CSRF token”.

            • TraceApps@lemmy.worldOP
              link
              fedilink
              English
              arrow-up
              1
              ·
              edit-2
              2 days ago

              I gave this a shot, but when I press the “preview” button I just get a little popup that says “Invalid CSRF token”.

              Hmm… i think i see the issue. The preview / commit upload was missing the CSRF token, so the server was rejecting it before it even read the file. Just pushed a fix. Once you pull it down, hard-refresh the page (Ctrl+Shift+R / Cmd+Shift+R) to grab the new bundle and try again.

              • ProfessorScience@lemmy.world
                link
                fedilink
                English
                arrow-up
                1
                ·
                2 days ago

                Ok, I can import the file now, but some entries are getting messed up. This line, for example, shows up in the diary with the amount “NaNg · 722903 kcal”. And as much as I would like to eat Ginger Peanut Chicken until numbers fail to describe my gluttony, I just can’t afford that many calories.

                Day,Group,Food Name,Amount,Energy (kcal),Alcohol (g),Caffeine (mg),Oxalate (mg),Phytate (mg),Water (g),B1 (Thiamine) (mg),B2 (Riboflavin) (mg),B3 (Niacin) (mg),B5 (Pantothenic Acid) (mg),B6 (Pyridoxine) (mg),B12 (Cobalamin) (µg),Folate (µg),Vitamin A (µg),Vitamin C (mg),Vitamin D (IU),Vitamin E (mg),Vitamin K (µg),Calcium (mg),Copper (mg),Iron (mg),Magnesium (mg),Manganese (mg),Phosphorus (mg),Potassium (mg),Selenium (µg),Sodium (mg),Zinc (mg),Net Carbs (g),Carbs (g),Fiber (g),Insoluble Fiber (g),Soluble Fiber (g),Starch (g),Sugars (g),Added Sugars (g),Fat (g),Cholesterol (mg),Monounsaturated (g),Polyunsaturated (g),Saturated (g),Trans-Fats (g),Omega-3 (g),ALA (g),DHA (g),EPA (g),Omega-6 (g),AA (g),LA (g),Cystine (g),Histidine (g),Isoleucine (g),Leucine (g),Lysine (g),Methionine (g),Phenylalanine (g),Protein (g),Threonine (g),Tryptophan (g),Tyrosine (g),Valine (g),Category 2026-04-20,"Lunch","Ginger Peanut Chicken","750.00 g",963.87,0.00,0.00,202.97,411.64,438.18,0.54,0.84,24.82,1.63,1.88,1.54,142.39,1074.55,62.64,2.52,4.13,39.04,547.85,0.77,12.70,252.20,1.97,913.92,2259.83,76.25,1861.40,6.73,38.20,55.08,16.50,12.52,1.88,9.13,17.86,7.79,45.73,236.74,16.68,10.61,7.96,0.08,3.19,3.15,0.02,0.01,6.92,0.05,6.82,0.88,1.93,3.15,5.60,5.57,1.68,2.96,85.62,3.14,0.78,2.56,3.38,"Meals, Entrees, and Sidedishes"

                Also, there’s a bit of layout weirdness when reimporting days:

                • TraceApps@lemmy.worldOP
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  2 days ago

                  Thanks for catching this. The Cronometer adapter was treating the parsed gram count as a serving multiplier, so a 750g entry got its calories multiplied by 750. The “NaNg” had the same root cause: the portion was stored as the raw string “750.00 g”, which JS coerces to NaN when the diary tries to multiply it for display.

                  The layout overlap on the duplicate-day dialog is should now be fixed too (added a divider so the buttons have proper visual separation from the radio options).

                  Both are hopefully now fixed and pushed in rc.14. Grab the latest package, delete the affected day from your diary, and re-import. Items should hopefully now come in with the right values.

                  Thanks again for the detailed report.

  • Squizzy@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    7 days ago

    How well would this work internationally? More a question on the resources but does open food facts log international barcodes? I knowour stuff is way different to the same product stocked in the US.

    • TraceApps@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      7 days ago

      Barcodes work internationally. i can confirm because i have used in both europe (italy) and africa (south africa). Only difference between nutrition facts i see is that the US uses Sodium and i want to say that at least Europe uses Salt. I have a built in conversion where when one is used the other is automatically calculated.

      • Squizzy@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        7 days ago

        Brilliant, I could have worded that better. I assume a mars bar in europe and a mars bar in the US has different barcodes because they are made differently and I wasnt sure if the OpenFoodFacts was a US library but it appears to log barcodes and info globally.

        Great idea, love it tackling the subscription creep of trackers

  • quick_snail@feddit.nl
    link
    fedilink
    English
    arrow-up
    2
    ·
    7 days ago

    Hey, can you make a much simpler version of this? Just a static site of the USDA data?

    The USDA nutrition site went down at some point during Trump’s term. and I was afraid that information was lost forever.

    I wish we just had a simple way for folks to clone this website. Literally just that. It would be much simpler than what you’ve already done, and extremely useful.

  • Chaser@lemmy.zip
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    Thanks for sharing! I’m so annoyed of Yazio, that I was close to start developing a simple calories tracker myself. Glad I can just use this instead.

    You asked for feature ideas in a comment. How about OIDC support? My wife is good at forgetting (to add) her passwords (to a password manager). So instead of resetting password xyz each week, i installed pocketid and integrated it to every app I host, that supports OIDC.

    • TraceApps@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 days ago

      OIDC has been planned, but since now i have had multiple requests, i have started working on it. Will be implemented most likely in next RC release. Keep an eye out!

        • TraceApps@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          4 days ago

          OIDC feature has been added to app in latest build (1.0.0-rc9). Please test and let me know how it works for you. I successfully tested with Authentik.

          • Chaser@lemmy.zip
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 days ago

            Thanks for implementing it that fast! Unfortunately I wasn’t able to test it.

            I found the new section in the readme. So I followed it. I created an admin account (which confused me a bit - my user already had admin permissions. So why is it necessary to create another admin user?). Then I wanted to logout and login with the admin again. But I wasn’t able to figure out how to log out. So I just deleted the cookies and local storage.

            After that I was greeted by the login page. So I logged in as admin, entered the User Management - and found an interface to manage users. Ok, sounds logic to find a user management tool in the “user management” menu entry. But the readme said, that there should be oidc settings. Maybe they got lost in a merge conflict or something like that. I was testing on rc12.

            Anyways I would prefer an env variable to configure oidc. I like to separate the technical configuration (like credentials, etc) from the user space configuration.

            This comment may sound super negative, but I’m actually very grateful you addressed this feature. Thanks!

            • TraceApps@lemmy.worldOP
              link
              fedilink
              English
              arrow-up
              1
              ·
              2 days ago

              Thanks for implementing it that fast! Unfortunately I wasn’t able to test it.

              I found the new section in the readme. So I followed it. I created an admin account (which confused me a bit - my user already had admin permissions. So why is it necessary to create another admin user?). Then I wanted to logout and login with the admin again. But I wasn’t able to figure out how to log out. So I just deleted the cookies and local storage.

              After that I was greeted by the login page. So I logged in as admin, entered the User Management - and found an interface to manage users. Ok, sounds logic to find a user management tool in the “user management” menu entry. But the readme said, that there should be oidc settings. Maybe they got lost in a merge conflict or something like that. I was testing on rc12.

              Anyways I would prefer an env variable to configure oidc. I like to separate the technical configuration (like credentials, etc) from the user space configuration.

              This comment may sound super negative, but I’m actually very grateful you addressed this feature. Thanks!

              Thanks for the detailed walkthrough. A few of the rough edges you ran into are fixed in the latest release:

              The admin-account confusion makes sense in hindsight. If you were already running NutriTrace single-user, you genuinely didn’t need an admin account, that step exists because OIDC requires user management to be on. The README now spells that out as a prerequisite up front so it doesn’t feel like surprise paperwork.

              Logout has a real home now. Profile lives at the very top of Settings as a card showing your name and photo, and Log Out is right there inside it. No more digging through the cookie jar.

              The “where are the OIDC settings” question was on me. They were buried inside User Management. They’re now their own top-level section called Authentication, sitting right under User Management, with presets for Authentik, Keycloak, Authelia, Pocket ID, Auth0, Google, and a generic OIDC option for anything else.

              And on your env-var preference, that’s in too. You can configure providers entirely from .env or docker-compose.yml. Single-provider shorthand:

              OIDC_ISSUER=https://auth.example.com/ OIDC_CLIENT_ID=nutritrace OIDC_CLIENT_SECRET=… OIDC_DISPLAY_NAME=Authentik OIDC_REDIRECT_URIS=https://nutritrace.example.com/api/auth/oidc/callback/1

              Multi-provider works with OIDC_PROVIDER_2_, OIDC_PROVIDER_3_, etc. Anything you define this way shows up in the Settings UI with a lock badge and is read-only there, so it’s clear where the source of truth lives. Full doc in .env.example and the README.

              Pull the latest and give it another shot when you have a minute. Please confirm the env-var path actually works for your IdP when you have a chance.

              Thanks again.

  • clifmo@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    7 days ago

    Sqlite only? Edit: confirmed. And it’s written in a way that it will likely only support sqlite in the near future

  • irmadlad@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    7 days ago

    Great project. Looks like a lot of time went into it. I may give it a spin later on this evening. You included screenshots. Thank you for that.

  • CosmicGiraffe@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    7 days ago

    What does the mealie integration enable? I assume it’s providing foods that can be logged, but can you also pull stuff from mealies meal planning section & populate it into the diary?

    • TraceApps@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      7 days ago

      Mealie integration allows you to pull in your Meal/Recipe from your self hosted instance of Mealie via api. If you have nutrition facts set there by the recipes total weight, it will pull in that data and then you can set your serving size accordingly so it calculates properly. It also pulls in the recipe pic if set in Mealie.

  • Daniel Quinn@lemmy.ca
    link
    fedilink
    English
    arrow-up
    17
    arrow-down
    1
    ·
    7 days ago

    As this is a new project, have you considered hosting your code somewhere other than GitHub? Codeberg and GitLab are similarly user-friendly platforms without the many downsides of supporting Microsoft.

    • quick_snail@feddit.nl
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      6 days ago

      At least a mirror. GitHub is authwalled even for GET requests more and more these days

  • TraceApps@lemmy.worldOP
    link
    fedilink
    English
    arrow-up
    13
    ·
    7 days ago

    Thanks all, really appreciate the kind words. Feedback is welcome on anything: bug reports, missing features, things that feel rough, or just “this works for my setup.” A few features are flagged Experimental right now and I’d like to harden them enough to drop the badge.

    Native Android app is in active development. There’s also a sister project in the works called LiftTrace under the same TraceApps umbrella, same self-hosted Docker setup but for workout tracking (sets, reps, programs, PRs). Not public yet but close.