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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/node_modules
secrets/*/.env.production
6 changes: 3 additions & 3 deletions packages/backend/docker-compose.yml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
shm_size: 128mb
restart: unless-stopped
env_file:
- .env.production.local
- secrets/database/.env.production
volumes:
- hallmaster-database:/var/lib/postgresql/data:rw
ports:
Expand All @@ -24,13 +24,13 @@ services:
condition: service_healthy
image: hallmaster-backend
build:
context: ../..
context: .
dockerfile: packages/backend/Dockerfile
container_name: hallmaster-backend
ports:
- "3000:3000"
env_file:
- .env.production.local
- secrets/backend/.env.production
networks:
- hallmaster-network
volumes:
Expand Down
17 changes: 0 additions & 17 deletions packages/backend/.env.development.local.example

This file was deleted.

10 changes: 10 additions & 0 deletions packages/backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DISCORD_BOT_TOKEN_ENV_NAME=DISCORD_BOT_TOKEN

DATABASE_URL=postgresql://pguser:pgpassword@hallmaster-postgres:5432/hallmaster

# python3 -c "import random,string;print(''.join([random.choice(string.hexdigits[:16]) for _ in range(32)]))"
JWT_SECRET=XXX
JWT_EXPIRES_IN=12h # 15m, 1d, ...

# This enables logging of all incoming requests
# LOG_REQUESTS=true
17 changes: 0 additions & 17 deletions packages/backend/.env.production.local.example

This file was deleted.

17 changes: 9 additions & 8 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
},
"scripts": {
"build": "nest build",
"start": "dotenv -e .env.development.local -- nest start",
"start:dev": "dotenv -e .env.development.local -- nest start --watch",
"start:debug": "dotenv -e .env.development.local -- nest start --debug --watch",
"start": "dotenv -e .env -- nest start",
"start:dev": "dotenv -e .env -- nest start --watch",
"start:debug": "dotenv -e .env -- nest start --debug --watch",
"start:prod": "prisma migrate deploy && node dist/src/main",
"lint": "eslint \"src/**/*.ts\"",
"lint:fix": "eslint --fix \"src/**/*.ts\"",
Expand All @@ -23,12 +23,12 @@
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
"test:cov": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
"test:debug": "NODE_OPTIONS=--experimental-vm-modules node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"prisma:reset": "dotenv -e .env.development.local -- prisma migrate reset",
"prisma:migrate": "dotenv -e .env.development.local -- prisma migrate dev",
"prisma:reset": "dotenv -e .env -- prisma migrate reset",
"prisma:migrate": "dotenv -e .env -- prisma migrate dev",
"prisma:generate": "DATABASE_URL=postgres://null:null@null:5432/null prisma generate",
"prisma:deploy": "dotenv -e .env.development.local -- prisma migrate deploy",
"prisma:studio": "dotenv -e .env.development.local -- prisma studio",
"prisma:format": "dotenv -e .env.development.local -- prisma format"
"prisma:deploy": "dotenv -e .env -- prisma migrate deploy",
"prisma:studio": "dotenv -e .env -- prisma studio",
"prisma:format": "dotenv -e .env -- prisma format"
},
"dependencies": {
"@fastify/compress": "8.3.1",
Expand Down Expand Up @@ -64,6 +64,7 @@
"@swc/cli": "0.6.0",
"@swc/core": "1.15.11",
"@types/jest": "30.0.0",
"@types/mocha": "^10.0.10",
"@types/node": "22.19.11",
"@types/pg": "8.16.0",
"@types/supertest": "6.0.3",
Expand Down
3 changes: 1 addition & 2 deletions packages/backend/src/bot/bot.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import { PrismaClientKnownRequestError } from '@prisma/client/runtime/client';
import type { DeepMockProxy } from 'jest-mock-extended';
import { mockDeep } from 'jest-mock-extended';

import type { CreateBotDto, UpdateBotDto } from 'src/index.dto.js';

import { ClustersService } from '../clusters/clusters.service.js';
import { DockerService } from '../docker/docker.service.js';
import type { CreateBotDto, UpdateBotDto } from '../index.dto.js';
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Related to baseUrl attribute removal within tsconfig.json, see more below.

import { PrismaService } from '../prisma/prisma.service.js';

import { BotService } from './bot.service.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@

"target": "ES2023",
"lib": ["ES2023"],
"types": ["jest", "mocha"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,

"baseUrl": "./",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Though it has nothing to do with the PR, this attribute is now deprecated on newer TypeScript versions (^@7.0) and creates a type error within the repository. Harmless, but annoying.

"incremental": true,
"skipLibCheck": true
}
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions secrets/backend/.env.production.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DISCORD_BOT_TOKEN_ENV_NAME=DISCORD_BOT_TOKEN

DATABASE_URL=postgresql://pguser:pgpassword@hallmaster-postgres:5432/hallmaster

# python3 -c "import random,string;print(''.join([random.choice(string.hexdigits[:16]) for _ in range(32)]))"
JWT_SECRET=XXX
JWT_EXPIRES_IN=12h # 15m, 1d, ...

# This enables logging of all incoming requests
# LOG_REQUESTS=true
3 changes: 3 additions & 0 deletions secrets/database/.env.production.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POSTGRES_USER=pguser
POSTGRES_PASSWORD=pgpassword
POSTGRES_DB=hallmaster
Loading