Skip to content
Open
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
46 changes: 43 additions & 3 deletions package-lock.json

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

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Vinyls Backend MISO",
"license": "MIT",
"engines": {
"node": "12.x"
"node": "14.x"
},
"scripts": {
"prebuild": "rimraf dist",
Expand All @@ -26,6 +26,7 @@
"@nestjs/common": "^6.8.0",
"@nestjs/core": "^6.8.0",
"@nestjs/platform-express": "^6.8.0",
"@nestjs/swagger": "^4.8.0",
"@nestjs/typeorm": "^6.2.0",
"joi": "^17.4.0",
"pg": "^7.14.0",
Expand All @@ -35,7 +36,9 @@
"rxjs": "^6.5.3",
"sequelize": "^5.21.2",
"sequelize-typescript": "^1.1.0",
"typeorm": "^0.2.21"
"swagger-ui-express": "^4.1.6",
"typeorm": "^0.2.21",
"tslib": "1.11.2"
},
"devDependencies": {
"@nestjs/cli": "^6.9.1",
Expand Down
2 changes: 2 additions & 0 deletions src/album/album.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { AlbumService } from './album.service';
import { AlbumDTO } from './album.dto';

import { BusinessErrorsInterceptor } from "../interceptors/interceptor";
import { ApiTags } from '@nestjs/swagger';
@Controller('albums')
@ApiTags('albums')
@UseInterceptors(BusinessErrorsInterceptor)
export class AlbumController {
constructor(private readonly albumService: AlbumService) { }
Expand Down
2 changes: 2 additions & 0 deletions src/albumband/albumband.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Controller, UseInterceptors, Post, HttpCode, Param, Get, Put, Body, Del
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { AlbumBandService } from './albumband.service';
import { BandDTO } from '../band/band.dto';
import { ApiTags } from '@nestjs/swagger';

@Controller('albums')
@ApiTags('albums-band')
@UseInterceptors(BusinessErrorsInterceptor)
export class AlbumBandController {

Expand Down
2 changes: 2 additions & 0 deletions src/albummusician/albummusician.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Controller, UseInterceptors, Post, HttpCode, Param, Get, Put, Body, Del
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { AlbumMusicianService } from './albummusician.service';
import { MusicianDTO } from '../musician/musician.dto';
import { ApiTags } from '@nestjs/swagger';

@Controller('albums')
@ApiTags('albums-musicians')
@UseInterceptors(BusinessErrorsInterceptor)
export class AlbumMusicianController {

Expand Down
8 changes: 4 additions & 4 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import { AlbumMusicianModule } from './albummusician/albummusician.module';
imports: [
TypeOrmModule.forRoot({
type: 'postgres',
host: process.env.DATABASE_URL && process.env.DATABASE_URL.replace('postgres://','').split(':')[1].split('@')[1] || process.env.DATABASE_URL || process.env.DB_HOST || 'localhost',
host: process.env.DB_HOST || 'localhost',
port: 5432,
username: process.env.DATABASE_URL && process.env.DATABASE_URL.replace('postgres://','').split(':')[0] || process.env.DB_USER || 'postgres',
password: process.env.DATABASE_URL && process.env.DATABASE_URL.replace('postgres://','').split(':')[1].split('@')[0] || process.env.DB_PASSWORD || 'postgres',
database: process.env.DATABASE_URL && process.env.DATABASE_URL.split('/')[3] || process.env.DB_NAME || 'vinyls',
username: process.env.DB_USER || 'postgres',
password: process.env.DB_PASSWORD || 'postgres',
database: process.env.DB_NAME || 'vinyls',
entities: [Album, CollectorAlbum, Band, Collector, Comment, Musician, Performer, PerformerPrize, Prize, Track,],
dropSchema: true,
synchronize: true,
Expand Down
2 changes: 2 additions & 0 deletions src/band/band.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Controller, UseInterceptors, Get, Param, Post, HttpCode, Body, Put, Del
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { BandService } from './band.service';
import { BandDTO } from './band.dto';
import { ApiTags } from '@nestjs/swagger';

@Controller('bands')
@ApiTags('bands')
@UseInterceptors(BusinessErrorsInterceptor)
export class BandController {
constructor(private readonly bandService: BandService) { }
Expand Down
2 changes: 2 additions & 0 deletions src/bandalbum/bandalbum.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Controller, UseInterceptors, Post, HttpCode, Param, Get, Put, Body, Del
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { BandAlbumService } from './bandalbum.service';
import { AlbumDTO } from '../album/album.dto';
import { ApiTags } from '@nestjs/swagger';

@Controller('bands')
@ApiTags('bands-album')
@UseInterceptors(BusinessErrorsInterceptor)
export class BandAlbumController {

Expand Down
2 changes: 2 additions & 0 deletions src/bandmusician/bandmusician.controller.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Controller, Post, HttpCode, Param, UseInterceptors, Get, Delete } from '@nestjs/common';
import { BandMusicianService } from './bandmusician.service';
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { ApiTags } from '@nestjs/swagger';

@Controller('bands')
@ApiTags('bands-musician')
@UseInterceptors(BusinessErrorsInterceptor)
export class BandMusicianController {

Expand Down
2 changes: 2 additions & 0 deletions src/collector/collector.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Controller, UseInterceptors, Get, Param, Post, HttpCode, Body, Put, Del
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { CollectorService } from './collector.service';
import { CollectorDTO } from './collector.dto';
import { ApiTags } from '@nestjs/swagger';

@Controller('collectors')
@ApiTags('collectors')
@UseInterceptors(BusinessErrorsInterceptor)
export class CollectorController {
constructor(private readonly collectorService: CollectorService) { }
Expand Down
2 changes: 2 additions & 0 deletions src/collectoralbum/collectoralbum.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Controller, Post, HttpCode, Param, Body, UseInterceptors, Get, Put, Del
import { CollectorAlbumDTO } from './collectoralbum.dto';
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { CollectorAlbumService } from './collectoralbum.service';
import { ApiTags } from '@nestjs/swagger';

@Controller('collectors')
@ApiTags('collectors')
@UseInterceptors(BusinessErrorsInterceptor)
export class CollectorAlbumController {

Expand Down
2 changes: 2 additions & 0 deletions src/collectorperformer/collectorperformer.controller.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Controller, Post, HttpCode, Param, UseInterceptors, Get, Delete } from '@nestjs/common';
import { CollectorPerformerService } from './collectorperformer.service';
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { ApiTags } from '@nestjs/swagger';

@Controller('collectors')
@ApiTags('collectors-performer')
@UseInterceptors(BusinessErrorsInterceptor)
export class CollectorPerformerController {
constructor(private readonly collectorPerformerService: CollectorPerformerService) { }
Expand Down
2 changes: 2 additions & 0 deletions src/comment/comment.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Controller, UseInterceptors, Post, HttpCode, Param, Body, Get, Put, Del
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { CommentService } from './comment.service';
import { CommentDTO } from './comment.dto';
import { ApiTags } from '@nestjs/swagger';

@Controller('albums')
@ApiTags('album-comments')
@UseInterceptors(BusinessErrorsInterceptor)
export class CommentController {
constructor(private readonly commentService: CommentService) { }
Expand Down
8 changes: 8 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
const options = new DocumentBuilder()
.setTitle('BackVynils APP')
.setDescription('BackVynils API Docs')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup('api-docs', app, document);
app.enableCors();
await app.listen(process.env.PORT || 3000);
}
Expand Down
2 changes: 2 additions & 0 deletions src/musician/musician.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Controller, UseInterceptors, Get, Param, Post, HttpCode, Body, Put, Del
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { MusicianService } from './musician.service';
import { MusicianDTO } from './musician.dto';
import { ApiTags } from '@nestjs/swagger';

@Controller('musicians')
@ApiTags('musicians')
@UseInterceptors(BusinessErrorsInterceptor)
export class MusicianController {
constructor(private readonly musicianService: MusicianService) { }
Expand Down
3 changes: 2 additions & 1 deletion src/musicianalbum/musicianalbum.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { Controller, UseInterceptors, Post, HttpCode, Param, Get, Put, Body, Del
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { MusicianAlbumService } from './musicianalbum.service';
import { AlbumDTO } from '../album/album.dto';

import { ApiTags } from '@nestjs/swagger';
@Controller('musicians')
@ApiTags('musicians-album')
@UseInterceptors(BusinessErrorsInterceptor)
export class MusicianAlbumController {

Expand Down
2 changes: 2 additions & 0 deletions src/performerprize/performerprize.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Controller, Param, Body, UseInterceptors, Post, HttpCode, Get, Delete }
import { PerformerPrizeService } from './performerprize.service';
import { PerformerPrizeDTO } from './performerprize.dto';
import { BusinessErrorsInterceptor } from '../interceptors/interceptor';
import { ApiTags } from '@nestjs/swagger';

@Controller('prizes')
@ApiTags('prizes-performer')
@UseInterceptors(BusinessErrorsInterceptor)
export class PerformerPrizeController {

Expand Down
2 changes: 2 additions & 0 deletions src/prize/prize.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { BusinessErrorsInterceptor } from "../interceptors/interceptor";

import { PrizeService } from "./prize.service";
import { PrizeDTO } from "./prize.dto"
import { ApiTags } from '@nestjs/swagger';

@Controller('prizes')
@ApiTags('prizes')
@UseInterceptors(BusinessErrorsInterceptor)
export class PrizeController {
constructor(private readonly prizeService: PrizeService) { }
Expand Down
2 changes: 2 additions & 0 deletions src/track/track.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { BusinessErrorsInterceptor } from "../interceptors/interceptor";

import { TrackDTO } from "./track.dto";
import { TrackService } from "./track.service";
import { ApiTags } from '@nestjs/swagger';

@Controller('albums')
@ApiTags('tracks')
@UseInterceptors(BusinessErrorsInterceptor)
export class TrackController {
constructor(private readonly trackService: TrackService) { }
Expand Down