Implement backend API and database services in Docker setup

- Added a new `api` service for the NestJS backend, including health checks and dependencies on PostgreSQL, Redis, and MinIO.
- Introduced PostgreSQL and Redis services with health checks and configurations for data persistence.
- Added MinIO for S3-compatible object storage and a one-shot service to initialize required buckets.
- Updated the Nginx configuration to proxy requests to the new backend API and MinIO storage.
- Enhanced the Dockerfile to support the new API environment variables and configurations.
- Updated the `package.json` and `package-lock.json` to include new dependencies for QR code generation and other utilities.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Dorian
2026-02-12 20:14:39 +00:00
parent f19fd6feef
commit cdd24a5def
478 changed files with 55355 additions and 529 deletions

View File

@@ -0,0 +1,17 @@
import { Controller, Get, UseGuards } from '@nestjs/common';
import { HybridAuthGuard } from 'src/auth/guards/hybrid-auth.guard';
import { AwardIssuersService } from './award-issuers.service';
import { AwardIssuerDTO } from './dto/response/award-issuer.dto';
@Controller('award-issuers')
@UseGuards(HybridAuthGuard)
export class AwardIssuersController {
constructor(private readonly issuersService: AwardIssuersService) {}
@Get()
async findAll() {
const issuers = await this.issuersService.findAll();
return issuers.map((issuer) => new AwardIssuerDTO(issuer));
}
}

View File

@@ -0,0 +1,12 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AwardIssuer } from './entities/award-issuer.entity';
import { AwardIssuersController } from './award-issuers.controller';
import { AwardIssuersService } from './award-issuers.service';
@Module({
imports: [TypeOrmModule.forFeature([AwardIssuer])],
controllers: [AwardIssuersController],
providers: [AwardIssuersService],
})
export class AwardIssuersModule {}

View File

@@ -0,0 +1,16 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { AwardIssuer } from './entities/award-issuer.entity';
@Injectable()
export class AwardIssuersService {
constructor(
@InjectRepository(AwardIssuer)
private issuersRepository: Repository<AwardIssuer>,
) {}
findAll() {
return this.issuersRepository.find();
}
}

View File

@@ -0,0 +1,11 @@
import { AwardIssuer } from 'src/award-issuers/entities/award-issuer.entity';
export class AwardIssuerDTO {
id: string;
name: string;
constructor(awardIssuer: AwardIssuer) {
this.id = awardIssuer.id;
this.name = awardIssuer.name;
}
}

View File

@@ -0,0 +1,27 @@
import { Award } from 'src/projects/entities/award.entity';
import {
Column,
CreateDateColumn,
Entity,
OneToMany,
PrimaryColumn,
UpdateDateColumn,
} from 'typeorm';
@Entity('award_issuers')
export class AwardIssuer {
@PrimaryColumn()
id: string;
@Column()
name: string;
@CreateDateColumn({ type: 'timestamptz' })
createdAt: Date;
@UpdateDateColumn({ type: 'timestamptz' })
updatedAt: Date;
@OneToMany(() => Award, (award) => award.issuer)
awards: Award[];
}