A fast, accessible calculator for precise Seachem and DIY supplement dosing — now with dark mode, bilingual UI (English ⇄ Kannada), and full CI automation.
- Features
- Screenshots
- Getting Started
- Usage
- Project Structure
- Calculation Reference
- Accessibility & i18n
- Testing
- CI/CD
- Contributing
- Acknowledgements
Category | Details |
---|---|
Supplements | Potassium Bicarbonate (KH Booster), Seachem Equilibrium (GH), Neutral Regulator (pH ≈ 7), Acid Buffer (KH ↓ & pH ↓), Gold Buffer (Goldfish‐specific). |
Units | Litres, US Gallons, UK Gallons. |
Live Feedback | Debounced auto‑calculation ✨; copy‑to‑clipboard; CSV export. |
Accessibility | WCAG 2.2 AA colours, full keyboard nav, aria‑live results, English + ಕನ್ನಡ toggle. |
Theming | One‑click light/dark (prefers‐color‑scheme aware). |
Responsive | Mobile‑first layout; footer action‑bar for Android/iOS convenience. |
Reliability | Unit‑tested math (Jest); ESLint + Security rules; GitHub Actions CI. |
- Visit the [live demo] — or
- Download the repo and double‑click
index.html
.
# Clone & enter
git clone https://github.com/GurucharanSavanth/Seachem-Dosing-Calculator.git
cd Seachem-Dosing-Calculator
# Install dev‑deps for linting/testing
npm ci
# Run tests & linter
npm test # Jest
npm run lint # ESLint
A simple static file server (e.g.
npx serve
) is handy for live‑reload previewing.
- Volume – enter net tank volume & choose unit.
- Supplement panel – expand, fill Current and Target values (plus purity for KHCO₃).
- Doses update automatically or via the Calculate Doses button.
- Copy 📋 or Download CSV for record‑keeping.
See in‑app tooltips (?
) for parameter guidance.
├── index.html
├── css/
│ └── styles.css # WCAG‑compliant theme & layout
├── js/
│ ├── app.js # Bootstraps UI, theme, events
│ ├── utils.js # Constants, helpers, conversions
│ ├── dosingCalculations.js# 💡 Pure math — the critical path
│ ├── uiHandlers.js # DOM glue & CSV export
│ └── translations.js # EN ↔︎ KN strings
├── tests/ # Jest specs (math audit)
Function | Core Formula (g per L) | Source |
---|---|---|
calculateKhco3Grams |
(ΔdKH × 0.017848 × L) ÷ purity |
Seachem / K‑HCO₃ stoichiometry |
calculateEquilibriumGrams |
ΔdGH × 0.066667 × L |
Seachem Equilibrium label |
calculateNeutralRegulatorGrams |
Adaptive 0.0625–0.125 g/L × KH‑factor × pH‑steps | Seachem guide |
calculateAcidBufferGrams |
ΔdKH × 0.046875 × L (fixed v4.2) |
Label: 1.5 g/40 L per 0.8 dKH |
calculateGoldBufferGrams |
0.15 × L (full dose ≥ 0.3 pH) |
Seachem Gold Buffer |
All equations are unit‑tested against manufacturer tables and stoichiometric checks (see tests/
).
- Colour — primary palette darkened to meet 4.5:1 contrast on white (#0059B3).
- ARIA — live regions, labelled controls, focus order preserved.
- Keyboard — fully navigable; copy buttons are standard
<button>
. - Languages — toggle switches entire UI strings via
translations.js
(English ↔ Kannada).
- Jest (
npm test
) covers every dosing function with edge‑low, nominal, edge‑high cases. - ESLint (
npm run lint
) enforces Airbnb +plugin:security/recommended
.
CI fails if either lint or tests fail — keeping
main
green.
Stage | Tool | Purpose |
---|---|---|
Lint | ESLint | Code quality & security rules |
Test | Jest | Math regression suite |
Deploy | GitHub Pages | Auto‑publish main → live demo (via Pages settings) |
- Fork & create a feature branch (
git checkout -b feat/my-fix
). npm ci && npm test && npm run lint
— keep it green.- Commit with Conventional Commits (
chore:
,fix:
,feat:
…). - Open a PR – GitHub Actions will run automatically.
Need an idea? See open issues or suggest improvements!
- Seachem Laboratories, Inc. for publicly documenting dosage guidelines.
- WCAG 2.2 for accessibility standards.
- twbs/colors inspiration for contrast‑safe palette.
Not affiliated with Seachem — this is a community tool. Use at your own risk and always double‑check critical doses.