Skip to content

Commit 649ddd1

Browse files
willirathIngmarIngmarEissfeldt
authored
Restructure completely (#6)
This complete re-builds the app, splitting it into three components (database, api, frontend). Individual commit messages: * current state * current state * fix display of hex grid from geojson * fix display of hex grid from geojson * data no longer in .gitignore * small fix for app.tsx * app.tsx error resolved * DB architecture * Updated dependencies (not fully functional yet) * Same functionality as before the incident * Basic hover and on click functions * api supports connectivity, frontend doesn't * Frontend properly fetches connectivity (took way too long) * Hexagons properly color based on connectivity and changed geojson to match the connectivity * Connectivity now updates properly * Updated ControlPanel * New database * inter container comms now work over the docker compose and not over local network * Batch processing of PQ file to DB * Much faster db lookup * Now refetches on parameter change * Hover tooltips added * Hover tool tip actually works now * Light mode support * api and frontend now support checkbox functionality in the control panel * Can now process multiple selected hexagons (and button to reset selection) * added buttons * fixed layering bugs * different aspect ratios * fixed scrolling issue * added readme * added readme * added readme * removed redundant comments * Move requirements and adapt instructions * Create LICENSE * Typo * Update path to datasets * Use username and password from env * Typo * Fix env file reading * Typo --------- Co-authored-by: Ingmar <ieissfeldt@geomar.de> Co-authored-by: Ingmar Eissfeldt <eissfeldt.ingmar@gmail.com>
1 parent c3da061 commit 649ddd1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+15167
-15373
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POSTGRES_USER: user
2+
POSTGRES_PASSWORD: password
3+
POSTGRES_DB: db

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules
2+
db-data

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 GEOMAR OD
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# OYSTERS
2+
3+
Visualization of simulated Oyster pathogen dispersal in the North Sea.
4+
5+
## Table of Contents
6+
- [Installation](#installation)
7+
- [Usage](#usage)
8+
- [Configuration](#configuration)
9+
- [License](#license)
10+
11+
## Installation
12+
13+
### Prerequisites
14+
15+
1. Ensure that Docker is installed, e.g., by installing [Docker Desktop](https://docs.docker.com/desktop/setup/install/linux/).
16+
17+
2. Ensure you have a Python installation (e.g. via Micromamba or via the OS). In Ubuntu Linux, you can run
18+
```bash
19+
sudo apt update
20+
sudo apt install -y python3 python3-pip
21+
```
22+
23+
### Getting the app code and starting the app
24+
25+
Make sure the docker engine is running, e.g., through your app browser (the desktop UI can be closed).
26+
27+
```bash
28+
# Clone the repo and change to dir
29+
git clone https://github.com/geomar-od-lagrange/2024_hex_dashboard.git
30+
cd 2024_hex_dashboard
31+
32+
# Start the containers
33+
docker compose build
34+
docker compose up
35+
```
36+
37+
### Fill up the database
38+
39+
```bash
40+
# change to database dir
41+
cd database
42+
pip install -r requirements.txt
43+
44+
# insert the data
45+
python metadata_to_db.py
46+
python geojson_to_db.py
47+
python connectivity_to_db.py # (might take a few minutes)
48+
```
49+
50+
### Using the app
51+
52+
Connect to http://localhost:5173/ in the browser of your choice.
53+
54+
### Shutting down and restarting
55+
56+
Stop the app with:
57+
```bash
58+
# from within the main project directory
59+
docker compose down
60+
```
61+
62+
Apply code changes and restart:
63+
```bash
64+
# from within the main project directory
65+
docker compose build
66+
docker compose up
67+
```
68+
69+
## License
70+
71+
Distributed under the MIT License. See [LICENSE](LICENSE) for more information.
72+
73+
## Credits / Acknowledgements
74+
75+
- See [database/requirements.txt](database/requirements.txt) for used python libraries. Deckgl and maplibre for the frondend.
76+
- Contributors: Ingmar Eissfeldt (@IngmarEissfeldt), Willi Rath (@willirath), Felix Kirch (@felixkirch)

api/._geojsons

194 Bytes
Binary file not shown.

api/._node_modules

194 Bytes
Binary file not shown.

api/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:18-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
RUN npm install
7+
8+
COPY . .
9+
10+
EXPOSE 3000
11+
12+
CMD ["node", "server.js"]
13+

api/mydatabase_dump.sql

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
--
2+
-- PostgreSQL database dump
3+
--
4+
5+
-- Dumped from database version 15.4 (Debian 15.4-1.pgdg110+1)
6+
-- Dumped by pg_dump version 15.4 (Debian 15.4-1.pgdg110+1)
7+
8+
SET statement_timeout = 0;
9+
SET lock_timeout = 0;
10+
SET idle_in_transaction_session_timeout = 0;
11+
SET client_encoding = 'UTF8';
12+
SET standard_conforming_strings = on;
13+
SELECT pg_catalog.set_config('search_path', '', false);
14+
SET check_function_bodies = false;
15+
SET xmloption = content;
16+
SET client_min_messages = warning;
17+
SET row_security = off;
18+
19+
--
20+
-- Name: tiger; Type: SCHEMA; Schema: -; Owner: myuser
21+
--
22+
23+
CREATE SCHEMA tiger;
24+
25+
26+
ALTER SCHEMA tiger OWNER TO myuser;
27+
28+
--
29+
-- Name: tiger_data; Type: SCHEMA; Schema: -; Owner: myuser
30+
--
31+
32+
CREATE SCHEMA tiger_data;
33+
34+
35+
ALTER SCHEMA tiger_data OWNER TO myuser;
36+
37+
--
38+
-- Name: topology; Type: SCHEMA; Schema: -; Owner: myuser
39+
--
40+
41+
CREATE SCHEMA topology;
42+
43+
44+
ALTER SCHEMA topology OWNER TO myuser;
45+
46+
--
47+
-- Name: SCHEMA topology; Type: COMMENT; Schema: -; Owner: myuser
48+
--
49+
50+
COMMENT ON SCHEMA topology IS 'PostGIS Topology schema';
51+
52+
53+
--
54+
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
55+
--
56+
57+
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch WITH SCHEMA public;
58+
59+
60+
--
61+
-- Name: EXTENSION fuzzystrmatch; Type: COMMENT; Schema: -; Owner:
62+
--
63+
64+
COMMENT ON EXTENSION fuzzystrmatch IS 'determine similarities and distance between strings';
65+
66+
67+
--
68+
-- Name: postgis; Type: EXTENSION; Schema: -; Owner: -
69+
--
70+
71+
CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;
72+
73+
74+
--
75+
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner:
76+
--
77+
78+
COMMENT ON EXTENSION postgis IS 'PostGIS geometry and geography spatial types and functions';
79+
80+
81+
--
82+
-- Name: postgis_tiger_geocoder; Type: EXTENSION; Schema: -; Owner: -
83+
--
84+
85+
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder WITH SCHEMA tiger;
86+
87+
88+
--
89+
-- Name: EXTENSION postgis_tiger_geocoder; Type: COMMENT; Schema: -; Owner:
90+
--
91+
92+
COMMENT ON EXTENSION postgis_tiger_geocoder IS 'PostGIS tiger geocoder and reverse geocoder';
93+
94+
95+
--
96+
-- Name: postgis_topology; Type: EXTENSION; Schema: -; Owner: -
97+
--
98+
99+
CREATE EXTENSION IF NOT EXISTS postgis_topology WITH SCHEMA topology;
100+
101+
102+
--
103+
-- Name: EXTENSION postgis_topology; Type: COMMENT; Schema: -; Owner:
104+
--
105+
106+
COMMENT ON EXTENSION postgis_topology IS 'PostGIS topology spatial types and functions';
107+
108+
109+
--
110+
-- Data for Name: spatial_ref_sys; Type: TABLE DATA; Schema: public; Owner: myuser
111+
--
112+
113+
COPY public.spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text) FROM stdin;
114+
\.
115+
116+
117+
--
118+
-- Data for Name: geocode_settings; Type: TABLE DATA; Schema: tiger; Owner: myuser
119+
--
120+
121+
COPY tiger.geocode_settings (name, setting, unit, category, short_desc) FROM stdin;
122+
\.
123+
124+
125+
--
126+
-- Data for Name: pagc_gaz; Type: TABLE DATA; Schema: tiger; Owner: myuser
127+
--
128+
129+
COPY tiger.pagc_gaz (id, seq, word, stdword, token, is_custom) FROM stdin;
130+
\.
131+
132+
133+
--
134+
-- Data for Name: pagc_lex; Type: TABLE DATA; Schema: tiger; Owner: myuser
135+
--
136+
137+
COPY tiger.pagc_lex (id, seq, word, stdword, token, is_custom) FROM stdin;
138+
\.
139+
140+
141+
--
142+
-- Data for Name: pagc_rules; Type: TABLE DATA; Schema: tiger; Owner: myuser
143+
--
144+
145+
COPY tiger.pagc_rules (id, rule, is_custom) FROM stdin;
146+
\.
147+
148+
149+
--
150+
-- Data for Name: topology; Type: TABLE DATA; Schema: topology; Owner: myuser
151+
--
152+
153+
COPY topology.topology (id, name, srid, "precision", hasz) FROM stdin;
154+
\.
155+
156+
157+
--
158+
-- Data for Name: layer; Type: TABLE DATA; Schema: topology; Owner: myuser
159+
--
160+
161+
COPY topology.layer (topology_id, layer_id, schema_name, table_name, feature_column, feature_type, level, child_id) FROM stdin;
162+
\.
163+
164+
165+
--
166+
-- Name: topology_id_seq; Type: SEQUENCE SET; Schema: topology; Owner: myuser
167+
--
168+
169+
SELECT pg_catalog.setval('topology.topology_id_seq', 1, false);
170+
171+
172+
--
173+
-- PostgreSQL database dump complete
174+
--
175+

0 commit comments

Comments
 (0)