Health balance app using ScalaFx, Jsoniter, Scaffeine, JoddMail, ScalikeJdbc, PostgreSql, Helidon, Ox and Scala 3.
- Test client.
- add | update | list edibles, drinkables, expendables, measurables
- view dashboard
- Account 1 --> * Profile
- Profile 1 --> * Edible, Drinkable, Expendable, Measurable
Required entity support: Edible, Drinkable, Expendable and Measurable
Edible, Drinkable, Expendable:
- Today Total Calories
- Week Total Calories
Summary:
- Today Calorie Ratio -> Edibles + Drinkables / Expendables
- Week Calorie Ratio -> Edibles + Drinkables / Expendables
Today, Average
- Pulse
- Weight
- Glucose
- sbt clean compile
- sbt clean test
- sbt server/run
- sbt client/run
- sbt server/universal:packageBin
- see server/target/universal
To build for a "mac", "m1', "win" or "linux" os target:
- sbt -Dtarget="mac" clean test assembly copyAssemblyJar
- sbt -Dtarget="m1" clean test assembly copyAssemblyJar
- sbt -Dtarget="win" clean test assembly copyAssemblyJar
- sbt -Dtarget="linux" clean test assembly copyAssemblyJar
To execute an assembled jar locally:
- java -jar .assembly/health-balance-mac-0.30.jar
- java -jar .assembly/health-balance-m1-0.30.jar
- java -jar .assembly/health-balance-win-0.30.jar
- java -jar .assembly/health-balance-linux-0.30.jar
Consider these options:
- config:
- on osx intel: /usr/local/var/postgres/postgresql.config : listen_addresses = ‘localhost’, port = 5432
- on osx m1: /opt/homebrew/var/postgres/postgresql.config : listen_addresses = ‘localhost’, port = 5432
- run:
- brew services start postgresql@14
- logs:
- on osx intel: /usr/local/var/log/postgres.log
- on m1: /opt/homebrew/var/log/postgres.log
Example database url: postgresql://localhost:5432/healthbalance?user=mycomputername&password=healthbalance"
- psql postgres
- CREATE DATABASE healthbalance OWNER [your computer name];
- GRANT ALL PRIVILEGES ON DATABASE healthbalance TO [your computer name];
- \l
- \q
- psql healthbalance
- \i ddl.sql
- \q
Alternatively run: psql -d healthbalance -f ddl.sql
- psql healthbalance
- \i ddl.sql
- \q
- psql postgres
- drop database healthbalance;
- \q
The following environment variables must be defined:
export HEALTH_BALANCE_HOST="127.0.0.1"
export HEALTH_BALANCE_PORT=7171
export HEALTH_BALANCE_ENDPOINT="/command"
export HEALTH_BALANCE_CACHE_INITIAL_SIZE=4
export HEALTH_BALANCE_CACHE_MAX_SIZE=10
export HEALTH_BALANCE_CACHE_EXPIRE_AFTER=24
export HEALTH_BALANCE_POSTGRESQL_URL="jdbc:postgresql://localhost:5432/healthbalance"
export HEALTH_BALANCE_POSTGRESQL_USER="yourusername"
export HEALTH_BALANCE_POSTGRESQL_PASSWORD="healthbalance"
export WALKER_POSTGRESQL_DRIVER="org.postgresql.ds.PGSimpleDataSource"
export HEALTH_BALANCE_POSTGRESQL_DB_NAME="healthbalance"
export HEALTH_BALANCE_POSTGRESQL_HOST="127.0.0.1"
export HEALTH_BALANCE_POSTGRESQL_PORT=5432
export HEALTH_BALANCE_POSTGRESQL_POOL_INITIAL_SIZE=9
export HEALTH_BALANCE_POSTGRESQL_POOL_MAX_SIZE=32
export HEALTH_BALANCE_POSTGRESQL_POOL_CONNECTION_TIMEOUT_MILLIS=30000
export HEALTH_BALANCE_EMAIL_HOST="your-email.provider.com"
export HEALTH_BALANCE_EMAIL_ADDRESS="[email protected]"
export HEALTH_BALANCE_EMAIL_PASSWORD="your-email-password"
Copyright (c) [2023, 2024, 2025] [Objektwerks]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.