Skip to content

Commit 3389cb5

Browse files
committed
init
0 parents  commit 3389cb5

18 files changed

+1939
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Eodash v5 Configuration and Deployment Template
2+
This is a template repository for configuring and deploying [eodash-v5](https://github.com/EOX-A/eodash-v5)
3+
4+
## Prerequisites
5+
* Docker
6+
* Node v18 or higher
7+
8+
## Get Started
9+
1. Create your own brand repository from this template. See [creating a repository from a template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template).
10+
11+
2. Install the required dependencies after cloning or downloading your repo:
12+
```bash
13+
npm run install
14+
```
15+
16+
3. Customize the configurations in `config.js`. check out the [docs](https://github.com/EOX-A/eodash-v5/blob/remodel/docs/interfaces/EodashConfig.md) to learn more.
17+
18+
4. Build the docker image:
19+
```bash
20+
docker build -t="my-brand" .
21+
```
22+
23+
5. Run the docker image:
24+
```bash
25+
docker run -p="8080:8080" my-brand
26+
```
27+
6. Once everything has started up, you should be able to access the dashboard via [http://localhost:8080/](http://localhost:8080/) on your host machine.
28+
```bash
29+
open http://localhost:8080/
30+
```
31+
32+
## Static Assets
33+
files and directories inside the `public` directory will be served statically in the application. They can be refrenced inside the config using their relative path:
34+
```js
35+
new URL('/directory/file',import.meta.url).href
36+
```

config.js

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
const { currentUrl, mapInstace } = window.eodashStore.states
2+
const stacStore = window.eodashStore.stac.useSTAcStore()
3+
4+
export default {
5+
id: 'template-id',
6+
stacEndpoint: 'https://eurodatacube.github.io/eodash-catalog/RACE/catalog.json',
7+
routes: [{ title: 'External', to: 'https://google.com' }, { title: 'Welcome', to: '/' }],
8+
brand: {
9+
font: {
10+
family: "Poppins",
11+
},
12+
name: "Dashboard",
13+
shortName: 'dashboard',
14+
logo: new URL('/logo.png', import.meta.url).href,
15+
theme: {
16+
colors: {
17+
primary: '#880808',
18+
secondary: "#AA4A44",
19+
background: '#d3d3d3',
20+
surface: "#d3d3d3"
21+
}
22+
}
23+
},
24+
template: {
25+
background: {
26+
module: {
27+
src: new URL('/wms-layer-images/index.html', import.meta.url).href,
28+
},
29+
type: 'iframe'
30+
},
31+
modules: [
32+
{
33+
title: "container",
34+
layout: { "x": 0, "y": 0, "w": 3, "h": 8 },
35+
module: {
36+
name: 'ModulesContainer',
37+
props: {
38+
modules: [
39+
{
40+
title: 'Reset Map Zoom',
41+
module: {
42+
link: new URL('/reset-zoom-btn/ResetZoom.LvPDZn5n.js', import.meta.url).href,
43+
properties: {
44+
to: 4,
45+
map: mapInstace
46+
},
47+
tagName: 'reset-zoom-btn'
48+
},
49+
type: 'web-component'
50+
},
51+
{
52+
title: 'Information',
53+
module: {
54+
link: '@eox/stacinfo',
55+
node_module: true,
56+
properties: {
57+
for: currentUrl,
58+
allowHtml: "true",
59+
styleOverride: "#properties li > .value {font-weight: normal !important;}",
60+
header: "[]",
61+
subheader: "[]",
62+
properties: '["description"]',
63+
featured: "[]",
64+
footer: "[]"
65+
},
66+
tagName: 'eox-stacinfo'
67+
},
68+
type: 'web-component'
69+
}
70+
]
71+
}
72+
},
73+
type: 'internal'
74+
},
75+
{
76+
title: 'Tools',
77+
layout: { "x": 9, "y": 0, "w": 3, "h": 12 },
78+
module: {
79+
link: '@eox/itemfilter',
80+
node_module: true,
81+
properties: {
82+
config: {
83+
onSelect:async (item)=>{
84+
await stacStore.loadSelectedSTAC(item.href)
85+
},
86+
titleProperty: "title",
87+
filterProperties: [
88+
{
89+
keys: ["title", "themes"],
90+
title: "Search",
91+
type: "text",
92+
expanded: true,
93+
},
94+
{
95+
key: "themes",
96+
title: "Theme",
97+
type: "multiselect",
98+
featured: true
99+
},
100+
],
101+
aggregateResults: "themes",
102+
enableHighlighting: true,
103+
}
104+
},
105+
onMounted: async (el, store) => {
106+
el.apply(store?.stac);
107+
},
108+
tagName: 'eox-itemfilter'
109+
},
110+
type: 'web-component'
111+
},
112+
{
113+
title: 'Map',
114+
layout: { "x": 0, "y": 8, "w": 5, "h": 4 },
115+
module: {
116+
name: 'Map',
117+
},
118+
type: 'internal'
119+
},
120+
{
121+
title: 'Reset Map Zoom',
122+
layout: { "x": 5, "y": 10, "w": 4, "h": 2 },
123+
module: {
124+
link: new URL('/reset-zoom-btn/ResetZoom.LvPDZn5n.js', import.meta.url).href,
125+
properties: {
126+
to: 4,
127+
map: mapInstace
128+
},
129+
tagName: 'reset-zoom-btn'
130+
},
131+
type: 'web-component'
132+
},
133+
]
134+
}
135+
}

dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM node:lts-alpine as app
2+
3+
ADD . ./app
4+
WORKDIR /app
5+
RUN npm install
6+
7+
WORKDIR /app/node_modules/eodash-v5
8+
9+
RUN \
10+
npm i \
11+
&& npm run build
12+
13+
FROM node:lts-alpine
14+
WORKDIR /app
15+
COPY --from=app /app/node_modules/eodash-v5/dist .
16+
17+
# install simple http server for serving static content
18+
RUN npm install -g http-server
19+
20+
ADD ./config.js .
21+
ADD ./public .
22+
23+
CMD ["http-server", "-p8080","--proxy","http://localhost:8080?"]
24+
EXPOSE 8080

0 commit comments

Comments
 (0)