Skip to content

Commit

Permalink
Merge branch 'main' into github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Oct 16, 2024
2 parents 62be473 + 55f5fae commit 76ee6a8
Show file tree
Hide file tree
Showing 94 changed files with 24,333 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.idea
helm/Chart.lock
.DS_STORE
.DS_Store
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# polder
Web AOI viewer

## Installation

This application needs a kubernetes cluster. Once you have one set up you can `helm install` with the following steps:

0. `eoapi-k8s` depends on the [Crunchydata Postgresql Operator](https://access.crunchydata.com/documentation/postgres-operator/latest/installation/helm). Install that first:

```bash
helm install --set disable_check_for_upgrades=true pgo oci://registry.developers.crunchydata.com/crunchydata/pgo --version 5.5.2
```

1. Add the eoapi repo from https://devseed.com/eoapi-k8s/:

```bash
helm repo add eoapi https://devseed.com/eoapi-k8s/
```

2. Include dependencies

```bash
helm dependency build
```

2. Then go to the `helm` directory and do `helm install`

```bash
cd helm && helm install -n polder --create-namespace polder .
```
21 changes: 21 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v2
name: polder
description: Create a polder - Web AOI viewer - instance.
type: application
kubeVersion: ">=1.23.0-0"

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: "0.0.1"

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.1"

dependencies:
- name: eoapi
version: 0.4.17
repository: "https://devseed.com/eoapi-k8s/"
Binary file added helm/charts/eoapi-0.4.17.tgz
Binary file not shown.
39 changes: 39 additions & 0 deletions helm/templates/Webapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.service.name }}
labels:
app: {{ .Values.service.name }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ .Values.service.name }}
template:
metadata:
labels:
app: {{ .Values.service.name }}
spec:
containers:
- name: nginx
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: 80
resources:
{{- toYaml .Values.resources | nindent 12 }}

---

apiVersion: v1
kind: Service
metadata:
name: {{ .Values.service.name }}
labels:
app: {{ .Values.service.name }}
spec:
type: {{ .Values.service.type }}
ports:
- port: 8081
targetPort: 80
selector:
app: {{ .Values.service.name }}
19 changes: 19 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
replicaCount: 1

image:
repository: nginx
pullPolicy: IfNotPresent
tag: "1.27.2"

service:
enabled: true
name: polder-webapp
type: NodePort
ports:
- port: 8081
targetPort: 80
nodePort: 30001
selector:
app: polder-webapp

resources: {}
8 changes: 8 additions & 0 deletions webapp/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"env": {
"test": {
"presets": ["@babel/preset-react", "@babel/preset-typescript"],
"plugins": ["@babel/plugin-transform-modules-commonjs"]
}
}
}
24 changes: 24 additions & 0 deletions webapp/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js}]
charset = utf-8

# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
11 changes: 11 additions & 0 deletions webapp/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
APP_TITLE=Polder
APP_DESCRIPTION=AOI Monitoring tool

MAPBOX_TOKEN=pk.eyJ1IjoiZGV2c2VlZCIsImEiOiJnUi1mbkVvIn0.018aLhX0Mb0tdtaT2QNe2Q

# If the app is being served in from a subfolder, the domain url must be set.
# For example, if the app is served from /mysite:
# PUBLIC_URL=http://example.com/mysite

STAC_API=https://rx3hna9pbg.execute-api.eu-central-1.amazonaws.com
TILER_API=https://zbrrek3x0i.execute-api.eu-central-1.amazonaws.com
62 changes: 62 additions & 0 deletions webapp/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "react", "react-hooks", "import", "fp"],
"rules": {
"comma-dangle": [2, "never"],
"semi": [2, "always"],
"jsx-quotes": [2, "prefer-single"],
"no-console": 2,
"no-extra-semi": 2,
"semi-spacing": [2, { "before": false, "after": true }],
"no-dupe-else-if": 0,
"no-setter-return": 0,
"prefer-promise-reject-errors": 0,
"import/order": 2,
"react/button-has-type": 2,
"react/jsx-closing-bracket-location": 2,
"react/jsx-closing-tag-location": 2,
"react/jsx-curly-spacing": 2,
"react/jsx-curly-newline": 2,
"react/jsx-equals-spacing": 2,
"react/jsx-max-props-per-line": [2, { "maximum": 1, "when": "multiline" }],
"react/jsx-first-prop-new-line": 2,
"react/jsx-curly-brace-presence": [
2,
{ "props": "never", "children": "never" }
],
"react/jsx-pascal-case": 2,
"react/jsx-props-no-multi-spaces": 2,
"react/jsx-tag-spacing": [2, { "beforeClosing": "never" }],
"react/jsx-wrap-multilines": 2,
"react/no-array-index-key": 2,
"react/no-typos": 2,
"react/no-unsafe": 2,
"react/no-unused-prop-types": 2,
"react/no-unused-state": 2,
"react/self-closing-comp": 2,
"react/sort-comp": 2,
"react/style-prop-object": 2,
"react/void-dom-elements-no-children": 2,
"react/function-component-definition": [
2,
{ "namedComponents": ["function-declaration", "arrow-function"] }
],
"react-hooks/rules-of-hooks": 2, // Checks rules of Hooks
"react-hooks/exhaustive-deps": 1, // Checks effect dependencies
"fp/no-mutating-methods": 1,
"@typescript-eslint/no-explicit-any": 1
}
}
72 changes: 72 additions & 0 deletions webapp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
################################################
############### .gitignore ##################
################################################
#
# This file is only relevant if you are using git.
#
# Files which match the splat patterns below will
# be ignored by git. This keeps random crap and
# and sensitive credentials from being uploaded to
# your repository. It allows you to configure your
# app for your machine without accidentally
# committing settings which will smash the local
# settings of other developers on your team.
#
# Some reasonable defaults are included below,
# but, of course, you should modify/extend/prune
# to fit your needs!
################################################

app/scripts/time.json

node_modules
bower_components
.sass-cache
test/bower_components


################################################
# Node.js / NPM
#
# Common files generated by Node, NPM, and the
# related ecosystem.
################################################

lib-cov
*.seed
*.log
*.out
*.pid
npm-debug.log
yarn-error.log
.parcel-cache


################################################
# Apidocs
#
# Common files generated by apidocs and other docs
################################################


################################################
# Miscellaneous
#
# Common files generated by text editors,
# operating systems, file systems, etc.
################################################

*~
*#
.DS_STORE
.DS_Store
.netbeans
nbproject
.idea
.resources
.node_history
temp
tmp
.tmp
dist
parcel-bundle-reports
1 change: 1 addition & 0 deletions webapp/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
5 changes: 5 additions & 0 deletions webapp/.parcelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": ["@parcel/config-default"],
"reporters": ["...", "@parcel/reporter-bundle-analyzer"],
"resolvers": ["parcel-resolver-ignore", "..."]
}
7 changes: 7 additions & 0 deletions webapp/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "none",
"singleQuote": true,
"jsxSingleQuote": true,
"printWidth": 80
}
Binary file added webapp/.yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions webapp/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
21 changes: 21 additions & 0 deletions webapp/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Development Seed

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 76ee6a8

Please sign in to comment.