Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #295

Merged
merged 13 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .env.example

This file was deleted.

8 changes: 0 additions & 8 deletions .gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions Aptfile

This file was deleted.

105 changes: 0 additions & 105 deletions DEVELOPING.md

This file was deleted.

11 changes: 0 additions & 11 deletions Pipfile

This file was deleted.

3 changes: 0 additions & 3 deletions Procfile

This file was deleted.

66 changes: 64 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
# geovistory
# Geovistory Toolbox

[![LoopBack](https://github.com/strongloop/loopback-next/raw/master/docs/site/imgs/branding/Powered-by-LoopBack-Badge-(blue)[email protected])](http://loopback.io/)
The Virtual Research Environment of the Geovistory Ecosystem.

## Project Layout

This is a monorepo for server and client of the toolbox.

- `/server` contains all server code (node.js / LoopBack)
- `/client` contains all client code (angular)

## Development

### Setup the dev stack

Developing the toolbox server and client requires external components.
These are packed into a docker-compose file in the GitHub repo geovistory/dev-stack.

Requirements:

- Docker (and docker-compose) installed.
- 10 GB RAM for docker
- 4 CPUs for docker
- 100 GB disk space for docker

Donwload the stack:

```bash
git clone https://github.com/geovistory/dev-stack.git
```

Change the directory:

```bash
cd dev-stack
```

Start the stack (using docker-compose under the hood)

```bash
bash scripts/build
```

See more on https://github.com/geovistory/dev-stack.

### Client Development

To develop the toolbox client, we need to set two env vars to match the URLs
of the dev stack.

- API_URL: The URL of the toolbox server api (for development usually hosted by dev-stack).
- ASSETS_URL: The URL of the server hosting the front-end assets (for development usually hosted by angular dev-server).

By default, the URLs in client/.env.example match the dev-stack and angular dev-server default configuration.

If you did not change the defaults, run:

```bash
cd client
npm run serve
```

This will copy the .env.example to .env and create the correct env.js in the angular app.

If you need to modify the API_URL or ASSETS_URL, edit the gitignored client/.env file.
35 changes: 0 additions & 35 deletions app.json

This file was deleted.

5 changes: 5 additions & 0 deletions client/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# URL of toolbox server api
API_URL=http://localhost:1130

# URL of server hosting angular assets
ASSETS_URL=http://localhost:4200
8 changes: 6 additions & 2 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
report.*json
documentation
# environment
.env
/projects/app-toolbox/src/assets/env.js

# Dependency directories
node_modules/

# Auto generated
src/__tests__/helpers/data/auto-gen/*
dist/
report.*json
documentation
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"scripts": {
"ng": "node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng",
"preserve": "node ./scripts/check-version.js",
"preserve": "node ./scripts/preserve.js",
"serve": "node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng serve",
"start": "ng serve",
"build:libs": "sh ./scripts/ng-build-libs.sh",
Expand Down Expand Up @@ -129,4 +129,4 @@
"typescript": "~4.2.4",
"typings-quill-delta": "0.0.2"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export class EntityPreviewComponent implements OnInit, OnDestroy {
.pipe(takeUntil(this.destroy$))
.subscribe(preview => {
this.preview = preview
this.urls = [...getUrls(preview.entity_label)]
// extract urls from string
this.urls = typeof preview.entity_label === 'string' ? [...getUrls(preview.entity_label)] : []
this.ref.detectChanges()
})
}
Expand Down
9 changes: 0 additions & 9 deletions client/projects/app-toolbox/src/assets/env.js

This file was deleted.

8 changes: 0 additions & 8 deletions client/scripts/check-version.js

This file was deleted.

2 changes: 2 additions & 0 deletions client/scripts/preserve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require("./validate-node-version");
require("./setup-env");
Loading
Loading