Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/get prof pic status #149

Merged
merged 7 commits into from
Dec 12, 2024
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
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

47 changes: 0 additions & 47 deletions .eslintrc.js

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
with:
node-version: 20

- name: Enable Corepack
run: corepack enable

- name: Use Yarn v4
run: corepack prepare [email protected] --activate

- name: Install dependencies
run: yarn install

Expand All @@ -41,6 +47,12 @@ jobs:
with:
node-version: 20

- name: Enable Corepack
run: corepack enable

- name: Use Yarn v4
run: corepack prepare [email protected] --activate

- name: Install dependencies
run: yarn install

Expand All @@ -62,8 +74,18 @@ jobs:
with:
node-version: 20

- name: Enable Corepack
run: corepack enable

- name: Use Yarn v4
run: corepack prepare [email protected] --activate

- name: Install dependencies
run: yarn install

- name: Generate Prisma Client
working-directory: apps/backend
run: yarn prisma generate

- name: Build
run: yarn build:backend
42 changes: 42 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,48 @@
"outputCapture": "std",
"type": "node",
"restart": true
},
{
"name": "Next.js: debug server-side",
"cwd": "${workspaceFolder}/apps/frontend",
"type": "node-terminal",
"request": "launch",
"command": "yarn dev"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug client-side (Firefox)",
"type": "firefox",
"request": "launch",
"url": "http://localhost:3000",
"reAttach": true,
"pathMappings": [
{
"url": "webpack://_N_E",
"path": "${workspaceFolder}/apps/frontend"
}
]
},
{
"name": "Next.js: debug full stack",
"cwd": "${workspaceFolder}/apps/frontend",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/apps/frontend/node_modules/.bin/next",
"runtimeArgs": ["--inspect"],
"skipFiles": ["<node_internals>/**"],
"serverReadyAction": {
"action": "debugWithEdge",
"killOnServerStop": true,
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
"webRoot": "${workspaceFolder}/apps/frontend"
}
}
]
}
Binary file added .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# SCHBody💪

by Kir-Dev

A Schönherz Kollégium konditermének weboldala és adminisztrációs rendszere.

- Ha hibát találsz, kérlek nyiss egy issue-t!
- Ha részt akarsz venni a fejlesztésben, vedd fel a kapcsolatot velünk és nyiss egy pull requestet!

Expand All @@ -10,7 +12,7 @@ A Schönherz Kollégium konditermének weboldala és adminisztrációs rendszere
### Prerequisites

- Node.js 20
- Yarn 1.22
- Yarn 4.5.1

### Installation

Expand Down Expand Up @@ -81,6 +83,3 @@ yarn build:backend
```

## Happy Coding!



20 changes: 0 additions & 20 deletions apps/backend/.eslintrc.js

This file was deleted.

17 changes: 17 additions & 0 deletions apps/backend/docker-compose-db.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: schbody-dev-db

services:
postgres:
image: postgres:13.10
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data

volumes:
postgres_data: {}
26 changes: 26 additions & 0 deletions apps/backend/docker-compose-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: schbody

services:
app:
build:
context: .
ports:
- '${BACKEND_PORT}:${BACKEND_PORT}'
env_file:
- .env
restart: always
depends_on:
- db

db:
image: postgres:13.10
env_file:
- .env
restart: always
ports:
- '${POSTGRES_PORT}:${POSTGRES_PORT}'
volumes:
- schbody_db_folder:/var/lib/postgresql/data

volumes:
schbody_db_folder:
48 changes: 48 additions & 0 deletions apps/backend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import typescriptEslintEslintPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
const config = [
{
ignores: ['**/.prettierrc.js'],
},
...compat.extends('plugin:@typescript-eslint/recommended', 'nestjs', 'plugin:@next/next/recommended'),
{
plugins: {
'@typescript-eslint': typescriptEslintEslintPlugin,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',

parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
},
},

rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-extra-semi': 'off',
'@typescript-eslint/no-unused-vars': 'error',
},
},
];

export default config;
38 changes: 20 additions & 18 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,48 @@
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/src/main",
"lint": "eslint 'src/**/*.ts'",
"db:seed": "prisma db seed"
},
"prisma": {
"seed": "ts-node prisma/seed.ts"
},
"dependencies": {
"@kir-dev/passport-authsch": "^2.0.4",
"@nestjs/common": "^10.3.8",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.3.8",
"@kir-dev/passport-authsch": "^2.1.0",
"@nestjs/common": "^10.4.7",
"@nestjs/config": "^3.3.0",
"@nestjs/core": "^10.4.7",
"@nestjs/jwt": "^10.2.0",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.3.8",
"@nestjs/swagger": "^7.3.1",
"@prisma/client": "^5.21.1",
"@radix-ui/react-dialog": "^1.1.1",
"@nestjs/platform-express": "^10.4.7",
"@nestjs/swagger": "^8.0.3",
"@prisma/client": "^6.0.1",
"@radix-ui/react-dialog": "^1.1.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"nestjs-prisma": "^0.23.0",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"reflect-metadata": "^0.2.2",
"rimraf": "^5.0.5",
"rimraf": "^6.0.1",
"rxjs": "^7.8.1",
"sharp": "^0.33.5"
},
"devDependencies": {
"@faker-js/faker": "^9.0.3",
"@nestjs/cli": "^10.3.2",
"@nestjs/schematics": "^10.1.1",
"@types/express": "^4.17.21",
"@faker-js/faker": "^9.2.0",
"@nestjs/cli": "^10.4.7",
"@nestjs/schematics": "^10.2.3",
"@types/express": "^5.0.0",
"@types/multer": "^1.4.12",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"prisma": "^5.21.1",
"@types/node": "^20.17.6",
"eslint": "^9.14.0",
"eslint-config-nestjs": "^0.8.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"prisma": "^6.0.1",
"source-map-support": "^0.5.21",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "4.2.0",
"typescript": "^5.4.5"
"typescript": "^5.6.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class ApplicationPeriodController {
}

@Get(':id/pass-bg')
async findPassBackground(@Param('id', ParseIntPipe) id: number) {
async findPassBackground(@Param('id', ParseIntPipe) id: number): Promise<StreamableFile> {
return new StreamableFile(await this.applicationPeriodService.findPassBackground(id));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ export class ApplicationPeriodService {
async findPassBackground(periodId: number): Promise<Buffer> {
try {
const profilePic = await this.prisma.passBackgroundPicture.findUniqueOrThrow({ where: { periodId } });
return profilePic.backgroundImage;
} catch (error) {
const imageBuffer = Buffer.from(profilePic.backgroundImage.buffer);
return imageBuffer;
} catch (_error) {
throw new NotFoundException(`Period with id ${periodId} not found`);
}
}
Expand Down Expand Up @@ -152,7 +153,7 @@ export class ApplicationPeriodService {
}
try {
await this.createOrUpdatePassBg(periodId, buffer);
} catch (error) {
} catch (_error) {
throw new NotFoundException(`Period with id ${periodId} not found`);
}
}
Expand Down Expand Up @@ -187,7 +188,7 @@ export class ApplicationPeriodService {
id,
},
});
} catch (e) {
} catch (_e) {
throw new NotFoundException('Application period not found');
}
}
Expand Down
Loading
Loading