Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/prettier-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24.12'
node-version: '24.18'

- name: Install dependencies
run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v24.12.0
v24.18.0
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,17 @@ yarn run prisma migrate dev
# when ai-pr was once merged/deployed to the db, run `delete from _prisma_migrations where migration_name ilike '%_ai_%';`
```

### Troubleshooting

#### Dokku `Unknown buildpack version`

```bash
docker pull gliderlabs/herokuish:latest
# when this does not help, try additionally:
dokku buildpacks:set-property <APP> stack gliderlabs/herokuish:latest
dokku repo:purge-cache <APP>
```

## Speed Improvements
If the API and the Database are running on the same server, you can improve the speed by disabling the tcp connection for the database. This can be done by setting the `DATABASE_URL` to `postgresql://teaching_website:teaching_website@localhost/teaching_website?sslmode=disable`.

Expand Down
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"lint": "eslint . --ignore-pattern node_modules --fix",
"format": "prettier --write ./**/*.{ts,json}",
"format:check": "prettier --check ./**/*.{ts,json}",
"typecheck": "tsc",
"db:migrate": "yarn prisma migrate deploy",
"db:migrate:dev": "yarn prisma migrate dev",
"db:migrate-view": "tsx -r dotenv/config ./prisma/view-migrations/create-view-migration.ts",
Expand All @@ -22,50 +23,49 @@
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org $SENTRY_ORG --project $SENTRY_PROJECT ./dist && sentry-cli sourcemaps upload --org $SENTRY_ORG --project $SENTRY_PROJECT ./dist"
},
"dependencies": {
"@better-auth/sso": "^1.4.9",
"@prisma/adapter-pg": "^7.2.0",
"@prisma/client": "^7.2.0",
"@sentry/node": "^10.63.0",
"better-auth": "^1.4.9",
"cors": "^2.8.5",
"cross-env": "^10.0.0",
"dotenv": "^17.2.2",
"es-toolkit": "^1.43.0",
"@better-auth/sso": "^1.6.23",
"@prisma/adapter-pg": "^7.8.0",
"@prisma/client": "^7.8.0",
"@sentry/node": "^10.64.0",
"better-auth": "^1.6.23",
"cors": "^2.8.6",
"cross-env": "^10.1.0",
"dotenv": "^17.2.3",
"es-toolkit": "^1.49.0",
"express": "^5.2.1",
"global": "^4.4.0",
"morgan": "^1.10.0",
"morgan": "^1.11.0",
"pg": "^8.16.3",
"socket.io": "^4.8.3",
"winston": "^3.19.0"
},
"devDependencies": {
"@sentry/cli": "^3.6.0",
"@types/cors": "^2.8.17",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.6",
"@types/js-yaml": "^4.0.9",
"@types/morgan": "^1.9.9",
"@types/morgan": "^1.9.10",
"@types/node": "^25.0.3",
"@types/pg": "^8.16.0",
"@typescript-eslint/eslint-plugin": "^8.44.1",
"@typescript-eslint/parser": "^8.44.1",
"dotenv-cli": "^7.4.2",
"eslint": "^9.36.0",
"@types/pg": "^8.20.0",
"@typescript-eslint/eslint-plugin": "^8.63.0",
"@typescript-eslint/parser": "^8.63.0",
"dotenv-cli": "^11.0.0",
"eslint": "^10.6.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.6",
"js-yaml": "^4.1.1",
"js-yaml": "^5.2.1",
"minimist": "^1.2.8",
"nodemon": "^3.1.10",
"nodemon": "^3.1.14",
"prettier": "^3.9.4",
"prisma": "^7.2.0",
"prisma": "^7.8.0",
"prisma-dbml-generator": "^0.12.0",
"prisma-docs-generator": "^0.8.0",
"prisma-erd-generator": "^2.4.2",
"prisma-erd-generator": "^2.4.3",
"tsconfig-paths": "^4.2.0",
"tsx": "^4.23.0",
"typescript": "^6.0.3"
"typescript": "^7.0.2"
},
"engines": {
"node": "24.12.x || 24.13.x || 24.14.x || 24.16.x || 24.18.x"
"node": "24.16.x || 24.18.x"
},
"optionalDependencies": {
"puppeteer": "^24.34.0"
Expand Down
4 changes: 2 additions & 2 deletions prisma/view-migrations/create-view-migration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from 'fs';
import * as path from 'path';
import * as yaml from 'js-yaml';
import { load as yamlLoad } from 'js-yaml';
import { default as parseArgs } from 'minimist';
import { exit } from 'process';
import { fileURLToPath } from 'url';
Expand All @@ -14,7 +14,7 @@ interface Config {
name: string;
depends_on: string[];
}
const config = yaml.load(fs.readFileSync(path.resolve(currentDir, CONFIG_FILENAME), 'utf8')) as Config[];
const config = yamlLoad(fs.readFileSync(path.resolve(currentDir, CONFIG_FILENAME), 'utf8')) as Config[];
const HELP_TEXT = `
yarn run db:migrate-view [view-name [view-name ...]]

Expand Down
3 changes: 2 additions & 1 deletion src/auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { betterAuth } from 'better-auth';
import { prismaAdapter } from 'better-auth/adapters/prisma';
import prisma from './prisma.js';
import { admin, createAuthMiddleware, oneTimeToken } from 'better-auth/plugins';
import { createAuthMiddleware } from 'better-auth/api';
import { admin, oneTimeToken } from 'better-auth/plugins';
import { CORS_ORIGIN_STRINGIFIED } from './utils/originConfig.js';
import { getNameFromEmail } from './helpers/email.js';
import type { GithubProfile, MicrosoftEntraIDProfile } from 'better-auth/social-providers';
Expand Down
2 changes: 1 addition & 1 deletion src/auth/permissions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { adminAc, defaultAc } from 'better-auth/plugins/admin/access';

const revokedTeacherPermissions: (typeof adminAc.statements)['user'] = [
const revokedTeacherPermissions: (typeof adminAc.statements)['user'][number][] = [
'ban',
'delete',
'set-role',
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/email.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'es-toolkit/compat';

export const getNameFromEmail = (email?: string) => {
export const getNameFromEmail = (email?: string | null) => {
const name = (email || '').split('@')[0] || '';
const firstName = _.capitalize(name.split('.')[0] || '');
const lastName = _.capitalize(name.split('.')[1] || '');
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"moduleResolution": "nodenext",
// "allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"ignoreDeprecations": "6.0",
"baseUrl": ".",
"outDir": "dist",
"sourceMap": true,
"strict": true,
Expand Down
Loading
Loading