Pool balance app using ScalaFx, ScalikeJdbc, Jsoniter, JoddMail, PostgreSql, Helidon, Ox and Scala 3.
- Test client.
- 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/pool-balance-mac-0.50.jar
- java -jar .assembly/pool-balance-m1-0.50.jar
- java -jar .assembly/pool-balance-win-0.50.jar
- java -jar .assembly/pool-balance-linux-0.50.jar
Consider these options:
- dashboard
- cleanings
- measurements
- chemicals
- charts
- database
- clean pool and components
- measure pool chemical content
- add chemicals to pool
- Pool 1 --> * Cleaning | Measurement | Chemical
- Client 1 --> 1 Context
- Conext 1 --> 1 Model | View
- Model 1 --> 1 Proxy
- View 1 --> 1 Context
- Top: dashboard(total chlorine, free chlorine, ph, calcium hardness, total alkalinity, cyanuric acid, total bromine)
- Left: pane(pools)
- Right: tabbedpane(cleanings, measurements, chemicals)
- cleanings - line chart ( x = cleaned, y = count of [true] cleanings )
- chemicals - line chart ( x = added, y = chemical )
- measurements - line chart ( x = measured, y = measurement )
Measured in ppm ( parts per million ).
Measurement | Range | Good | Ideal |
---|---|---|---|
total chlorine (tc = fc + cc) | 0 - 10 | 1 - 5 | 3 |
free chlorine (fc) | 0 - 10 | 1 - 5 | 3 |
combinded chlorine (cc = tc - fc) | 0.0 - 0.5 | 0.0 - 0.2 | 0.0 |
ph | 6.2 - 8.4 | 7.2 - 7.6 | 7.4 |
calcium hardness | 0 - 1000 | 250 - 500 | 375 |
total alkalinity | 0 - 240 | 80 - 120 | 100 |
cyanuric acid | 0 - 300 | 30 - 100 | 50 |
total bromine | 0 - 20 | 2 - 10 | 5 |
salt | 0 - 3600 | 2700 - 3400 | 3200 |
temperature | 50 - 100 | 75 - 85 | 82 |
- Liquids measured in: gallons ( gl ) and liters ( l ).
- Granules measured in: pounds ( lbs ) and kilograms ( kg ).
- LiquidChlorine ( gl/l )
- Trichlor ( tablet )
- Dichlor ( lbs/kg )
- CalciumHypochlorite ( lbs/kg )
- Stabilizer ( lbs/kg )
- Algaecide ( gl/l )
- MuriaticAcid ( gl/l )
- Salt ( lbs/kg )
- Chlorine for pool.
- Chlorine tablets for pool filtration system.
- Pool Shock
Suggested solutions to chemical imbalances.
- high ph - Sodium Bisulfate
- low ph - Sodium Carbonate, Soda Ash
- high alkalinity - Muriatic Acid, Sodium Bisulfate
- low alkalinity - Sodium Bicarbonate, Baking Soda
- calcium hardness - Calcium Chloride
- low chlorine - Chlorine Tablets, Granules, Liquid
- algae - Algaecide, Shock
- stains - Stain Identification Kit, Stain Remover
- 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/poolbalance?user=mycomputername&password=poolbalance"
- psql postgres
- CREATE DATABASE poolbalance OWNER [your computer name];
- GRANT ALL PRIVILEGES ON DATABASE poolbalance TO [your computer name];
- \l
- \q
- psql poolbalance
- \i ddl.sql
- \q
Alternatively run: psql -d poolbalance -f ddl.sql
- psql poolbalance
- \i ddl.sql
- \q
- psql postgres
- drop database poolbalance;
- \q
The following environment variables must be defined:
export POOL_BALANCE_HOST="127.0.0.1"
export POOL_BALANCE_PORT=7272
export POOL_BALANCE_ENDPOINT="/command"
export POOL_BALANCE_CACHE_INITIAL_SIZE=4
export POOL_BALANCE_CACHE_MAX_SIZE=10
export POOL_BALANCE_CACHE_EXPIRE_AFTER=24
export POOL_BALANCE_POSTGRESQL_DRIVER="org.postgresql.ds.PGSimpleDataSource"
export POOL_BALANCE_POSTGRESQL_URL="jdbc:postgresql://localhost:5432/poolbalance"
export POOL_BALANCE_POSTGRESQL_USER="yourusername"
export POOL_BALANCE_POSTGRESQL_PASSWORD="poolbalance"
export POOL_BALANCE_EMAIL_HOST="your-email.provider.com"
export POOL_BALANCE_EMAIL_ADDRESS="[email protected]"
export POOL_BALANCE_EMAIL_PASSWORD="your-email-password"
Copyright (c) [2022 - 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.