1
0
Fork
You've already forked gainz-server
0
No description
  • Zig 99.3%
  • Nix 0.7%
2026年04月21日 16:59:20 +03:00
docker-scripts/postgres feat(auth): handle API key usage in requests 2025年11月29日 23:08:04 +02:00
docs feat(analytics): change weight predict from post to get 2025年12月01日 02:32:40 +02:00
src fix(endpoints): incorrect method handling 2025年12月25日 00:32:33 +02:00
.env_example revert: don't store model metadata in database 2025年11月26日 23:20:34 +02:00
.gitignore feat(ml): save trained models on disk 2025年11月25日 23:56:33 +02:00
.testing.env.example rewrite: struct models, add tests 2025年03月30日 01:01:02 +02:00
build.zig feat(weight): future weight prediction model training 2025年11月25日 02:00:09 +02:00
build.zig.zon chore: move to codeberg 2026年04月21日 16:59:20 +03:00
CONTRIBUTING.md feat (contributing): add contributing guidelines 2025年10月28日 16:57:08 +02:00
docker-compose.yml chore: test redis instance 2025年11月05日 23:45:18 +02:00
flake.lock build: add nix 2025年11月25日 02:02:00 +02:00
flake.nix build: add nix 2025年11月25日 02:02:00 +02:00
LICENCE chore: add licence 2025年10月10日 18:44:01 +03:00
README.md chore(readme): API stability clarification 2025年11月09日 23:43:00 +02:00

Gainz

Gainz is an unopinionated diet and exercise management platform.

Important

Gainz is currently pre 1.0. The API is not stable and changes may be made at any time.

Features

  • Calorie and macronutrient tracking.
  • Exercise logging.
  • Personalized goals for calories, nutrients, weight and exercise performance.

Building

Prerequisites

Gainz uses PostgreSQL and Redis under the hood. It is recommended that you use the Docker Compose file to automatically set it up.

Copy the .env_example file and rename it to .env. After filling in the information inside it, run:

docker compose --profile prod up -d

Compiling

Important

Gainz is written on Zig 0.15.

Inside your terminal, run

zig build -Doptimize=ReleaseSafe

There are more build modes if you wish to use them.

After compilation is done, the compiled executable will be inside the zig-out\bin\ folder.

Usage

Make sure the PostgreSQL and Redis instances are running. If they are not, run

docker compose --profile prod start

If you used the Docker Compose approach, your .env file should already be ready to use. If you opted for a different way to manage the instances, copy .env-example, rename it to .env and fill in the necessary information.

If you want to stop the server, stop the executable. You can turn off the Docker container by doing

docker compose --profile prod stop

Testing

To get started testing, you need a test instance of the database. The easiest way of doing this is via the Docker Compose file.

Copy .testing.env_example, rename it to .testing.env and fill in the information.

After that, run

docker compose --profile test up -d
zig build test