Skip to content
Closed
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7d49e0d
fix(annotator): prevent PDF highlight crash on deleted collapsed comm…
junaidferoz Mar 17, 2026
a6746d3
Made changes based on commit comments
junaidferoz Mar 18, 2026
d88648f
fix: add db_dumps to dockerignore
bingobongomann Mar 31, 2026
42b6272
Reverted changes and removed log files
junaidferoz Mar 31, 2026
d4bfc99
Merge pull request #129 from UKPLab/fix-122-comment_collapse
dennis-zyska Mar 31, 2026
a863bc3
Merge pull request #140 from UKPLab/update_dockerignore
dennis-zyska Mar 31, 2026
836969a
created dashboard for API tracking, updated .gitignore
junaidferoz Mar 31, 2026
84080c2
removed llm.js as this is not in scope of this implementation. Modifi…
junaidferoz Mar 31, 2026
1f5d580
Resolved comments that do not need external assistance (comments whic…
junaidferoz Apr 7, 2026
d6c7241
refactor: rename llm migration files to follow project naming convent…
junaidferoz Apr 8, 2026
afb112b
feat: add pgcrypto encryption for encrypted type settings
junaidferoz Apr 8, 2026
9763115
chore: rectified spelling mistake in tag_set.js
junaidferoz Apr 14, 2026
4f48c1d
feat(llm-ui): refactor dashboard for credential sharing and model cat…
junaidferoz Apr 14, 2026
9d5f77e
feat(llm): FR-named llm_* tables, credential share migration/model, u…
junaidferoz Apr 21, 2026
a54b0b7
refactor(ai): rename llm schema models to ai naming
junaidferoz Apr 27, 2026
47af60d
refactor(ai): update nav rights and dashboard references
junaidferoz Apr 27, 2026
376b1ba
fix: made further UI improvement changes
junaidferoz Apr 28, 2026
e33159a
chore: align .gitignore with base branch (drop from PR scope)
junaidferoz May 4, 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
5 changes: 4 additions & 1 deletion .dockerignore

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please delete this file in this pull request, should be another pull request as discussed

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ docs

# exclude aux files
.git
.idea
.idea
Comment thread
junaidferoz marked this conversation as resolved.

# exclude database dumps
db_dumps
2 changes: 1 addition & 1 deletion .gitignore

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete this file as discussed, should be another pull request

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, ill remove the file, but another pull request? could you please explain how?

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ backend/sessions
backend/node_modules
backend/logs
backend/coverage

logs/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont need this change we are already ignoring the logs in backend

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I have seen this in the current commit

# ignore build files
dist/
frontend/node_modules
Expand Down
1 change: 1 addition & 0 deletions backend/db/.sequelizerc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that needed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added so that when we run npx sequelize-cli db:migrate, the CLI loads the .env file and has access to environment variables like POSTGRES_HOST, POSTGRES_CAREDB, etc. Without it, the config.js can't resolve process.env.POSTGRES_CAREDB and the migration fails.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dennis-zyska do we need that file though?

@dennis-zyska dennis-zyska Apr 7, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we usually don't use the command without the make file, so usually the envs are set. I wonder if it would always overwrite the current one with the .env (because we have multiple .env files), and the others would not work anymore

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
require('dotenv').config({ path: path.resolve(__dirname, '..', '..', '.env') });

module.exports = {
'config': path.resolve('./config', 'config.js'),
Expand Down
1 change: 1 addition & 0 deletions backend/db/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* @author Nils Dycke
*/

module.exports = {
development: {
username: 'postgres',
Expand Down
76 changes: 76 additions & 0 deletions backend/db/migrations/20260331100037-create-api_key.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
'use strict';

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('llm_credential', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
userId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'user',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
name: {
type: Sequelize.STRING,
allowNull: false,
},
apiKey: {
type: Sequelize.TEXT,
allowNull: false,
},
apiBaseUrl: {
type: Sequelize.STRING,
allowNull: true,
defaultValue: null,
},
apiVersion: {
type: Sequelize.STRING,
allowNull: true,
defaultValue: null,
},
additionalParameters: {
type: Sequelize.JSONB,
allowNull: true,
defaultValue: {},
},
enabled: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: true,
},
deleted: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
},
deletedAt: {
type: Sequelize.DATE,
allowNull: true,
defaultValue: null,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
});
},

async down(queryInterface, Sequelize) {
await queryInterface.dropTable('llm_credential');
},
};
86 changes: 86 additions & 0 deletions backend/db/migrations/20260331101522-create-llm_provider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
'use strict';

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('llm_model', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
llmCredentialId: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
references: {
model: 'llm_credential',
key: 'id',
},
onDelete: 'SET NULL',
onUpdate: 'CASCADE',
},
userId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'user',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
name: {
type: Sequelize.STRING,
allowNull: false,
},
model: {
type: Sequelize.STRING,
allowNull: false,
},
provider: {
type: Sequelize.STRING,
allowNull: false,
},
description: {
type: Sequelize.TEXT,
allowNull: true,
defaultValue: null,
},
additionalParameters: {
type: Sequelize.JSONB,
allowNull: true,
defaultValue: {},
},
enabled: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: true,
},
deleted: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
},
deletedAt: {
type: Sequelize.DATE,
allowNull: true,
defaultValue: null,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
});
},

async down(queryInterface, Sequelize) {
await queryInterface.dropTable('llm_model');
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
'use strict';

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('llm_credential_share', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
llmCredentialId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'llm_credential',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
userId: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
references: {
model: 'user',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
roleId: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
references: {
model: 'study',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
expiryDate: {
type: Sequelize.DATE,
allowNull: false,
},
deleted: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
},
deletedAt: {
type: Sequelize.DATE,
allowNull: true,
defaultValue: null,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
});
},

async down(queryInterface, Sequelize) {
await queryInterface.dropTable('llm_credential_share');
},
};
125 changes: 125 additions & 0 deletions backend/db/migrations/20260331103048-create-llm_log.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
'use strict';

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('llm_log', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
userId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'user',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
llmModelId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'llm_model',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
documentId: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
},
studySessionId: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
},
studyStepId: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
},
requestId: {
type: Sequelize.STRING,
allowNull: true,
defaultValue: null,
},
input: {
type: Sequelize.TEXT,
allowNull: true,
},
output: {
type: Sequelize.TEXT,
allowNull: true,
},
reasoning: {
type: Sequelize.TEXT,
allowNull: true,
},
inputTokens: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
},
outputTokens: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
},
reasoningTokens: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
},
total_tokens: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
},
costs: {
type: Sequelize.FLOAT,
allowNull: true,
defaultValue: null,
},
status: {
type: Sequelize.STRING,
allowNull: false,
defaultValue: 'success',
},
requestStart: {
type: Sequelize.DATE,
allowNull: true,
defaultValue: null,
},
deleted: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
},
deletedAt: {
type: Sequelize.DATE,
allowNull: true,
defaultValue: null,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
});
},

async down(queryInterface, Sequelize) {
await queryInterface.dropTable('llm_log');
},
};
Loading
Loading