refactor documentation

This commit is contained in:
xbgmsharp
2023-12-29 18:15:08 +01:00
parent f8c1f43f48
commit c4fbf7682d
8 changed files with 123 additions and 108 deletions

View File

@@ -4,7 +4,7 @@ The Entity-Relationship Diagram (ERD) provides a graphical representation of dat
## A global overview ## A global overview
Auto generated Mermaid diagram using [mermerd](https://github.com/KarnerTh/mermerd) and [MermaidJs](https://github.com/mermaid-js/mermaid). Auto generated Mermaid diagram using [mermerd](https://github.com/KarnerTh/mermerd) and [MermaidJs](https://github.com/mermaid-js/mermaid).
[PostgSail SQL Schema](https://github.com/xbgmsharp/postgsail/tree/main/ERD/postgsail.md "PostgSail SQL Schema") [PostgSail SQL Schema](https://github.com/xbgmsharp/postgsail/tree/main/docs/ERD/postgsail.md "PostgSail SQL Schema")
## Further ## Further
There is 3 main schemas: There is 3 main schemas:

View File

@@ -1,26 +1,26 @@
```mermaid ```mermaid
erDiagram erDiagram
api_logbook { api_logbook {
text _from text _from
double_precision _from_lat double_precision _from_lat
double_precision _from_lng double_precision _from_lng
integer _from_moorage_id "Link api.moorages with api.logbook via FOREIGN KEY and REFERENCES" integer _from_moorage_id "Link api.moorages with api.logbook via FOREIGN KEY and REFERENCES"
timestamp_with_time_zone _from_time "{NOT_NULL}" timestamp_with_time_zone _from_time "{NOT_NULL}"
text _to text _to
double_precision _to_lat double_precision _to_lat
double_precision _to_lng double_precision _to_lng
integer _to_moorage_id "Link api.moorages with api.logbook via FOREIGN KEY and REFERENCES" integer _to_moorage_id "Link api.moorages with api.logbook via FOREIGN KEY and REFERENCES"
timestamp_with_time_zone _to_time timestamp_with_time_zone _to_time
boolean active boolean active
double_precision avg_speed double_precision avg_speed
numeric distance "in NM" numeric distance "in NM"
interval duration "Best to use standard ISO 8601" interval duration "Best to use standard ISO 8601"
jsonb extra "computed signalk metrics of interest, runTime, currentLevel, etc" jsonb extra "computed signalk metrics of interest, runTime, currentLevel, etc"
integer id "{NOT_NULL}" integer id "{NOT_NULL}"
double_precision max_speed double_precision max_speed
double_precision max_wind_speed double_precision max_wind_speed
text name text name
text notes text notes
geography track_geog "postgis geography type default SRID 4326 Unit: degres" geography track_geog "postgis geography type default SRID 4326 Unit: degres"
jsonb track_geojson "store generated geojson with track metrics data using with LineString and Point features, we can not depend api.metrics table" jsonb track_geojson "store generated geojson with track metrics data using with LineString and Point features, we can not depend api.metrics table"
geometry track_geom "postgis geometry type EPSG:4326 Unit: degres" geometry track_geom "postgis geometry type EPSG:4326 Unit: degres"
@@ -29,17 +29,17 @@ erDiagram
api_metadata { api_metadata {
boolean active "trigger monitor online/offline" boolean active "trigger monitor online/offline"
boolean active boolean active
double_precision beam double_precision beam
text client_id text client_id
timestamp_with_time_zone created_at "{NOT_NULL}" timestamp_with_time_zone created_at "{NOT_NULL}"
double_precision height double_precision height
integer id "{NOT_NULL}" integer id "{NOT_NULL}"
double_precision length double_precision length
numeric mmsi numeric mmsi
text name text name
text plugin_version "{NOT_NULL}" text plugin_version "{NOT_NULL}"
numeric ship_type numeric ship_type
text signalk_version "{NOT_NULL}" text signalk_version "{NOT_NULL}"
timestamp_with_time_zone time "{NOT_NULL}" timestamp_with_time_zone time "{NOT_NULL}"
timestamp_with_time_zone updated_at "{NOT_NULL}" timestamp_with_time_zone updated_at "{NOT_NULL}"
@@ -48,48 +48,48 @@ erDiagram
} }
api_metrics { api_metrics {
double_precision anglespeedapparent double_precision anglespeedapparent
text client_id text client_id
double_precision courseovergroundtrue double_precision courseovergroundtrue
double_precision latitude "With CONSTRAINT but allow NULL value to be ignored silently by trigger" double_precision latitude "With CONSTRAINT but allow NULL value to be ignored silently by trigger"
double_precision longitude "With CONSTRAINT but allow NULL value to be ignored silently by trigger" double_precision longitude "With CONSTRAINT but allow NULL value to be ignored silently by trigger"
jsonb metrics jsonb metrics
double_precision speedoverground double_precision speedoverground
status status "<sailing,motoring,moored,anchored>" status status "<sailing,motoring,moored,anchored>"
timestamp_with_time_zone time "{NOT_NULL}" timestamp_with_time_zone time "{NOT_NULL}"
text vessel_id "{NOT_NULL}" text vessel_id "{NOT_NULL}"
double_precision windspeedapparent double_precision windspeedapparent
} }
api_moorages { api_moorages {
text country text country
geography geog "postgis geography type default SRID 4326 Unit: degres" geography geog "postgis geography type default SRID 4326 Unit: degres"
boolean home_flag boolean home_flag
integer id "{NOT_NULL}" integer id "{NOT_NULL}"
double_precision latitude double_precision latitude
double_precision longitude double_precision longitude
text name text name
jsonb nominatim jsonb nominatim
text notes text notes
jsonb overpass jsonb overpass
integer reference_count integer reference_count
integer stay_code "Link api.stays_at with api.moorages via FOREIGN KEY and REFERENCES" integer stay_code "Link api.stays_at with api.moorages via FOREIGN KEY and REFERENCES"
interval stay_duration "Best to use standard ISO 8601" interval stay_duration "Best to use standard ISO 8601"
text vessel_id "{NOT_NULL}" text vessel_id "{NOT_NULL}"
} }
api_stays { api_stays {
boolean active boolean active
timestamp_with_time_zone arrived "{NOT_NULL}" timestamp_with_time_zone arrived "{NOT_NULL}"
timestamp_with_time_zone departed timestamp_with_time_zone departed
interval duration "Best to use standard ISO 8601" interval duration "Best to use standard ISO 8601"
geography geog "postgis geography type default SRID 4326 Unit: degres" geography geog "postgis geography type default SRID 4326 Unit: degres"
integer id "{NOT_NULL}" integer id "{NOT_NULL}"
double_precision latitude double_precision latitude
double_precision longitude double_precision longitude
integer moorage_id "Link api.moorages with api.stays via FOREIGN KEY and REFERENCES" integer moorage_id "Link api.moorages with api.stays via FOREIGN KEY and REFERENCES"
text name text name
text notes text notes
integer stay_code "Link api.stays_at with api.stays via FOREIGN KEY and REFERENCES" integer stay_code "Link api.stays_at with api.stays via FOREIGN KEY and REFERENCES"
text vessel_id "{NOT_NULL}" text vessel_id "{NOT_NULL}"
} }
@@ -106,7 +106,7 @@ erDiagram
text first "User first name with CONSTRAINT CHECK {NOT_NULL}" text first "User first name with CONSTRAINT CHECK {NOT_NULL}"
text last "User last name with CONSTRAINT CHECK {NOT_NULL}" text last "User last name with CONSTRAINT CHECK {NOT_NULL}"
text pass "{NOT_NULL}" text pass "{NOT_NULL}"
jsonb preferences jsonb preferences
integer public_id "{NOT_NULL}" integer public_id "{NOT_NULL}"
name role "{NOT_NULL}" name role "{NOT_NULL}"
timestamp_with_time_zone updated_at "{NOT_NULL}" timestamp_with_time_zone updated_at "{NOT_NULL}"
@@ -115,14 +115,27 @@ erDiagram
auth_otp { auth_otp {
text otp_pass "{NOT_NULL}" text otp_pass "{NOT_NULL}"
timestamp_with_time_zone otp_timestamp timestamp_with_time_zone otp_timestamp
smallint otp_tries "{NOT_NULL}" smallint otp_tries "{NOT_NULL}"
citext user_email "{NOT_NULL}" citext user_email "{NOT_NULL}"
} }
auth_users {
timestamp_with_time_zone connected_at "{NOT_NULL}"
timestamp_with_time_zone created_at "{NOT_NULL}"
name email "{NOT_NULL}"
text first "{NOT_NULL}"
name id "{NOT_NULL}"
text last "{NOT_NULL}"
jsonb preferences
name role "{NOT_NULL}"
timestamp_with_time_zone updated_at "{NOT_NULL}"
text user_id "{NOT_NULL}"
}
auth_vessels { auth_vessels {
timestamp_with_time_zone created_at "{NOT_NULL}" timestamp_with_time_zone created_at "{NOT_NULL}"
numeric mmsi numeric mmsi
text name "{NOT_NULL}" text name "{NOT_NULL}"
citext owner_email "{NOT_NULL}" citext owner_email "{NOT_NULL}"
name role "{NOT_NULL}" name role "{NOT_NULL}"
@@ -131,8 +144,8 @@ erDiagram
} }
public_aistypes { public_aistypes {
text description text description
numeric id numeric id
} }
public_app_settings { public_app_settings {
@@ -141,94 +154,94 @@ erDiagram
} }
public_badges { public_badges {
text description text description
text name text name
} }
public_email_templates { public_email_templates {
text email_content text email_content
text email_subject text email_subject
text name text name
text pushover_message text pushover_message
text pushover_title text pushover_title
} }
public_geocoders { public_geocoders {
text name text name
text reverse_url text reverse_url
text url text url
} }
public_iso3166 { public_iso3166 {
text alpha_2 text alpha_2
text alpha_3 text alpha_3
text country text country
integer id integer id
} }
public_mid { public_mid {
text country text country
integer country_id integer country_id
numeric id numeric id
} }
public_ne_10m_geography_marine_polys { public_ne_10m_geography_marine_polys {
text changed text changed
text featurecla text featurecla
geometry geom geometry geom
integer gid "{NOT_NULL}" integer gid "{NOT_NULL}"
text label text label
double_precision max_label double_precision max_label
double_precision min_label double_precision min_label
text name text name
text name_ar text name_ar
text name_bn text name_bn
text name_de text name_de
text name_el text name_el
text name_en text name_en
text name_es text name_es
text name_fa text name_fa
text name_fr text name_fr
text name_he text name_he
text name_hi text name_hi
text name_hu text name_hu
text name_id text name_id
text name_it text name_it
text name_ja text name_ja
text name_ko text name_ko
text name_nl text name_nl
text name_pl text name_pl
text name_pt text name_pt
text name_ru text name_ru
text name_sv text name_sv
text name_tr text name_tr
text name_uk text name_uk
text name_ur text name_ur
text name_vi text name_vi
text name_zh text name_zh
text name_zht text name_zht
text namealt text namealt
bigint ne_id bigint ne_id
text note text note
smallint scalerank smallint scalerank
text wikidataid text wikidataid
} }
public_process_queue { public_process_queue {
text channel "{NOT_NULL}" text channel "{NOT_NULL}"
integer id "{NOT_NULL}" integer id "{NOT_NULL}"
text payload "{NOT_NULL}" text payload "{NOT_NULL}"
timestamp_with_time_zone processed timestamp_with_time_zone processed
text ref_id "either user_id or vessel_id {NOT_NULL}" text ref_id "either user_id or vessel_id {NOT_NULL}"
timestamp_with_time_zone stored "{NOT_NULL}" timestamp_with_time_zone stored "{NOT_NULL}"
} }
public_spatial_ref_sys { public_spatial_ref_sys {
character_varying auth_name character_varying auth_name
integer auth_srid integer auth_srid
character_varying proj4text character_varying proj4text
integer srid "{NOT_NULL}" integer srid "{NOT_NULL}"
character_varying srtext character_varying srtext
} }
api_logbook }o--|| api_metadata : "" api_logbook }o--|| api_metadata : ""

View File

Before

Width:  |  Height:  |  Size: 360 KiB

After

Width:  |  Height:  |  Size: 360 KiB

View File

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 195 KiB

After

Width:  |  Height:  |  Size: 195 KiB

2
docs/README.md Normal file
View File

@@ -0,0 +1,2 @@
Simple and scalable architecture.