diff --git a/backend/src/app.module.ts b/backend/src/app.module.ts index a003bb1..1d89b16 100644 --- a/backend/src/app.module.ts +++ b/backend/src/app.module.ts @@ -5,8 +5,8 @@ import { ImageModule } from './routes/image/imageroute.module'; import { ServeStaticModule } from '@nestjs/serve-static'; import Config from './env'; import { DemoManagerModule } from './managers/demo/demomanager.module'; -import { EImageBackend } from './backenddto/image.entity'; -import { EUserBackend } from './backenddto/user.entity'; +import { EImageBackend } from './models/entities/image.entity'; +import { EUserBackend } from './models/entities/user.entity'; @Module({ imports: [ diff --git a/backend/src/collections/imagedb/imagedb.module.ts b/backend/src/collections/imagedb/imagedb.module.ts index 97d8caa..cd9da0a 100644 --- a/backend/src/collections/imagedb/imagedb.module.ts +++ b/backend/src/collections/imagedb/imagedb.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { EImageBackend } from '../../backenddto/image.entity'; +import { EImageBackend } from '../../models/entities/image.entity'; import { ImageDBService } from './imagedb.service'; import { MimesService } from './mimes.service'; diff --git a/backend/src/collections/imagedb/imagedb.service.ts b/backend/src/collections/imagedb/imagedb.service.ts index 7f80279..0902b57 100644 --- a/backend/src/collections/imagedb/imagedb.service.ts +++ b/backend/src/collections/imagedb/imagedb.service.ts @@ -11,7 +11,7 @@ import { import { SupportedMime } from 'picsur-shared/dist/dto/mimes.dto'; import { GetCols } from '../collectionutils'; import { plainToClass } from 'class-transformer'; -import { EImageBackend } from '../../backenddto/image.entity'; +import { EImageBackend } from '../../models/entities/image.entity'; @Injectable() export class ImageDBService { diff --git a/backend/src/collections/userdb/userdb.module.ts b/backend/src/collections/userdb/userdb.module.ts index a405886..7b5c90a 100644 --- a/backend/src/collections/userdb/userdb.module.ts +++ b/backend/src/collections/userdb/userdb.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { EUserBackend } from '../../backenddto/user.entity'; +import { EUserBackend } from '../../models/entities/user.entity'; import { UsersService } from './userdb.service'; @Module({ diff --git a/backend/src/collections/userdb/userdb.service.ts b/backend/src/collections/userdb/userdb.service.ts index ac8d6b3..3fffa94 100644 --- a/backend/src/collections/userdb/userdb.service.ts +++ b/backend/src/collections/userdb/userdb.service.ts @@ -9,7 +9,7 @@ import { HasSuccess, } from 'picsur-shared/dist/types'; import { Repository } from 'typeorm'; -import { EUserBackend } from '../../backenddto/user.entity'; +import { EUserBackend } from '../../models/entities/user.entity'; import { GetCols } from '../collectionutils'; @Injectable() diff --git a/backend/src/decorators/multipart.decorator.ts b/backend/src/decorators/multipart.decorator.ts index 52eb821..0491a9e 100644 --- a/backend/src/decorators/multipart.decorator.ts +++ b/backend/src/decorators/multipart.decorator.ts @@ -10,7 +10,7 @@ import { FastifyRequest } from 'fastify'; import { Multipart, MultipartFields, MultipartFile } from 'fastify-multipart'; import { Newable } from 'picsur-shared/dist/types'; import Config from '../env'; -import { MultiPartFieldDto, MultiPartFileDto } from '../backenddto/multipart.dto'; +import { MultiPartFieldDto, MultiPartFileDto } from '../models/dto/multipart.dto'; const logger = new Logger('MultiPart'); export interface MPFile { diff --git a/backend/src/layers/http-exception/http-exception.filter.ts b/backend/src/layers/httpexception/httpexception.filter.ts similarity index 100% rename from backend/src/layers/http-exception/http-exception.filter.ts rename to backend/src/layers/httpexception/httpexception.filter.ts diff --git a/backend/src/main.ts b/backend/src/main.ts index e1a15b4..7ad7490 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -1,4 +1,4 @@ -import { Res, ValidationPipe } from '@nestjs/common'; +import { ValidationPipe } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { FastifyAdapter, @@ -7,7 +7,7 @@ import { import { AppModule } from './app.module'; import * as multipart from 'fastify-multipart'; -import { MainExceptionFilter } from './layers/http-exception/http-exception.filter'; +import { MainExceptionFilter } from './layers/httpexception/httpexception.filter'; import { SuccessInterceptor } from './layers/success/success.interceptor'; import Config from './env'; diff --git a/backend/src/managers/imagemanager/imagemanager.service.ts b/backend/src/managers/imagemanager/imagemanager.service.ts index 5869d6e..8826cae 100644 --- a/backend/src/managers/imagemanager/imagemanager.service.ts +++ b/backend/src/managers/imagemanager/imagemanager.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common'; import { fileTypeFromBuffer, FileTypeResult } from 'file-type'; import { FullMime } from 'picsur-shared/dist/dto/mimes.dto'; import { AsyncFailable, HasFailed } from 'picsur-shared/dist/types'; -import { EImageBackend } from '../../backenddto/image.entity'; +import { EImageBackend } from '../../models/entities/image.entity'; import { ImageDBService } from '../../collections/imagedb/imagedb.service'; import { MimesService } from '../../collections/imagedb/mimes.service'; diff --git a/backend/src/backenddto/imageroute.dto.ts b/backend/src/models/dto/imageroute.dto.ts similarity index 100% rename from backend/src/backenddto/imageroute.dto.ts rename to backend/src/models/dto/imageroute.dto.ts diff --git a/backend/src/backenddto/multipart.dto.ts b/backend/src/models/dto/multipart.dto.ts similarity index 100% rename from backend/src/backenddto/multipart.dto.ts rename to backend/src/models/dto/multipart.dto.ts diff --git a/backend/src/backenddto/image.entity.ts b/backend/src/models/entities/image.entity.ts similarity index 100% rename from backend/src/backenddto/image.entity.ts rename to backend/src/models/entities/image.entity.ts diff --git a/backend/src/backenddto/user.entity.ts b/backend/src/models/entities/user.entity.ts similarity index 100% rename from backend/src/backenddto/user.entity.ts rename to backend/src/models/entities/user.entity.ts diff --git a/backend/src/routes/api/auth/admin.guard.ts b/backend/src/routes/api/auth/admin.guard.ts index 45d69f7..2018492 100644 --- a/backend/src/routes/api/auth/admin.guard.ts +++ b/backend/src/routes/api/auth/admin.guard.ts @@ -6,7 +6,7 @@ import { } from '@nestjs/common'; import { plainToClass } from 'class-transformer'; import { validate } from 'class-validator'; -import { EUserBackend } from '../../../backenddto/user.entity'; +import { EUserBackend } from '../../../models/entities/user.entity'; @Injectable() export class AdminGuard implements CanActivate { diff --git a/backend/src/routes/api/auth/auth.controller.ts b/backend/src/routes/api/auth/auth.controller.ts index 561a151..fc99cb0 100644 --- a/backend/src/routes/api/auth/auth.controller.ts +++ b/backend/src/routes/api/auth/auth.controller.ts @@ -9,7 +9,7 @@ import { NotFoundException, InternalServerErrorException, } from '@nestjs/common'; -import { LocalAuthGuard } from './local-auth.guard'; +import { LocalAuthGuard } from './localauth.guard'; import { AuthService } from './auth.service'; import { JwtAuthGuard } from './jwt.guard'; import { AdminGuard } from './admin.guard'; diff --git a/backend/src/routes/api/auth/auth.module.ts b/backend/src/routes/api/auth/auth.module.ts index 5d88a83..2784548 100644 --- a/backend/src/routes/api/auth/auth.module.ts +++ b/backend/src/routes/api/auth/auth.module.ts @@ -1,13 +1,11 @@ import { Logger, - MiddlewareConsumer, Module, - NestModule, OnModuleInit, } from '@nestjs/common'; import { PassportModule } from '@nestjs/passport'; import { AuthService } from './auth.service'; -import { LocalStrategy } from './local.strategy'; +import { LocalAuthStrategy } from './localauth.strategy'; import { AuthController } from './auth.controller'; import { JwtModule } from '@nestjs/jwt'; import { JwtStrategy } from './jwt.strategy'; @@ -23,7 +21,7 @@ import Config from '../../../env'; signOptions: { expiresIn: Config.jwt.expiresIn }, }), ], - providers: [AuthService, LocalStrategy, JwtStrategy], + providers: [AuthService, LocalAuthStrategy, JwtStrategy], controllers: [AuthController], }) export class AuthModule implements OnModuleInit { diff --git a/backend/src/routes/api/auth/auth.service.ts b/backend/src/routes/api/auth/auth.service.ts index e73fa49..d3e952b 100644 --- a/backend/src/routes/api/auth/auth.service.ts +++ b/backend/src/routes/api/auth/auth.service.ts @@ -5,7 +5,7 @@ import { instanceToPlain, plainToClass } from 'class-transformer'; import { validate } from 'class-validator'; import { JwtDataDto } from 'picsur-shared/dist/dto/auth.dto'; import { AsyncFailable, HasFailed, Fail } from 'picsur-shared/dist/types'; -import { EUserBackend } from '../../../backenddto/user.entity'; +import { EUserBackend } from '../../../models/entities/user.entity'; import { UsersService } from '../../../collections/userdb/userdb.service'; @Injectable() diff --git a/backend/src/routes/api/auth/authrequest.ts b/backend/src/routes/api/auth/authrequest.ts index a91ab6a..4eacf26 100644 --- a/backend/src/routes/api/auth/authrequest.ts +++ b/backend/src/routes/api/auth/authrequest.ts @@ -1,5 +1,5 @@ import { FastifyRequest } from 'fastify'; -import { EUserBackend } from '../../../backenddto/user.entity'; +import { EUserBackend } from '../../../models/entities/user.entity'; export default interface AuthFasityRequest extends FastifyRequest { user: EUserBackend; diff --git a/backend/src/routes/api/auth/jwt.strategy.ts b/backend/src/routes/api/auth/jwt.strategy.ts index f3be008..a3d7127 100644 --- a/backend/src/routes/api/auth/jwt.strategy.ts +++ b/backend/src/routes/api/auth/jwt.strategy.ts @@ -5,7 +5,7 @@ import { validate } from 'class-validator'; import { plainToClass } from 'class-transformer'; import Config from '../../../env'; import { JwtDataDto } from 'picsur-shared/dist/dto/auth.dto'; -import { EUserBackend } from '../../../backenddto/user.entity'; +import { EUserBackend } from '../../../models/entities/user.entity'; @Injectable() export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') { diff --git a/backend/src/routes/api/auth/local-auth.guard.ts b/backend/src/routes/api/auth/localauth.guard.ts similarity index 100% rename from backend/src/routes/api/auth/local-auth.guard.ts rename to backend/src/routes/api/auth/localauth.guard.ts diff --git a/backend/src/routes/api/auth/local.strategy.ts b/backend/src/routes/api/auth/localauth.strategy.ts similarity index 80% rename from backend/src/routes/api/auth/local.strategy.ts rename to backend/src/routes/api/auth/localauth.strategy.ts index 1d10f28..9a934fe 100644 --- a/backend/src/routes/api/auth/local.strategy.ts +++ b/backend/src/routes/api/auth/localauth.strategy.ts @@ -3,10 +3,10 @@ import { PassportStrategy } from '@nestjs/passport'; import { Injectable, UnauthorizedException } from '@nestjs/common'; import { AuthService } from './auth.service'; import { AsyncFailable, HasFailed } from 'picsur-shared/dist/types'; -import { EUserBackend } from '../../../backenddto/user.entity'; +import { EUserBackend } from '../../../models/entities/user.entity'; @Injectable() -export class LocalStrategy extends PassportStrategy(Strategy, 'local') { +export class LocalAuthStrategy extends PassportStrategy(Strategy, 'local') { constructor(private authService: AuthService) { super(); } diff --git a/backend/src/routes/image/imageroute.controller.ts b/backend/src/routes/image/imageroute.controller.ts index 27dcd18..8856843 100644 --- a/backend/src/routes/image/imageroute.controller.ts +++ b/backend/src/routes/image/imageroute.controller.ts @@ -13,8 +13,8 @@ import { FastifyReply, FastifyRequest } from 'fastify'; import { HasFailed } from 'picsur-shared/dist/types'; import { MultiPart } from '../../decorators/multipart.decorator'; import { ImageManagerService } from '../../managers/imagemanager/imagemanager.service'; -import { ImageUploadDto } from '../../backenddto/imageroute.dto'; import { isHash } from 'class-validator'; +import { ImageUploadDto } from '../../models/dto/imageroute.dto'; @Controller('i') export class ImageController { constructor(private readonly imagesService: ImageManagerService) {} diff --git a/frontend/src/app/components/copy-field/copy-field.component.html b/frontend/src/app/components/copyfield/copyfield.component.html similarity index 100% rename from frontend/src/app/components/copy-field/copy-field.component.html rename to frontend/src/app/components/copyfield/copyfield.component.html diff --git a/frontend/src/app/components/copy-field/copy-field.component.scss b/frontend/src/app/components/copyfield/copyfield.component.scss similarity index 100% rename from frontend/src/app/components/copy-field/copy-field.component.scss rename to frontend/src/app/components/copyfield/copyfield.component.scss diff --git a/frontend/src/app/components/copy-field/copy-field.component.ts b/frontend/src/app/components/copyfield/copyfield.component.ts similarity index 86% rename from frontend/src/app/components/copy-field/copy-field.component.ts rename to frontend/src/app/components/copyfield/copyfield.component.ts index 31a2258..b1795c6 100644 --- a/frontend/src/app/components/copy-field/copy-field.component.ts +++ b/frontend/src/app/components/copyfield/copyfield.component.ts @@ -4,9 +4,9 @@ import { SnackBarType } from 'src/app/models/snack-bar-type'; import { UtilService } from 'src/app/util/util.service'; @Component({ - selector: 'copy-field', - templateUrl: './copy-field.component.html', - styleUrls: ['./copy-field.component.scss'], + selector: 'copyfield', + templateUrl: './copyfield.component.html', + styleUrls: ['./copyfield.component.scss'], }) export class CopyFieldComponent { // Two paramets: name, value diff --git a/frontend/src/app/components/copy-field/copy-field.module.ts b/frontend/src/app/components/copyfield/copyfield.module.ts similarity index 90% rename from frontend/src/app/components/copy-field/copy-field.module.ts rename to frontend/src/app/components/copyfield/copyfield.module.ts index 669e640..c858ee4 100644 --- a/frontend/src/app/components/copy-field/copy-field.module.ts +++ b/frontend/src/app/components/copyfield/copyfield.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { CopyFieldComponent } from './copy-field.component'; +import { CopyFieldComponent } from './copyfield.component'; import { MatInputModule } from '@angular/material/input'; import { MatIconModule } from '@angular/material/icon'; import { MatButtonModule } from '@angular/material/button'; diff --git a/frontend/src/app/router/router.module.ts b/frontend/src/app/router/router.module.ts index 6136cb5..bf19f35 100644 --- a/frontend/src/app/router/router.module.ts +++ b/frontend/src/app/router/router.module.ts @@ -8,7 +8,7 @@ import { ApiModule } from '../api/api.module'; import { PageNotFoundModule } from '../components/pagenotfound/pagenotfound.module'; import { PageNotFoundComponent } from '../components/pagenotfound/pagenotfound.component'; import { ViewComponent } from '../routes/view/view.component'; -import { CopyFieldModule } from '../components/copy-field/copy-field.module'; +import { CopyFieldModule } from '../components/copyfield/copyfield.module'; import { MatButtonModule } from '@angular/material/button'; import { UtilModule } from '../util/util.module'; import { LoginComponent } from '../routes/login/login.component'; diff --git a/frontend/src/app/routes/view/view.component.html b/frontend/src/app/routes/view/view.component.html index 76d166b..a6cbc1e 100644 --- a/frontend/src/app/routes/view/view.component.html +++ b/frontend/src/app/routes/view/view.component.html @@ -10,19 +10,19 @@
- +
- +
- +
- +
- +