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
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Linting Check

permissions:
contents: read

on:
pull_request:
branches: ['main']
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default tseslint.config(
},
sourceType: 'commonjs',
parserOptions: {
projectService: true,
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
Expand Down
1 change: 1 addition & 0 deletions apps/backend/nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"builder": "webpack",
"deleteOutDir": true
}
}
10 changes: 6 additions & 4 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"@nestjs/jwt": "^11.0.1",
"@nestjs/platform-express": "^11.0.1",
"@nestjs/typeorm": "^11.0.0",
"bcrypt": "^6.0.0",
"bcryptjs": "^3.0.3",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.2",
"class-validator": "^0.14.3",
"passport-jwt": "^4.0.1",
"pg": "^8.16.3",
"reflect-metadata": "^0.2.2",
Expand All @@ -41,7 +41,7 @@
"@nestjs/cli": "^11.0.0",
"@nestjs/schematics": "^11.0.0",
"@nestjs/testing": "^11.0.1",
"@types/bcrypt": "^6.0.0",
"@types/bcryptjs": "^2.4.6",
"@types/express": "^5.0.0",
"@types/jest": "^30.0.0",
"@types/node": "^22.10.7",
Expand Down Expand Up @@ -81,7 +81,9 @@
"coverageDirectory": "../coverage",
"testEnvironment": "node",
"moduleNameMapper": {
"@/(.*)$": "<rootDir>/$1"
"@/(.*)$": "<rootDir>/$1",
"@shared/validation/(.*)": "<rootDir>/../../../libs/shared-validation/src/$1",
"@shared/dtos/(.*)": "<rootDir>/../../../libs/shared-dtos/src/$1"
}
}
}
8 changes: 4 additions & 4 deletions apps/backend/src/auth/auth.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AuthController } from '@/auth/auth.controller';
import { AuthService } from '@/auth/auth.service';
import { RegisterUserDto } from '@/auth/dto/register-user.dto';
import { UserResponseDto } from '@/users/user-response.dto';
import { LoginUserDto } from '@/auth/dto/login-user.dto';
import { AccessTokenDto } from '@/auth/dto/access-token.dto';
import { RegisterUserDto } from '@shared/dtos/auth/register-user.dto';
import { UserResponseDto } from '@shared/dtos/user/user-response.dto';
import { LoginUserDto } from '@shared/dtos/auth/login-user.dto';
import { AccessTokenDto } from '@shared/dtos/auth/access-token.dto';
import { ConflictException, UnauthorizedException } from '@nestjs/common';

const mockAuthService = {
Expand Down
8 changes: 4 additions & 4 deletions apps/backend/src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Body, Controller, Post } from '@nestjs/common';
import { RegisterUserDto } from '@/auth/dto/register-user.dto';
import { RegisterUserDto } from '@shared/dtos/auth/register-user.dto';
import { AuthService } from '@/auth/auth.service';
import { UserResponseDto } from '@/users/user-response.dto';
import { LoginUserDto } from '@/auth/dto/login-user.dto';
import { AccessTokenDto } from '@/auth/dto/access-token.dto';
import { UserResponseDto } from '@shared/dtos/user/user-response.dto';
import { LoginUserDto } from '@shared/dtos/auth/login-user.dto';
import { AccessTokenDto } from '@shared/dtos/auth/access-token.dto';

@Controller('auth')
export class AuthController {
Expand Down
10 changes: 5 additions & 5 deletions apps/backend/src/auth/auth.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AuthService } from '@/auth/auth.service';
import { DataSource } from 'typeorm';
import { RegisterUserDto } from '@/auth/dto/register-user.dto';
import { RegisterUserDto } from '@shared/dtos/auth/register-user.dto';
import { User } from '@/users/user.entity';
import * as bcrypt from 'bcrypt';
import * as bcrypt from 'bcryptjs';
import { ConflictException, UnauthorizedException } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { UsersService } from '@/users/users.service';
import { JwtService } from '@nestjs/jwt';
import { LoginUserDto } from '@/auth/dto/login-user.dto';
import { AccessTokenDto } from '@/auth/dto/access-token.dto';
import { LoginUserDto } from '@shared/dtos/auth/login-user.dto';
import { AccessTokenDto } from '@shared/dtos/auth/access-token.dto';

jest.mock('bcrypt', () => ({
jest.mock('bcryptjs', () => ({
hash: jest.fn(),
compare: jest.fn(),
}));
Expand Down
10 changes: 5 additions & 5 deletions apps/backend/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import {
Injectable,
UnauthorizedException,
} from '@nestjs/common';
import { RegisterUserDto } from '@/auth/dto/register-user.dto';
import * as bcrypt from 'bcrypt';
import { RegisterUserDto } from '@shared/dtos/auth/register-user.dto';
import * as bcrypt from 'bcryptjs';
import { DataSource } from 'typeorm';
import { User } from '@/users/user.entity';
import { UserResponseDto } from '@/users/user-response.dto';
import { UserResponseDto } from '@shared/dtos/user/user-response.dto';
import { ConfigService } from '@nestjs/config';
import { UsersService } from '@/users/users.service';
import { JwtService } from '@nestjs/jwt';
import { LoginUserDto } from '@/auth/dto/login-user.dto';
import { AccessTokenDto } from '@/auth/dto/access-token.dto';
import { LoginUserDto } from '@shared/dtos/auth/login-user.dto';
import { AccessTokenDto } from '@shared/dtos/auth/access-token.dto';

@Injectable()
export class AuthService {
Expand Down
3 changes: 0 additions & 3 deletions apps/backend/src/auth/dto/access-token.dto.ts

This file was deleted.

25 changes: 0 additions & 25 deletions apps/backend/src/auth/dto/register-user.dto.ts

This file was deleted.

7 changes: 7 additions & 0 deletions apps/backend/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from '@/app.module';
import { ValidationPipe } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';

async function bootstrap(): Promise<void> {
const app = await NestFactory.create(AppModule);
const configService = app.get(ConfigService);
app.useGlobalPipes(
new ValidationPipe({
whitelist: true,
forbidNonWhitelisted: true,
transform: true,
}),
);
app.enableCors({
origin: configService.get<string>('ALLOWED_ORIGIN'),
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
credentials: true,
});
await app.listen(process.env.PORT ?? 3000);
}
void bootstrap();
7 changes: 5 additions & 2 deletions apps/backend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"outDir": "./dist",
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
"@/*": ["src/*"],
"@shared/validation/*": ["../../libs/shared-validation/src/*"],
"@shared/dtos/*": ["../../libs/shared-dtos/src/*"]
},
"types": ["node", "jest"],
"incremental": true,
Expand All @@ -26,5 +28,6 @@
"strictBindCallApply": false,
"noFallthroughCasesInSwitch": false,
"useUnknownInCatchVariables": true
}
},
"include": ["src/**/*", "test/**/*", "../../libs/**/*"]
}
32 changes: 12 additions & 20 deletions apps/frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,24 @@
"builder": "@angular/build:application",
"options": {
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.css"
]
"styles": ["src/styles.css"]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.development.ts",
"with": "src/environments/environment.ts"
}
],
"budgets": [
{
"type": "initial",
Expand Down Expand Up @@ -70,37 +72,27 @@
"test": {
"builder": "@angular/build:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.css"
]
"styles": ["src/styles.css"]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
}
}
}
},
"cli": {
"schematicCollections": [
"angular-eslint"
]
"schematicCollections": ["angular-eslint"]
}
}
6 changes: 6 additions & 0 deletions apps/frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ module.exports = tseslint.config(
},
],
},
languageOptions: {
parserOptions: {
project: ['tsconfig.app.json', 'tsconfig.spec.json'],
tsconfigRootDir: __dirname,
},
},
},
{
files: ['**/*.html'],
Expand Down
6 changes: 4 additions & 2 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"start": "ng serve --open",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
Expand All @@ -29,6 +29,8 @@
"@angular/forms": "^20.3.0",
"@angular/platform-browser": "^20.3.0",
"@angular/router": "^20.3.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.3",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
Expand All @@ -51,4 +53,4 @@
"typescript": "~5.9.2",
"typescript-eslint": "8.46.0"
}
}
}
12 changes: 9 additions & 3 deletions apps/frontend/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core';
import {
ApplicationConfig,
provideBrowserGlobalErrorListeners,
provideZoneChangeDetection,
} from '@angular/core';
import { provideRouter } from '@angular/router';

import { routes } from './app.routes';
import { provideHttpClient } from '@angular/common/http';

export const appConfig: ApplicationConfig = {
providers: [
provideBrowserGlobalErrorListeners(),
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes)
]
provideRouter(routes),
provideHttpClient(),
],
};
Loading
Loading