Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
111cd74
feat(api): initialize STAC Atlas API with collections, conformance, a…
RobinGummels Nov 11, 2025
73ce26a
adds extensions to the database
SonkeHoffmann Nov 19, 2025
72feedd
adds tables for catalos to the database
SonkeHoffmann Nov 19, 2025
48fc81f
adds tables for collections to the database
SonkeHoffmann Nov 19, 2025
957c7cd
adds tables for relations to the database structure
SonkeHoffmann Nov 19, 2025
ffaf153
added indexes to the database.
SonkeHoffmann Nov 19, 2025
85e429e
Database component is into a docker container. It works!!! Woooohu
Nov 19, 2025
15ea727
Got the final version of the bid
RobinGummels Nov 19, 2025
840619b
fix(api): enhance STAC API landing page and conformance links
RobinGummels Nov 23, 2025
909991d
Merge pull request #112 from SpatioCore/dev-api-robin - Overhaul of t…
RobinGummels Nov 24, 2025
a5ac3b6
updatet the `README.md` for the database component. Added an overall …
Nov 25, 2025
d22a220
added a descripton for the tabels and indexes as requestet by @Mammut…
Nov 25, 2025
a1aed4c
feat(api): implement shared conformance URIs and add tests for confor…
VincentKuehn Nov 26, 2025
f5b78a1
Merge pull request #157 from SpatioCore/dev-api-vincent
RobinGummels Nov 26, 2025
a497644
Update db/README.md
SonkeHoffmann Nov 26, 2025
e77a9ce
Update db/README.md
SonkeHoffmann Nov 26, 2025
eb274d4
Implemented 2.3 and 2.4 (#111)
georgevoulg Nov 26, 2025
4baa62c
Merge pull request #73 from SpatioCore/dev-database
Mammutor Nov 26, 2025
1109674
feat(api): add collection search parameters and validation middleware…
RobinGummels Nov 28, 2025
d375216
API: 3 Database Integration first version (#161)
SonkeHoffmann Nov 30, 2025
4b0c883
added SQLQuery-builder with these parameters: q,bbox,datetime,sortby,…
VincentKuehn Dec 2, 2025
b3e38ad
Added environment variables and a `.env` for `docker-compose.yml` (#164)
SonkeHoffmann Dec 2, 2025
5988a51
finalised bbox and datetime
VincentKuehn Dec 2, 2025
29f0e7e
adapted to DB, QueryBuilder and added helperfunction runQuery
VincentKuehn Dec 2, 2025
34d858a
added question-TODOs
VincentKuehn Dec 2, 2025
eac436e
added bbox+datetime to the Query-Builder from Jonas
VincentKuehn Dec 3, 2025
0a3cc20
added tests for Query-Builder from Jonas
VincentKuehn Dec 3, 2025
a2e7c27
added tests from George
VincentKuehn Dec 3, 2025
5bcb91e
added falsely deleted TODOs again
VincentKuehn Dec 3, 2025
3d1d7c0
fixed collumn names to match our DB and adjusted full text search to …
VincentKuehn Dec 3, 2025
3205f91
Added a CI/CD Pipeline to prevent pull-requests without functioning t…
RobinGummels Dec 3, 2025
37fc8ad
Merge branch 'dev-api' of github.com:SpatioCore/STAC-Atlas into dev-api
RobinGummels Dec 3, 2025
1ed8ff6
fixed errors suggested by the linter.
RobinGummels Dec 3, 2025
c743945
Merge branch 'dev-api' into dev-api-vincent
RobinGummels Dec 3, 2025
0ee45b9
Used a formatter and linter on `buildCollectionSearchQuery.js
RobinGummels Dec 3, 2025
cbac59f
Did some major and minor fixes to the collection search.
RobinGummels Dec 4, 2025
e03680c
Added a internal .env creation in the CI/CD Pipeline. It utilzes GitH…
RobinGummels Dec 4, 2025
96a1674
Forgot that the second Job of the CI/CD pipeline runs seperatly and n…
RobinGummels Dec 4, 2025
45582b1
Enhance documentation for buildCollectionSearchQuery
VincentKuehn Dec 4, 2025
a08f6a5
Refactor buildCollectionSearchQuery and updated SELECT part
VincentKuehn Dec 4, 2025
d01481d
Update api/routes/collections.js
VincentKuehn Dec 4, 2025
21e1caa
Remove sorting TODO from collections route
VincentKuehn Dec 4, 2025
3fc5ff9
Explicitly return undefined for normalized in validateSortby
VincentKuehn Dec 5, 2025
1227b41
small fix in buildCollectionSearch.fulltext.test.js
VincentKuehn Dec 6, 2025
117bf56
Fix duplicate SELECT keyword in query
VincentKuehn Dec 6, 2025
c822c64
Fix missing newline at end of collectionSearchParams.js
VincentKuehn Dec 6, 2025
f611802
Fixed missing bracket in collectionSearchParams.js
VincentKuehn Dec 6, 2025
cc61528
Refactor validateSortby for optional parameter handling
VincentKuehn Dec 6, 2025
939c9ed
Stabilize API test pipeline by running Jest in-band with extended tim…
VincentKuehn Dec 6, 2025
cc7e8ba
Fixed leaking tests that blocked CI/CD-Pipeline.
RobinGummels Dec 7, 2025
77c2639
Did a minimum amount of Formatting to the discription
RobinGummels Dec 7, 2025
5253626
Used `npm audit fix --force` to fix all vulnerabilties in our used pa…
RobinGummels Dec 7, 2025
f17f479
Fixed curious doublechecking for empty Strings for the sortby-Parameter.
RobinGummels Dec 7, 2025
048c031
Update api/routes/collections.js
RobinGummels Dec 7, 2025
e657181
Removed globalTeardown as i brought up some problems corresponding to…
RobinGummels Dec 7, 2025
d31419b
Merge branch 'dev-api-vincent' of github.com:SpatioCore/STAC-Atlas in…
RobinGummels Dec 7, 2025
fe993bc
Implemented Collection Search extension including a DB-Connection (#165)
VincentKuehn Dec 7, 2025
b0b749d
Merge branch 'dev' into dev-api
RobinGummels Dec 7, 2025
5a7af5b
Updated Query-Builder to get all necessary fields from all db_tables …
RobinGummels Dec 9, 2025
ad81140
added validator for collections{id} and correctly implemented collect…
VincentKuehn Dec 9, 2025
84922f7
added test for collections{id}
VincentKuehn Dec 9, 2025
d83eeb4
Update api/.env.example
RobinGummels Dec 9, 2025
0d7cd2b
removed unnecessary parameter
VincentKuehn Dec 9, 2025
03f535a
added id parameter to the Query (temporary fix)
VincentKuehn Dec 9, 2025
8a4ec8c
test-fixes to match our current tests and a fix to the baseURL for co…
VincentKuehn Dec 9, 2025
c548bc2
test fix
VincentKuehn Dec 9, 2025
98498d8
Merge pull request #184 from SpatioCore/dev-api
SonkeHoffmann Dec 10, 2025
3c306db
Merge branch 'dev-api-vincent' of github.com:SpatioCore/STAC-Atlas in…
RobinGummels Dec 10, 2025
1412b40
fixed problem with tests in api.test.js and adjusted the "invalid-id-…
VincentKuehn Dec 10, 2025
1b9c7de
Merge branch 'dev-api-vincent' of github.com:SpatioCore/STAC-Atlas in…
VincentKuehn Dec 10, 2025
fd4b844
Update api/routes/collections.js
RobinGummels Dec 10, 2025
70dc043
Updated Query-Builder to get all necessary fields from all db_tables …
RobinGummels Dec 9, 2025
6e5ab3e
Merge branch 'dev-api-robin' of github.com:SpatioCore/STAC-Atlas into…
RobinGummels Dec 10, 2025
ced405d
added test for negative ids
VincentKuehn Dec 10, 2025
37065f8
Merge branch 'dev-api-vincent' of github.com:SpatioCore/STAC-Atlas in…
VincentKuehn Dec 10, 2025
c59990d
deleted the whole "existing links" part and build base Links
VincentKuehn Dec 10, 2025
e497f49
fixed bug in validateCollectionId.js
VincentKuehn Dec 10, 2025
b811288
Added `openapi.yaml` (now http://localhost:3000/api-docs/ is working).
RobinGummels Dec 10, 2025
b047389
Added discription on how to use `stac-api-validator`. Currently we ar…
RobinGummels Dec 10, 2025
34bf962
Changed API-Version name to 1.1.0 instead of 1.0.0
RobinGummels Dec 14, 2025
138ac3d
latest database Version (#187) with `stac_id` and changed definition…
SonkeHoffmann Dec 14, 2025
a70169d
Merge pull request #185 from SpatioCore/dev-api-robin
SonkeHoffmann Dec 14, 2025
3e23f15
Revert "API is now responding with all necessary fields for each coll…
RobinGummels Dec 14, 2025
f8a5057
Revert "Revert "API is now responding with all necessary fields for e…
RobinGummels Dec 14, 2025
0cc7981
Refactor negative ID test
VincentKuehn Dec 15, 2025
66f4041
Merge branch 'dev-api' into dev-api-vincent
RobinGummels Dec 18, 2025
b73dc34
Implement more Queryable-Fields and add the keywords-field to q fullt…
BrokeJ Dec 22, 2025
e0f1cba
Removed a german comment in `api/routes/collections.js`
RobinGummels Dec 26, 2025
54957b3
Merge branch 'dev-api' into dev-api-vincent
RobinGummels Dec 26, 2025
1d4a434
Implement GET /collections/{id} endpoint with validation and QueryBui…
VincentKuehn Dec 26, 2025
a86d52a
Merge branch 'dev' into dev-api
RobinGummels Dec 26, 2025
557cad4
feat(api): Implement complete CQL2 filtering for Collection Search (#…
RobinGummels Jan 7, 2026
9501896
Add STAC API Validator workflow and enhance collection retrieval logic
VincentKuehn Jan 7, 2026
b07ee04
Implemented structured Error-Handling, Error-Messaging and Error-Logg…
RobinGummels Jan 15, 2026
5e5e7bf
Merged latest changes from 'dev-api' into 'dev-api-vincent' so all te…
RobinGummels Jan 15, 2026
f561f3f
Fixed some tests and added some for the collection-ids
RobinGummels Jan 15, 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
330 changes: 330 additions & 0 deletions .github/workflows/api-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,330 @@
name: API CI/CD Pipeline

# Trigger: At every push or pull request to dev, dev-api or main branches affecting the api/ directory or this workflow file
on:
push:
branches:
- dev-api
- dev
- main
paths:
- 'api/**'
- '.github/workflows/api-ci.yml'
pull_request:
branches:
- dev-api
- dev
- main
paths:
- 'api/**'
- '.github/workflows/api-ci.yml'

jobs:
# Job 1: Build and Test
test:
name: Build & Test
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]

steps:
# Step 1: Checkout Repository
- name: Checkout code
uses: actions/checkout@v4

# Step 2: Setup Node.js
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: api/package-lock.json

# Step 3: Create .env file from secrets
- name: Create .env file
working-directory: api
run: |
cat > .env << EOF
# Server Configuration
PORT=3000
NODE_ENV=test

# Database Configuration
DB_HOST=${{ secrets.DB_HOST }}
DB_PORT=${{ secrets.DB_PORT }}
DB_NAME=${{ secrets.DB_NAME }}
DB_USER=${{ secrets.DB_USER }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
DB_SSL=false

# Connection Pool Configuration
DB_POOL_MAX=20
DB_POOL_MIN=2
DB_IDLE_TIMEOUT=30000
DB_CONNECTION_TIMEOUT=10000

# CORS Configuration
CORS_ORIGIN=*

# API Configuration
API_TITLE=STAC Atlas
API_DESCRIPTION=A centralized platform for managing, indexing, and providing STAC Collection metadata
API_VERSION=1.1.0
EOF

# Step 4: Install dependencies
- name: Install dependencies
run: |
cd api
npm ci

# Step 5: Linting (ESLint)
- name: Run ESLint
run: |
cd api
npm run lint --if-present
continue-on-error: true

# Step 6: Run tests
- name: Run tests
run: |
cd api
# Run Jest in-band (single process) with a higher default test timeout
npm test -- --runInBand --testTimeout=30000

# Step 7: Generate coverage report
- name: Generate coverage report
run: |
cd api
npm test -- --runInBand --testTimeout=30000 --coverage --coverageReporters=text --coverageReporters=lcov
continue-on-error: true

# Step 8: Upload coverage as artifact
- name: Upload coverage reports
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: api/coverage/
retention-days: 30

# Step 9: Upload test results as artifact
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: api/test-results/
retention-days: 30

# Job 2: Validate build
build:
name: Validate Build
runs-on: ubuntu-latest
needs: test

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
cache-dependency-path: api/package-lock.json

- name: Create .env file
working-directory: api
run: |
cat > .env << EOF
# Server Configuration
PORT=3000
NODE_ENV=test

# Database Configuration
DB_HOST=${{ secrets.DB_HOST }}
DB_PORT=${{ secrets.DB_PORT }}
DB_NAME=${{ secrets.DB_NAME }}
DB_USER=${{ secrets.DB_USER }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
DB_SSL=false

# Connection Pool Configuration
DB_POOL_MAX=20
DB_POOL_MIN=2
DB_IDLE_TIMEOUT=30000
DB_CONNECTION_TIMEOUT=10000

# CORS Configuration
CORS_ORIGIN=*

# API Configuration
API_TITLE=STAC Atlas
API_DESCRIPTION=A centralized platform for managing, indexing, and providing STAC Collection metadata
API_VERSION=1.1.0
EOF

- name: Install dependencies
run: |
cd api
npm ci

- name: Validate application starts
run: |
cd api
timeout 10s npm start || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
continue-on-error: false

# Job 3: STAC API Validator
stac_validator:
name: STAC API Validator (core + collections)
runs-on: ubuntu-latest
needs: test

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
cache-dependency-path: api/package-lock.json

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Create .env file
working-directory: api
run: |
cat > .env << EOF
# Server Configuration
PORT=3000
NODE_ENV=test

# Database Configuration
DB_HOST=${{ secrets.DB_HOST }}
DB_PORT=${{ secrets.DB_PORT }}
DB_NAME=${{ secrets.DB_NAME }}
DB_USER=${{ secrets.DB_USER }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
DB_SSL=false

# Connection Pool Configuration
DB_POOL_MAX=20
DB_POOL_MIN=2
DB_IDLE_TIMEOUT=30000
DB_CONNECTION_TIMEOUT=10000

# CORS Configuration
CORS_ORIGIN=*

# API Configuration
API_TITLE=STAC Atlas
API_DESCRIPTION=A centralized platform for managing, indexing, and providing STAC Collection metadata
API_VERSION=1.1.0
EOF

- name: Install Node dependencies
working-directory: api
run: npm ci

- name: Install STAC API Validator
run: |
python -m pip install --upgrade pip
python -m pip install stac-api-validator

- name: Start API server
working-directory: api
run: |
# Start server in background
npm start > server.log 2>&1 &
echo $! > server.pid

# Wait until landing page responds
for i in {1..30}; do
if curl -fsS http://localhost:3000/ > /dev/null; then
echo "API is up"
exit 0
fi
sleep 1
done

echo "API did not start in time"
echo "---- server.log ----"
tail -n 200 server.log || true
exit 1

- name: Run STAC API Validator (core + collections)
run: |
python -m stac_api_validator \
--root-url "http://localhost:3000/" \
--conformance core \
--conformance collections \
--collection 1 \
--verbose | tee stac-validator-output.txt

- name: Upload validator output
uses: actions/upload-artifact@v4
if: always()
with:
name: stac-validator-output
path: stac-validator-output.txt
retention-days: 30

- name: Stop API server
if: always()
working-directory: api
run: |
if [ -f server.pid ]; then
kill "$(cat server.pid)" || true
fi
echo "---- server.log (tail) ----"
tail -n 200 server.log || true

# Job 4: Security Audit
security:
name: Security Audit
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
cache-dependency-path: api/package-lock.json

- name: Run npm audit
run: |
cd api
npm audit --audit-level=moderate
continue-on-error: true

# Job 5: Status-Check for Branch Protection
ci-success:
name: CI Success
runs-on: ubuntu-latest
needs: [test, build, stac_validator, security]
if: always()

steps:
- name: Check all jobs succeeded
run: |
if [ "${{ needs.test.result }}" != "success" ] || [ "${{ needs.build.result }}" != "success" ] || [ "${{ needs.stac_validator.result }}" != "success" ] || [ "${{ needs.security.result }}" != "success" ]; then
echo "CI Pipeline failed!"
echo "Test status: ${{ needs.test.result }}"
echo "Build status: ${{ needs.build.result }}"
exit 1
else
echo "All CI checks passed successfully!"
fi
31 changes: 31 additions & 0 deletions api/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Server Configuration
PORT=3000
NODE_ENV=development


# Database Configuration (Debian Server)
# Option 1: Use DATABASE_URL (PostgreSQL connection string)
# add DB_USER and DB_PASSWORD values
DATABASE_URL= postgresql://[**DB_USER**]:[**DB_PASSWORD**]@atlas.stacindex.org:5432/stac_db

# Option 2: Use individual variables (currently active)
DB_HOST=atlas.stacindex.org
DB_PORT=5433 # 5432 for production
DB_NAME=stac_db
DB_USER=
DB_PASSWORD=
DB_SSL=false

# Connection Pool Configuration
DB_POOL_MAX=20
DB_POOL_MIN=2
DB_IDLE_TIMEOUT=30000
DB_CONNECTION_TIMEOUT=10000

# CORS Configuration
CORS_ORIGIN=*

# API Configuration
API_TITLE=STAC Atlas
API_DESCRIPTION=A centralized platform for managing, indexing, and providing STAC Collection metadata
API_VERSION=1.1.0
18 changes: 18 additions & 0 deletions api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
env: {
node: true,
es2022: true,
jest: true
},
extends: ['eslint:recommended'],
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module'
},
rules: {
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-console': ['warn', { allow: ['warn', 'error'] }],
'prefer-const': 'warn',
'no-var': 'error'
}
};
Loading
Loading