Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
42defa2
move old stuff out of the way
nleanba Sep 1, 2022
3c7dcd8
defined all routes
nleanba Oct 22, 2022
5d13636
fmt
nleanba Oct 22, 2022
315819c
added GET /version
nleanba Oct 22, 2022
b11dee5
docker framework
nleanba Oct 22, 2022
08ff7a3
setup devcontainer
nleanba Oct 22, 2022
f08e7f1
added zip restore
nleanba Oct 22, 2022
1ed70b6
added cors headers
nleanba Oct 22, 2022
d208e9e
added cors headers
nleanba Oct 22, 2022
21700f8
Merge branch 'deno' of github.com:tridoc/tridoc-backend into deno
nleanba Oct 22, 2022
ffce65f
added count
nleanba Oct 22, 2022
4c45866
added count
nleanba Oct 22, 2022
9a72686
added GET /doc/:id
nleanba Oct 22, 2022
c1c0b30
added GET /doc/:id/comment
nleanba Oct 22, 2022
1c5795c
added POST /doc
nleanba Oct 23, 2022
36ec78c
added filename to GET /doc
nleanba Oct 23, 2022
1ef5b30
added delete
nleanba Oct 23, 2022
4728531
redactored to fusekiFetch/Update instead of fetch
nleanba Oct 23, 2022
1d41598
added POST /doc/:id/comment
nleanba Oct 23, 2022
a9828f3
added GET /doc/:id/thumb
nleanba Oct 23, 2022
6b67780
added GET /doc/:id/title
nleanba Oct 23, 2022
c5576ef
added GET /doc/:id/tag, /doc/:id/meta
nleanba Oct 23, 2022
4187119
added GET /raw/rdf
nleanba Oct 23, 2022
520a4d0
added GET /raw/tgz
nleanba Oct 23, 2022
8151fe3
added GET /raw/zip
nleanba Oct 23, 2022
6050e11
rm broken
nleanba Oct 23, 2022
93bfaa6
added GET /tag/:tagLabel
nleanba Oct 23, 2022
b0384de
added POST /doc/:id/tag
nleanba Oct 23, 2022
690595b
added PUT /doc/:id/title
nleanba Oct 24, 2022
0479d8d
added POST /tag
nleanba Oct 24, 2022
876f0ae
added DELETE /tag/label and /doc/:id/tag/:label
nleanba Oct 24, 2022
aa92beb
refined HTTP response codes
nleanba Oct 24, 2022
8c4d889
implemented DELETE /doc/:id/title
nleanba Oct 24, 2022
30e234e
added message about file permissions as temp fix
nleanba Jan 13, 2023
b875206
Added correct content-type for all JSON responses
nleanba Jan 15, 2023
9d17a03
Removed deadlock
nleanba Aug 3, 2023
7aa1e21
tidying up
retog Aug 19, 2025
70168fb
version
retog Aug 19, 2025
354d237
typo
retog Aug 19, 2025
74215d8
sonnet 4
retog Aug 19, 2025
070df3d
Pending changes exported from your codespace
retog Aug 19, 2025
0d22487
builds/starts
retog Aug 19, 2025
be1d662
allow pings
retog Aug 19, 2025
4510135
bash
retog Aug 19, 2025
0088070
permission on deno-dir
retog Aug 19, 2025
c302591
peesist bash history on host
retog Aug 19, 2025
3e7cbc4
avoiding ownership issuer
retog Aug 19, 2025
813c55a
obsolete
retog Aug 19, 2025
8757236
ensure dir exists
retog Aug 19, 2025
de2ffc5
deno lock
retog Aug 20, 2025
7764dd3
removed obsolete
retog Aug 20, 2025
767f2a8
dev one in .devcontaIner
retog Aug 20, 2025
20cec7f
removed duplication
retog Aug 20, 2025
668f805
fixed hist conf
retog Aug 20, 2025
4c6cc3d
responding as expected by cockpit
retog Aug 20, 2025
1647370
responses expected by cockpit
retog Aug 20, 2025
b1b4d61
addressed lint errors
retog Aug 20, 2025
c84a413
fixed table
retog Aug 20, 2025
7e0d2c0
clarified
retog Aug 20, 2025
b1ec0c6
Allow to PUT graph
retog Aug 20, 2025
73ee2ea
get orphaned
retog Aug 21, 2025
5b4f612
comment obsolete
retog Aug 21, 2025
19b1090
turtle default + cleanup
retog Aug 21, 2025
ee464b1
tmp - permission
retog Aug 21, 2025
7eefc42
create orphaned archive in tmp
retog Aug 22, 2025
25b8afa
hash based blob storage #33
retog Aug 22, 2025
40b9075
removing extension before comparing with hash #33
retog Aug 23, 2025
854f0b2
procps and deno 2.4.5
retog Aug 23, 2025
6a5e9d4
code duplication / fixes
retog Aug 23, 2025
56752b0
permissions / no-prompt
retog Aug 23, 2025
de5834f
flat file structure
retog Aug 23, 2025
28442c5
obsolete
retog Aug 23, 2025
f2db2a3
fixed thumbnails
retog Aug 23, 2025
8936219
adapted container paths
retog Aug 23, 2025
ebe62ae
fixed indent
retog Aug 27, 2025
008c5f3
removing legacy files after migration
retog Sep 3, 2025
ec31e39
fixed OCR
retog Sep 3, 2025
5e8825e
cleanupAllEmptyLegacyDirectories
retog Sep 4, 2025
4bbdcd5
updated fuseki, uniondefaultgraph not working
retog Sep 20, 2025
c718452
specifying graph rather than using uniondefault
retog Sep 20, 2025
64eff5a
using fuseki-base:5.4.0
retog Sep 20, 2025
ef799e0
removed `.env`
retog Nov 7, 2025
c56ee55
/migrate changed to POST as the operation changes the state of the se…
retog Nov 7, 2025
d1bcbe7
remove unused datecheck function from doc.ts
retog Nov 8, 2025
91878be
formated (deno fmt)
retog Nov 8, 2025
cf814e2
validate tag label presence in deleteTag and getDocs functions
retog Nov 8, 2025
fd59d51
Refactor: extract pdfsandwich OCR to helper runPdfsandwich
retog Nov 8, 2025
a53fca4
Remove unstable flag from Deno settings in VSCode configuration
retog Nov 8, 2025
356a082
removed variable as this wronly suggests configurability while in fac…
retog Nov 8, 2025
fa8edb1
Refactor: remove unused _getDir function and update getPath for legac…
retog Nov 8, 2025
4134f2c
setting OCR_LANG
retog Nov 8, 2025
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
55 changes: 55 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/docker-existing-docker-compose
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
{
"name": "Tridoc Backend Development",

// Use the independent dev container docker-compose configuration
"dockerComposeFile": "docker-compose.yml",

"containerEnv": {
"TRIDOC_PWD": "pw123",
"OCR_LANG": "deu"
},

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "tridoc",

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/usr/src/app",

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000, 8001],

// Start the fuseki service when the dev container starts
"runServices": ["fuseki"],

// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
"shutdownAction": "stopCompose",

// Post-create command to set up the development environment
"postCreateCommand": "bash .devcontainer/setup-dev.sh",

// Connect as the deno user
"remoteUser": "deno",

"customizations": {
"vscode": {
"extensions": [
"denoland.vscode-deno"
],
"settings": {
"deno.enable": true,
"deno.lint": true,
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
}
}
}
}
}
47 changes: 47 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
services:
# Development environment for tridoc-backend
tridoc:
build:
context: ..
dockerfile: Dockerfile
user: deno
volumes:
# Mount the entire workspace for development
- ..:/usr/src/app:cached
# Mount blobs directory separately if needed
- ../blobs:/usr/src/app/blobs
ports:
- "8000:8000"
depends_on:
fuseki:
condition: service_healthy
environment:
TRIDOC_PWD: "${TRIDOC_PWD:-pw123}"
OCR_LANG: "${OCR_LANG:-deu}"
# Keep container running for development
command: ["sleep", "infinity"]
networks:
- tridoc-dev

# Fuseki service accessible as 'fuseki' hostname
fuseki:
image: "linkedsolutions/fuseki-base:5.4.0"
environment:
ADMIN_PASSWORD: "${FUSEKI_PWD:-pw123}"
ports:
- "8001:3030" # Expose for development access
volumes:
- ./fuseki-data:/fuseki/base
- ../config-tdb.ttl:/config.ttl
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:3030/$/ping"]
interval: 5s
timeout: 3s
retries: 30
start_period: 10s
networks:
- tridoc-dev

networks:
tridoc-dev:
driver: bridge
27 changes: 27 additions & 0 deletions .devcontainer/setup-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

echo "Setting up Tridoc Backend development environment..."

# Ensure dataset exists using shared script (waits for Fuseki internally)
if [ -f "./database-create.sh" ]; then
bash ./database-create.sh 3DOC || echo "(setup-dev) Dataset ensure script exited with non-zero status; continuing."
else
echo "(setup-dev) WARNING: database-create.sh not found; skipping dataset ensure."
fi

# Cache Deno dependencies if deps.ts exists
if [ -f "src/deps.ts" ]; then
echo "Caching Deno dependencies..."
deno cache src/deps.ts
fi

echo "Dataset bootstrap (if needed) complete."

echo "Development environment setup complete!"
echo ""
echo "You can now run the Tridoc backend with:"
echo "deno run --watch --allow-net --allow-read=blobs,rdf.ttl --allow-write=blobs,rdf.ttl --allow-run --allow-env=TRIDOC_PWD,FUSEKI_PWD,OCR_LANG src/main.ts"
echo ""
echo "Fuseki is available at:"
echo "- Internal: http://fuseki:3030"
echo "- External: http://localhost:8001"
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
old
blobs
fuseki-base
node_modules
63 changes: 5 additions & 58 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,65 +1,12 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

node_modules
blobs

fuseki-base
fuseki-data
.devcontainer/.bash_history
.bash_history
.deno-dir
41 changes: 27 additions & 14 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/lib/server",
"env": {"TRIDOC_PWD": "tridoc"}
}
]
}
"version": "0.2.0",
"configurations": [
{
"name": "Launch Tridoc Backend",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/src/main.ts",
"runtimeExecutable": "deno",
"runtimeArgs": [
"run",
"--watch",
"--no-prompt",
"--allow-net",
"--allow-read=blobs,rdf.ttl,/tmp",
"--allow-write=blobs,rdf.ttl,/tmp",
"--allow-run",
"--allow-env=FUSEKI_PWD,TRIDOC_PWD,OCR_LANG, TMPDIR"
],
"attachSimplePort": 9229,
"env": {
"TRIDOC_PWD": "pw123",
"OCR_LANG": "deu"
},
"console": "integratedTerminal"
}
]
}
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"npm.packageManager": "yarn"
}
"deno.enable": true,
"deno.lint": true
}
77 changes: 77 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Tridoc Backend",
"type": "shell",
"command": "deno",
"args": [
"run",
"--watch",
"--no-prompt",
"--allow-net",
"--allow-read=blobs,rdf.ttl,/tmp",
"--allow-write=blobs,rdf.ttl,/tmp",
"--allow-run",
"--allow-env=TRIDOC_PWD,OCR_LANG,FUSEKI_PWD",
"src/main.ts"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "new"
},
"problemMatcher": [],
"options": {
"env": {
"TRIDOC_PWD": "pw123",
"OCR_LANG": "deu"
}
}
},
{
"label": "Cache Dependencies",
"type": "shell",
"command": "deno",
"args": ["cache", "src/deps.ts"],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
},
{
"label": "Format Code",
"type": "shell",
"command": "deno",
"args": ["fmt"],
"group": "build",
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared"
}
},
{
"label": "Lint Code",
"type": "shell",
"command": "deno",
"args": ["lint"],
"group": "test",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
}
]
}
Empty file removed 3doc.config.js
Empty file.
Loading