draft_survey

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2026 License: MIT Imports: 1 Imported by: 0

README ΒΆ

Draft Survey Tool

A professional cargo weight calculator for marine surveyors, implementing the UNECE 1992 Draft Survey Code.

Status: 🚧 Active Development β€” v0.1.0-rc | Core calculations complete and verified against UNECE 1992 standard


Overview

Draft Survey Tool is an offline-first desktop application that helps marine surveyors calculate cargo weight using the draft survey method. All calculations strictly follow the UNECE Code for the Uniform Application of the Rules for the Measurement of Bulk Cargoes (1992).

The mathematics is fully implemented, tested against real-world golden data, and verified to match the standard. The application runs locally β€” no internet connection required, no data leaves your machine.


Screenshots

Survey List

Draft Readings

Calculation Results


Features

Calculations (UNECE 1992 compliant)

  • Quarter Mean Draft (QMD) with PP and keel corrections
  • Full LBP and Half LBP correction methods
  • First and Second Trim Correction
  • List Correction
  • LCF/LCA interpolation β€” auto and manual direction detection
  • Density Correction with FWA/DWA
  • Deductibles: fuel, lubricants, ballast water, fresh water, others
  • Tank volume calculation via calibration tables β€” 3 table types with optional list correction
  • Multi-draft surveys: Initial β†’ Intermediate(s) β†’ Final
  • Cargo on board with discrepancy from Shipper/Receiver declaration

Application

  • Offline-first β€” all data stored locally as JSON files
  • Self-contained binary β€” dictionaries and assets embedded at build time
  • Survey list with search by vessel name / IMO and date range filter
  • Real-time calculation panel updated as you type
  • SVG vessel diagram with dynamic trim and list visualization
  • Sea condition logging (Wave / Ice with detailed condition selection)
  • BW and FW tank management with calibration table modal
  • Survey status alerts (constant deviation, data warnings)
  • Surveyor profile with company details

Tech Stack

Layer Technology
Backend Go 1.25 + Fiber v2.52
Templates Templ v0.3.977
Interactivity HTMX 2.0.8 + Alpine.js 3.15.8
DOM Morphing Idiomorph
Fonts IBM Plex Sans & Mono
Storage JSON files (one file per survey)

Getting Started

Prerequisites
Run in Development Mode
# Clone the repository
git clone git@github.com:AVZotov/draft-survey.git
cd draft-survey

# Install dependencies
go mod download

# Run with hot reload
air

# Run with debug configuration
air -c .air.debug.toml

The application will be available at http://localhost:3399

Data Directory

On first run, the application creates the following directory structure:

data/
  surveys/    β€” survey records (one JSON file per survey)
  users/      β€” surveyor profile
  temp/       β€” temporary files
  backups/    β€” survey backups

Dictionaries (ports, countries) are embedded in the binary and require no external files.


Project Structure

cmd/server/         β€” application entry point
internal/
  calculation/      β€” UNECE 1992 math engine
  types/            β€” shared domain types
  storage/          β€” repository pattern (JSON + embed.FS)
  handler/          β€” HTTP handlers (Fiber)
  format/           β€” value formatting helpers
  constants/        β€” form field names, header constants
data/
  dictionaries/     β€” static data (ports, countries, conditions)
docs/               β€” documentation and glossary
web/
  templates/        β€” page templates (Templ)
  widgets/          β€” reusable UI components
  components/       β€” shared UI elements
  static/           β€” CSS, JS, fonts
embed.go            β€” go:embed directives (self-contained build)

Roadmap

See docs/ROADMAP.md for the full development plan.

Coming next (v0.2.0):

  • PDF report generation (UNECE-compliant format)
  • Structured logging
  • Pre-built binaries for Windows, macOS, Linux

Acknowledgements

This project is built with excellent open source tools. Grateful to their authors and contributors:

Project Version License
Go 1.25 BSD-3-Clause
Fiber v2.52.11 MIT
Templ v0.3.977 MIT
HTMX 2.0.8 BSD Zero Clause
Alpine.js 3.15.8 MIT
Idiomorph latest BSD Zero Clause
IBM Plex β€” SIL Open Font License 1.1
Google UUID v1.6.0 BSD-3-Clause

All dependencies are compatible with commercial use.


License

This project is licensed under the MIT License β€” see LICENSE for details.


Standard Reference

All calculations implement the methods described in:

UNECE Code for the Uniform Application of the Rules for the Measurement of Bulk Cargoes, January 1992

Available from the United Nations Economic Commission for Europe.

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

View Source
var Dictionaries embed.FS
View Source
var Docs embed.FS
View Source
var StaticFiles embed.FS

Functions ΒΆ

This section is empty.

Types ΒΆ

This section is empty.

Directories ΒΆ

Path Synopsis
cmd
server command
data
internal
web
templ: version: v0.3.977
templ: version: v0.3.977
components
templ: version: v0.3.977
templ: version: v0.3.977
layouts
templ: version: v0.3.977
templ: version: v0.3.977
templates/pages
templ: version: v0.3.977
templ: version: v0.3.977
widgets
templ: version: v0.3.977
templ: version: v0.3.977
widgets/drafts
templ: version: v0.3.977
templ: version: v0.3.977
widgets/results
templ: version: v0.3.977
templ: version: v0.3.977
widgets/survey
templ: version: v0.3.977
templ: version: v0.3.977
widgets/survey-list
templ: version: v0.3.977
templ: version: v0.3.977
widgets/tanks
templ: version: v0.3.977
templ: version: v0.3.977
widgets/tanks/corrections
templ: version: v0.3.977
templ: version: v0.3.977

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL