Skip to content

szabolcs-horvath/nutrition-tracker

Repository files navigation

coverage

Nutrition Tracker for Kinga ( 🤫 SECRET 🤫 )

This project's purpose is to help Kinga track and plan her diet.

Features

  • N/A

Building

Prerequisites

Set up

  1. Create a .env file with the necessary environment variables

    DB_FILE="sqlite/nutrition-tracker.db"
    PORT="6969" # Optional, defaults to "80" or "443" depending on whether TLS is enabled
    
    TLS_DISABLED="false" # Optional, defaults to "false"
    TLS_CERT_FILE="certs/cert.pem" # Optional, defaults to "certs/cert.pem"
    TLS_KEY_FILE="certs/key.pem" # Optional, defaults to "certs/key.pem"
    
    AUTH0_DISABLED="false" # Optional, defaults to "false"
    AUTH0_DOMAIN="<AUTH0_DOMAIN>" # Can be found in the Auth0 dashboard
    AUTH0_CLIENT_ID="<AUTH0_CLIENT_ID>" # Can be found in the Auth0 dashboard
    AUTH0_CLIENT_SECRET="<AUTH0_CLIENT_SECRET>" # Can be found in the Auth0 dashboard
    AUTH0_CALLBACK_URL="https://nutrition-tracking.com/auth/callback" # Should be the same as the one set in the Auth0 dashboard
    COOKIE_STORE_AUTH_KEY="<KEY_TO_AUTHENTICATE_THE_COOKIE_STORE>" # Should ideally be at least 64 bytes of random data
  2. Initialize the database

    make init-db
  3. Build the project

    make build

Running

(The .env file only needs to be specified if it is not in the project root)
out/nutrition-tracker <PATH_TO_YOUR_ENV_FILE>

Checking test coverage

Both unit and integration tests
make coverage
Only unit tests
make unit-coverage
Only integration tests
make integration-coverage

Migrations

Create a new migration
make create-migration MIGRATION_NAME=<MIGRATION_NAME>
Apply all migrations
make migrate-up
Rollback the last migration
make migrate-down-1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published