Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
e0b8fbc
Node init
vertrox78 Nov 12, 2025
ff72c8d
Basic Crawling of STAC Index API
Mammutor Nov 12, 2025
30530da
feat: every object in the stac index, will be converted to an dynamic…
Mammutor Nov 12, 2025
eb0c8fd
added crawling to collection level, including nested catalogs
vertrox78 Nov 18, 2025
69b9ebb
Closes #55; added crawling to collection level, including nested cata…
vertrox78 Nov 18, 2025
65c6cad
Merge branch 'dev-crawler' of https://github.com/SpatioCore/STAC-Atla…
vertrox78 Nov 18, 2025
eaea3e0
feat: implement database connection with node pg for catalog management
LennKru Nov 19, 2025
62ab362
Merge remote-tracking branch 'origin/dev-crawler' into dev-crawler-Lenn
LennKru Nov 19, 2025
dda02f2
closes #53, set up docker for the crawler component
vertrox78 Nov 19, 2025
b3e289f
fixes #55, restructured the crawler component into catalog and api cr…
vertrox78 Nov 19, 2025
4be5bc8
feat: add dotenv for environment variable management and improved dat…
LennKru Nov 19, 2025
427b299
Merge remote-tracking branch 'origin/dev-crawler' into dev-crawler-Lenn
LennKru Nov 19, 2025
cc32162
deleted .env
LennKru Nov 19, 2025
88f4bcc
updated crawling with use uf stac-js
vertrox78 Nov 19, 2025
e15fcae
feat: basic api crawling
Mammutor Nov 20, 2025
fa5fdae
implements #76, stac api validation for catalog crawling
vertrox78 Nov 24, 2025
b611ef4
fix: updated crawler project to be ESM compliant
Mammutor Nov 24, 2025
9fc2900
refactor: improve catalog handling in crawler by restructuring catalo…
Mammutor Nov 25, 2025
ad9a440
feat: enhance database operations:
LennKru Nov 25, 2025
d0691ba
fix: adjust API crawling limit to include all found APIs instead of t…
Mammutor Nov 25, 2025
3c37635
updated pghost
LennKru Nov 26, 2025
f1f3e7b
feat: changed database connection configuration and add insertStacExt…
LennKru Nov 26, 2025
54a231c
removed the api valication #76
vertrox78 Nov 26, 2025
41a346c
Merge branch 'dev-crawler' of https://github.com/SpatioCore/STAC-Atla…
vertrox78 Nov 26, 2025
c9852fe
feat: implement helper functions for inserting STAC extensions, summ…
LennKru Nov 26, 2025
babb97d
Merge branch 'dev-crawler' into dev-crawler-Lenn
Mammutor Nov 26, 2025
239b5aa
feat: enhance crawler configuration with CLI and environment variable…
vertrox78 Nov 26, 2025
5826775
Merge pull request #156 from SpatioCore/dev-crawler-Lenn
Mammutor Nov 26, 2025
218a409
Merge branch 'dev-crawler' into dev-crawler-jakob
Mammutor Nov 26, 2025
b0825c6
Merge pull request #158 from SpatioCore/dev-crawler-jakob
Mammutor Nov 26, 2025
2c58b9c
Merge remote-tracking branch 'origin/dev' into dev-crawler
Mammutor Nov 26, 2025
4b818c7
feat: functions to save crawled catalogs, collections and apis in the…
LennKru Nov 27, 2025
6c47638
#154, refactored the crawler to use crawlee Framework, improved perfo…
vertrox78 Nov 28, 2025
fdb0cad
#53,example environment configuration file for database and crawler s…
vertrox78 Nov 28, 2025
243c351
added `.env`
Dec 2, 2025
40422c9
added environment for docker-compose.yml
Dec 2, 2025
b02ad17
added description of how to use the `.env` and `example.env` in the `…
SonkeHoffmann Dec 2, 2025
9005ccc
changed a few things
SonkeHoffmann Dec 2, 2025
eee44db
now, everthing should be done.
SonkeHoffmann Dec 2, 2025
aecce7e
layout issues fixed
SonkeHoffmann Dec 2, 2025
7a885ce
Fixed Typo/incomplete Sentence in README.md
RobinGummels Dec 2, 2025
14a6013
converted to es modules, added --no-db mode for debugging and moved c…
vertrox78 Dec 3, 2025
7b7e969
Update .env.example
vertrox78 Dec 3, 2025
72c4f40
Merge pull request #163 from SpatioCore/dev-crawler-jakob
Mammutor Dec 3, 2025
9c01cd8
Merge branch 'dev-crawler' into dev-crawler-Lenn
LennKru Dec 3, 2025
f1f3250
Merge pull request #166 from SpatioCore/dev-crawler-Lenn
Mammutor Dec 3, 2025
86aaacd
Refactor database interactions by moving db helper to utils and imple…
Mammutor Dec 3, 2025
4ac00b0
Merge pull request #168 from SpatioCore/dev-crawler-humam-fixDB
LennKru Dec 3, 2025
166ff8b
#176, fixed logic for max apis, fixed double db init
vertrox78 Dec 3, 2025
a7411ff
#167, fixed logic for max apis, fixed double db init
vertrox78 Dec 3, 2025
c997896
#153, refactor: update API crawling logic to use Crawlee and enhance …
vertrox78 Dec 3, 2025
67a027a
Merge branch 'dev-crawler-jakob' of https://github.com/SpatioCore/STA…
vertrox78 Dec 3, 2025
4103394
Update .gitignore and enhance catalog/collection database handling
LennKru Dec 3, 2025
6429285
psst
vertrox78 Dec 3, 2025
0b47037
Merge pull request #169 from SpatioCore/dev-crawler-jakob
Mammutor Dec 3, 2025
b82b180
Update .gitignore and enhance catalog/collection database handling
LennKru Dec 3, 2025
5f8f03e
Merge branch 'dev-crawler-Lenn' of github.com:SpatioCore/STAC-Atlas i…
Mammutor Dec 3, 2025
29e155d
Merge pull request #171 from SpatioCore/dev-crawler-Lenn
Mammutor Dec 3, 2025
a4ed54f
added `stac_id` for collections
SonkeHoffmann Dec 4, 2025
0bd589e
all IDs are now written in the newer PostgrSQL standart:
SonkeHoffmann Dec 4, 2025
49dd720
changed `extend` to `extent`.
SonkeHoffmann Dec 4, 2025
5f017a9
Scheduling and time logic for recrawling (#190)
vertrox78 Dec 10, 2025
f890e93
Merge branch 'dev' into dev-database
SonkeHoffmann Dec 13, 2025
0b396e3
Changed language used in `./api/README.md` from german to english.
RobinGummels Dec 14, 2025
eb6d088
fix: time utility was missing and improved main module check logic (#…
Mammutor Jan 1, 2026
9e9bc30
added triggering function for an auto-update search_vector, both for …
Jan 3, 2026
6a8e6c3
Merge branch 'dev' into dev-database
SonkeHoffmann Jan 3, 2026
b7d51a2
changed the CI-Pipeline.
Jan 3, 2026
1e335db
A quick cleanup and fix for the crawler to work for docker (#210)
Mammutor Jan 7, 2026
24f6cb5
bug fix: extent was written wrong (#212)
LennKru Jan 7, 2026
cc60a7c
refactor(api): simplify collections link handling in STAC API root fu…
Mammutor Jan 8, 2026
08b398d
chore(crawler): comment out restart policy in docker-compose.yml
Mammutor Jan 8, 2026
e095d0a
fix(crawler): update .env.example and normalize base URL handling
Mammutor Jan 8, 2026
c65c348
added different users for the api and crawler groups.
Jan 10, 2026
e0b2543
chore(db): update docker-compose.yml for network configuration
Mammutor Jan 11, 2026
ef37617
Refactor(database): SQL trigger definitions for catalog and collectio…
Mammutor Jan 11, 2026
d140405
feat(crawler): implement collection flushing to database
Mammutor Jan 11, 2026
77728a7
Merge pull request #217 from SpatioCore/dev-database-humam
SonkeHoffmann Jan 11, 2026
8674091
added source_url for collections and catalogs. Now the full_json does…
Jan 11, 2026
a1269d4
Merge branch 'dev' into dev-database
SonkeHoffmann Jan 11, 2026
20d8fd2
resolved a Problem I had with git by hand cause I didn't found the fu…
Jan 11, 2026
81bd246
feat(crawler): enhance concurrency and storage configuration for craw…
Mammutor Jan 13, 2026
a5a3b78
Merge pull request #219 from SpatioCore/dev-crawler-humam
vertrox78 Jan 14, 2026
3ba13a9
feat(crawler): implement max depth configuration and batch flushing f…
Mammutor Jan 14, 2026
dea62a7
Merge branch 'dev-crawler' into dev-crawler-humam
Mammutor Jan 14, 2026
44b986a
Crawler: implemented rate limiting, and implements some bug fixes (#211)
vertrox78 Jan 14, 2026
fcbac8b
to be stac conform the stac_id is not allowed to throw an error when …
Jan 14, 2026
664aaa8
Merge branch 'dev-crawler' into dev-crawler-humam
Mammutor Jan 14, 2026
62d7cc7
Merge pull request #238 from SpatioCore/dev-crawler-humam
vertrox78 Jan 14, 2026
2782266
Merge branch 'dev' into dev-crawler
Mammutor Jan 14, 2026
df81112
merge from dev to dev-crawler-humam and now to dev-crawler (#243)
Mammutor Jan 15, 2026
27507ed
Refactor: crawler configuration and memory management
Mammutor Jan 15, 2026
e5f6e33
Crawler added source_url to collection_summaries and changed stac_id,…
LennKru Jan 15, 2026
7c28bdc
Merge branch 'dev-crawler' into dev-crawler-humam
Mammutor Jan 16, 2026
c5b2e8f
Enhance memory management in API and handlers
Mammutor Jan 16, 2026
9a26ae0
Refactor database operations in insertOrUpdateCollection and insertSu…
Mammutor Jan 18, 2026
700f840
Merge branch 'dev' into dev-crawler
RobinGummels Jan 19, 2026
8e9d504
Delete .env.example in root
Mammutor Jan 19, 2026
fde14d7
Merge pull request #251 from SpatioCore/Mammutor-patch-2
vertrox78 Jan 19, 2026
77018aa
Merge pull request #250 from SpatioCore/dev-crawler-humam
vertrox78 Jan 19, 2026
70004cb
fix(crawler-db): Enhance collection extent handling in insertOrUpdate…
Mammutor Jan 20, 2026
f53d2e7
fix(crawler-api): update STAC object creation to disable URL migration
Mammutor Jan 20, 2026
23be843
fix(crawler-api): add defensive JSON validation in API and catalog ha…
Mammutor Jan 20, 2026
3ab484c
chore(crawler): update Node.js version in Dockerfile to 20-alpine
Mammutor Jan 20, 2026
c8aec56
fix(crawler): enhance JSON parsing in API and catalog request handlers
Mammutor Jan 20, 2026
392b0e9
fix(crawler): add S3 URL handling and relative URL conversion in API …
Mammutor Jan 20, 2026
5ee15b6
fix(crawler): update Dockerfile to omit development dependencies duri…
Mammutor Jan 20, 2026
ef3c498
feat(crawler): implement parallel crawling for APIs and catalogs
Mammutor Jan 21, 2026
14ff676
fix(crawler): enhance normalization of collection metadata extraction
Mammutor Jan 21, 2026
7357089
fix(crawler): enhance normalization of collection to include addition…
Mammutor Jan 21, 2026
c48840c
fix(crawler): increase max concurrency for improved throughput in API…
Mammutor Jan 21, 2026
657bd0a
fix(crawler): optimize concurrency settings for API and catalog crawlers
Mammutor Jan 21, 2026
edbf614
refactor(crawler): streamline concurrency settings in API and catalog…
Mammutor Jan 21, 2026
9cd68c6
fix(crawler): correct spatial extent format in database insertion
Mammutor Jan 21, 2026
e140246
feat(crawler): add deadlock handling and retry logic for database col…
Mammutor Jan 21, 2026
9fe7298
refactor(crawler): optimize batch sizes and memory management for low…
Mammutor Jan 21, 2026
048183d
Merge pull request #254 from SpatioCore/dev-crawler-humam
vertrox78 Jan 21, 2026
890e35e
feat(crawler): integrate global statistics tracking for enhanced metrics
Mammutor Jan 21, 2026
1e6c134
feat(crawler): enhance storage management and logging for API and cat…
Mammutor Jan 21, 2026
6afe0f1
refactor(crawler): optimize memory management and request limits for …
Mammutor Jan 22, 2026
f17ae3e
refactor(crawler): adjust batch sizes and request limits for improved…
Mammutor Jan 22, 2026
2cd58b8
refactor(crawler): enhance API and catalog handling with full object …
Mammutor Jan 27, 2026
3b7a6d7
feat(crawler): implement catalog insertion and update functionality i…
Mammutor Jan 27, 2026
15f4be0
feat(crawler): preserve original STAC JSON during normalization and s…
Mammutor Jan 27, 2026
f12e261
refactor(crawler): update database insertion logic to include source_url
Mammutor Jan 27, 2026
72b0168
feat(crawler): enhance source URL handling in collection processing
Mammutor Jan 27, 2026
80684c0
refactor(crawler): update catalog and collection insertion logic to s…
Mammutor Jan 27, 2026
1d3a3df
feat(crawler): improve STAC type determination in normalization process
Mammutor Jan 27, 2026
ce8fc87
Database: Docker config for using the same network, STAC_ID now uniqu…
Mammutor Jan 27, 2026
e44d3ef
Merge branch 'dev' into dev-database
Mammutor Jan 27, 2026
b749125
Merge pull request #261 from SpatioCore/dev-crawler-humam
vertrox78 Jan 28, 2026
d6ad7fc
#241, Add unit tests for normalization and parallel execution utiliti…
vertrox78 Jan 28, 2026
fd1d2bc
type is no longer needes, since we only need to save collections
Jan 28, 2026
e38f77d
added is_valid. So we can save every collection be can also be stac_c…
Jan 28, 2026
9be2c18
#270, added stac node validation for static catalogs from stac indedx…
vertrox78 Jan 28, 2026
dfc0c06
skip database save for catalogs (#272)
LennKru Jan 28, 2026
de873b1
Database: Added source_url in crawllog (#274)
Mammutor Jan 28, 2026
1551fbc
Crawler: is_API=true wenn das gecrawlte eine api ist (#278)
LennKru Jan 31, 2026
7a25e89
changed the whole structure of the catalogs. Now the catalogs can be …
Jan 31, 2026
724634e
We asked Mohr on the handling with valid and unvalid collection. We d…
Jan 31, 2026
e63b89d
Merge branch 'dev-crawler' into dev-database
SonkeHoffmann Jan 31, 2026
0802b00
the reference for the crawllog_collections weren't right
Jan 31, 2026
731f9d9
Dev database: changed catalog handling (#280)
SonkeHoffmann Jan 31, 2026
4730c4c
removing duplicate networks
Mammutor Jan 31, 2026
6ae3942
I hate SQL
Jan 31, 2026
de6d974
I acciddently deleted keywords and extentions, now they are back
Jan 31, 2026
2429d23
Merge branch 'dev-crawler' into dev-database
SonkeHoffmann Jan 31, 2026
f878352
added ER-Diagramm to explain the database structure
Jan 31, 2026
74f96c7
updated the README to the newest stand
Jan 31, 2026
c83fb72
added explaniation why the migration folder is empty and explained ho…
Jan 31, 2026
dca10f7
Merge branch 'dev' into dev-database
SonkeHoffmann Jan 31, 2026
c40ee75
Merge branch 'dev' into dev-database
Mammutor Feb 2, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
5 changes: 3 additions & 2 deletions bid.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,11 @@ Protokolliert die Zeitpunkte der letzten Crawling-Vorgänge für jeden Katalog.
| Spalte | Beschreibung / Inhalt | Datentyp / Format |
|---------------|------------------------------------------|-------------------|
| **id** | Eindeutige ID des Crawlvorgangs | integer (PK) |
| collection_id | Referenz auf `collection.id` | integer (FK) |
| collection_id | Referenz auf `collection.id` (optional) | integer (FK) |
| source_url | Quell-URL der Collection | text |
| last_crawled | Zeitpunkt des letzten Crawls | timestamp |

Analog zur vorherigen Tabelle dient `crawllog_collection` der Nachverfolgung der Crawling-Zyklen für Collections.
Protokolliert die Zeitpunkte der letzten Crawling-Vorgänge für jede Collection. Falls die Collection noch nicht in der `collection`-Tabelle existiert, kann sie über die `source_url` identifiziert werden.

---

Expand Down
5 changes: 5 additions & 0 deletions crawler/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
npm-debug.log
.git
.gitignore
*.md
22 changes: 22 additions & 0 deletions crawler/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# STAC Crawler Configuration
# Copy this file to .env and adjust values as needed

# URI of the Postgres/PostGis Host
PGHOST=example_db_URL
# Postgres/PostGis Port
PGPORT=5432
# Postgres/PostGis user
PGUSER=example_user
# Postgres/PostGis password
PGPASSWORD=example_password
# Postgres/PostGis databse
PGDATABASE=example_db

# 'catalogs', 'apis', or 'both'
CRAWL_MODE=both
# Maximum Static Catalogs that are crawled (0 ist unlimited)
MAX_CATALOGS=0
# Maximum API Catalogs that are crawled (0 ist unlimited)
MAX_APIS=0
# Timeout of connection of crawler
TIMEOUT_MS=30000
2 changes: 1 addition & 1 deletion crawler/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.env
node_modules
storage
storage
17 changes: 17 additions & 0 deletions crawler/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Use official Node.js LTS image
FROM node:20-alpine

# Set working directory
WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm install --omit=dev

# Copy application files
COPY . .

# Run the crawler
CMD ["node", "index.js"]
193 changes: 193 additions & 0 deletions crawler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
# STAC Crawler

A Node.js crawler for STAC Index API that fetches and processes catalog and collection data with configurable options.

## Configuration

The crawler can be configured using environment variables, CLI arguments, or a combination of both. CLI arguments take precedence over environment variables.

### Configuration Options

| Option | CLI Flag | Environment Variable | Default | Description |
|--------|----------|---------------------|---------|-------------|
| Mode | `-m, --mode` | `CRAWL_MODE` | `both` | Crawl mode: `catalogs`, `apis`, or `both` |
| Max Catalogs | `-c, --max-catalogs` | `MAX_CATALOGS` | `10` | Maximum number of catalogs to process |
| Max APIs | `-a, --max-apis` | `MAX_APIS` | `5` | Maximum number of APIs to process |
| Timeout | `-t, --timeout` | `TIMEOUT_MS` | `30000` | Timeout per operation in milliseconds |
| Max Depth | `-d, --max-depth` | `MAX_DEPTH` | `3` | Maximum recursion depth for nested catalogs |

### Using Environment Variables

1. Copy the example environment file:
```bash
cp .env.example .env
```

2. Edit `.env` to customize settings:
```bash
CRAWL_MODE=both
MAX_CATALOGS=20
MAX_APIS=10
TIMEOUT_MS=60000
MAX_DEPTH=5
```

3. Run the crawler:
```bash
npm start
```

### Using CLI Arguments

Run the crawler with command-line arguments to override defaults or environment variables:

```bash
# Crawl only catalogs with custom limits
node index.js --mode catalogs --max-catalogs 20

# Crawl only APIs with extended timeout
node index.js -m apis -a 10 -t 60000

# Crawl both with all custom settings
node index.js -m both -c 50 -a 20 -t 45000 -d 5
```

### Show Help

Display all available options:

```bash
node index.js --help
```

## Running Locally

```bash
# Install dependencies
npm install

# Run with default configuration
npm start

# Run with custom configuration
node index.js --mode catalogs --max-catalogs 15
```

## Docker

### Build and run with Docker

```bash
# Build the image
docker build -t stac-crawler .

# Run with default configuration
docker run --rm stac-crawler

# Run with environment variables
docker run --rm -e CRAWL_MODE=apis -e MAX_APIS=10 stac-crawler

# Run with CLI arguments
docker run --rm stac-crawler --mode catalogs --max-catalogs 20
```

Or use npm scripts:

```bash
npm run docker:build
npm run docker:run
```

### Using Docker Compose

Create a `.env` file or modify `docker-compose.yml` to set environment variables:

```bash
# Start the crawler
docker-compose up -d

# View logs
docker-compose logs -f

# Stop the crawler
docker-compose down
```

Or use npm scripts:

```bash
npm run docker:compose:up
npm run docker:compose:down
```

## Testing

### Running Tests

Run the complete test suite:
```bash
npm test
```

Run tests in watch mode during development:
```bash
npm run test:watch
```

Run tests with coverage report:
```bash
npm test -- --coverage
```

### Test Structure

The test suite covers utility functions with **110 tests** across three modules:

- **`normalization.test.js`** (46 tests) - Tests for catalog and collection normalization
- Coverage: 91% statements, 92% branches
- Tests `deriveCategories()`, `normalizeCatalog()`, `normalizeCollection()`, `processCatalogs()`

- **`parallel.test.js`** (53 tests) - Tests for parallel execution utilities
- Coverage: 100% statements, 100% branches
- Tests `getDomain()`, `groupByDomain()`, `createDomainBatches()`, `aggregateStats()`, `executeWithConcurrency()`, `calculateRateLimits()`, `logDomainStats()`

- **`api.test.js`** (29 tests) - Tests for API crawling utilities
- Tests batch management, URL validation, STAC API response structures
- Uses real STAC API endpoints (Microsoft Planetary Computer, Element 84, USGS, NASA CMR)

All tests use **real STAC domain names and collection IDs** from production STAC APIs for realistic testing.

## Examples

### Example 1: Quick API Test
Crawl only the first 3 APIs with a short timeout:
```bash
node index.js -m apis -a 3 -t 15000
```

### Example 2: Deep Catalog Exploration
Crawl 100 catalogs with maximum depth and extended timeout:
```bash
node index.js -m catalogs -c 100 -d 10 -t 120000
```

### Example 3: Balanced Crawl
Crawl both catalogs and APIs with moderate settings:
```bash
node index.js -m both -c 25 -a 15 -t 45000 -d 4
```

### Example 4: Production Environment
Set up `.env` for production:
```bash
CRAWL_MODE=both
MAX_CATALOGS=1000
MAX_APIS=500
TIMEOUT_MS=60000
MAX_DEPTH=5
```

Then run:
```bash
npm start
```
Loading
Loading