Skip to content

Commit

Permalink
Merge branch 'main' into renovate/cmdk-1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jimin9038 authored May 6, 2024
2 parents 61770fe + b6a990b commit 5c84331
Show file tree
Hide file tree
Showing 38 changed files with 1,093 additions and 1,025 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
set -a
source .env.development
source .env.stage
set +a
12 changes: 6 additions & 6 deletions .github/workflows/cd-dev.yml → .github/workflows/cd-stage.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CD - Development
name: CD - Stage

on:
push:
Expand Down Expand Up @@ -76,18 +76,18 @@ jobs:
tags: ghcr.io/${{ github.repository_owner }}/codedang-iris:latest

run-server:
name: Run development server
name: Run stage server
runs-on: self-hosted
needs: [build-client-api, build-admin-api, build-iris]
environment: development
environment: stage
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: |
docker-compose.yml
scripts/deploy.sh
.env.development
.env.stage
apps/infra/stage/Caddyfile
grafana-logs/promtail/promtail-config.yml
Expand Down Expand Up @@ -143,8 +143,8 @@ jobs:

- name: Run Bruno Collection (Client)
working-directory: ./collection/client
run: bru run --env development
run: bru run --env stage

- name: Run Bruno Collection (Admin)
working-directory: ./collection/admin
run: bru run --env development
run: bru run --env stage
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ jobs:
- name: Load Next.js environment
if: ${{ matrix.target == 'frontend' }}
run: |
echo "NEXT_PUBLIC_BASEURL=https://dev-aws.codedang.com/api" >> apps/frontend/.env
echo "NEXT_PUBLIC_GQL_BASEURL=https://dev-aws.codedang.com/graphql" >> apps/frontend/.env
echo "NEXT_URL=https://dev.codedang.com" >> apps/frontend/.env
echo "NEXT_PUBLIC_BASEURL=https://stage.codedang.com/api" >> apps/frontend/.env
echo "NEXT_PUBLIC_GQL_BASEURL=https://stage.codedang.com/graphql" >> apps/frontend/.env
echo "NEXT_URL=https://stage.codedang.com" >> apps/frontend/.env
- name: Build (backend admin)
if: ${{ matrix.target == 'backend-admin' }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/reset-seed.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Reset Seed (Development)
name: Reset Seed (Stage)

on: workflow_dispatch

Expand All @@ -7,8 +7,8 @@ jobs:
name: Reset Seed
runs-on: self-hosted
steps:
- name: Load DATABASE_URL From Existing .env.development
run: export DATABASE_URL=$(grep "^DATABASE_URL=" .env.development | cut -d '=' -f2)
- name: Load DATABASE_URL From Existing .env.stage
run: export DATABASE_URL=$(grep "^DATABASE_URL=" .env.stage | cut -d '=' -f2)

- name: Run Reset Seed Command
run: docker exec backend-client npx prisma migrate reset -f
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dist/
.env.test.local
.env.production.local
.env.local
.env.stage.local

# Ignore all local history of files
.history
Expand Down Expand Up @@ -137,3 +138,7 @@ go.work
# nyc files
.nyc_output
coverage

*.pkg


2 changes: 1 addition & 1 deletion apollo.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
excludes: ['**/__generated__/**'],
service: {
name: 'codedang-graphql-app',
url: 'https://dev.codedang.com/graphql'
url: 'https://stage.codedang.com/graphql'
}
}
}
3 changes: 2 additions & 1 deletion apps/backend/libs/logger/src/pino-option.logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const pinoLoggerModuleOption: Params = {
req.body = req.raw?.body
return req
}
}
},
redact: ['req.body.password']
}
}
46 changes: 23 additions & 23 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
},
"dependencies": {
"@apollo/server": "^4.10.4",
"@aws-sdk/client-s3": "^3.556.0",
"@aws-sdk/client-ses": "^3.556.0",
"@aws-sdk/credential-provider-node": "^3.556.0",
"@aws-sdk/client-s3": "^3.567.0",
"@aws-sdk/client-ses": "^3.567.0",
"@aws-sdk/credential-provider-node": "^3.567.0",
"@golevelup/nestjs-rabbitmq": "^5.3.0",
"@nestjs-modules/mailer": "^1.11.2",
"@nestjs/apollo": "^12.1.0",
Expand All @@ -36,29 +36,29 @@
"@nestjs/platform-express": "^10.3.8",
"@nestjs/swagger": "^7.3.1",
"@opentelemetry/api": "~1.8.0",
"@opentelemetry/exporter-metrics-otlp-http": "^0.50.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.50.0",
"@opentelemetry/host-metrics": "^0.35.0",
"@opentelemetry/instrumentation-express": "^0.37.0",
"@opentelemetry/instrumentation-http": "^0.50.0",
"@opentelemetry/resources": "^1.23.0",
"@opentelemetry/sdk-metrics": "^1.23.0",
"@opentelemetry/sdk-node": "^0.50.0",
"@opentelemetry/sdk-trace-node": "^1.23.0",
"@opentelemetry/semantic-conventions": "^1.23.0",
"@prisma/client": "^5.12.1",
"@prisma/instrumentation": "~5.12.1",
"@opentelemetry/exporter-metrics-otlp-http": "^0.51.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.51.0",
"@opentelemetry/host-metrics": "^0.35.1",
"@opentelemetry/instrumentation-express": "^0.38.0",
"@opentelemetry/instrumentation-http": "^0.51.0",
"@opentelemetry/resources": "^1.24.0",
"@opentelemetry/sdk-metrics": "^1.24.0",
"@opentelemetry/sdk-node": "^0.51.0",
"@opentelemetry/sdk-trace-node": "^1.24.0",
"@opentelemetry/semantic-conventions": "^1.24.0",
"@prisma/client": "^5.13.0",
"@prisma/instrumentation": "~5.13.0",
"argon2": "^0.40.1",
"axios": "^1.6.8",
"cache-manager": "^5.5.1",
"cache-manager": "^5.5.2",
"cache-manager-redis-yet": "^5.0.0",
"chai-exclude": "^2.1.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"colorette": "^2.0.20",
"cookie-parser": "^1.4.6",
"cross-env": "^7.0.3",
"dayjs": "^1.11.10",
"dayjs": "^1.11.11",
"exceljs": "^4.4.0",
"generate-password": "^1.7.1",
"graphql": "^16.8.1",
Expand All @@ -75,8 +75,8 @@
"pino-http": "^9.0.0",
"pino-pretty": "^11.0.0",
"reflect-metadata": "^0.2.1",
"sql-formatter": "^15.3.0",
"zod": "^3.23.3"
"sql-formatter": "^15.3.1",
"zod": "^3.23.5"
},
"devDependencies": {
"@faker-js/faker": "^8.4.1",
Expand All @@ -85,21 +85,21 @@
"@nestjs/schematics": "^10.1.1",
"@nestjs/testing": "^10.3.8",
"@types/cache-manager": "^4.0.6",
"@types/chai": "^4.3.14",
"@types/chai": "^4.3.15",
"@types/chai-as-promised": "^7.1.8",
"@types/express": "^4.17.21",
"@types/graphql-upload": "8.0.12",
"@types/mocha": "^10.0.6",
"@types/node": "^20.12.7",
"@types/nodemailer": "^6.4.14",
"@types/node": "^20.12.8",
"@types/nodemailer": "^6.4.15",
"@types/passport-jwt": "^4.0.1",
"@types/proxyquire": "^1.3.31",
"@types/sinon": "^17.0.3",
"chai": "^4.4.1",
"chai-as-promised": "^7.1.1",
"mocha": "^10.4.0",
"nyc": "^15.1.0",
"prisma": "^5.12.1",
"prisma": "^5.13.0",
"prisma-nestjs-graphql": "^20.0.2",
"proxyquire": "^2.1.3",
"sinon": "^17.0.1",
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/app/(main)/_components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { IoIosLink } from 'react-icons/io'
import { RiGithubFill } from 'react-icons/ri'
import { RiKakaoTalkFill } from 'react-icons/ri'
import { TbMailFilled } from 'react-icons/tb'
import { TbMail } from 'react-icons/tb'
import { toast } from 'sonner'

export default function Footer() {
Expand Down Expand Up @@ -33,7 +33,7 @@ export default function Footer() {
size="27"
/>
</a>
<TbMailFilled
<TbMail
onClick={copyToClipboard}
className="cursor-pointer hover:text-gray-500"
size="27"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export default async function Contest({
contest.status.toLowerCase() === type.toLowerCase()
)

data.sort((a, b) => +new Date(a.startTime) - +new Date(b.startTime))

const contestChunks = []
for (let i = 0; i < data.length; i += 3)
contestChunks.push(data.slice(i, i + 3))
Expand Down
49 changes: 26 additions & 23 deletions apps/frontend/app/admin/_components/GroupSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
Command,
CommandEmpty,
CommandGroup,
CommandItem
CommandItem,
CommandList
} from '@/components/ui/command'
import {
Popover,
Expand Down Expand Up @@ -56,28 +57,30 @@ export default function GroupSelect() {
</PopoverTrigger>
<PopoverContent className="mx-2 w-48 p-0 font-semibold">
<Command>
<CommandEmpty>No group found.</CommandEmpty>
<CommandGroup>
{groups.map((framework) => (
<CommandItem
key={framework.id}
value={framework.id}
className="text-slate-600"
onSelect={(currentValue) => {
setValue(currentValue === value ? '' : currentValue)
setOpen(false)
}}
>
<Check
className={cn(
'mr-2 h-4 w-4',
value === framework.id ? 'opacity-100' : 'opacity-0'
)}
/>
{framework.label}
</CommandItem>
))}
</CommandGroup>
<CommandList>
<CommandEmpty>No group found.</CommandEmpty>
<CommandGroup>
{groups.map((framework) => (
<CommandItem
key={framework.id}
value={framework.id}
className="text-slate-600"
onSelect={(currentValue) => {
setValue(currentValue === value ? '' : currentValue)
setOpen(false)
}}
>
<Check
className={cn(
'mr-2 h-4 w-4',
value === framework.id ? 'opacity-100' : 'opacity-0'
)}
/>
{framework.label}
</CommandItem>
))}
</CommandGroup>
</CommandList>
</Command>
</PopoverContent>
</Popover>
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { CodegenConfig } from '@graphql-codegen/cli'

const config: CodegenConfig = {
schema:
process.env.NEXT_PUBLIC_GQL_BASEURL ?? 'https://dev.codedang.com/graphql',
process.env.NEXT_PUBLIC_GQL_BASEURL ?? 'https://stage.codedang.com/graphql',
// this assumes that all your source files are in a top-level `src/` directory - you might need to adjust this to your file structure
documents: ['./**/*.{ts,tsx}'],
generates: {
Expand Down
29 changes: 16 additions & 13 deletions apps/frontend/components/CheckboxSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
Command,
CommandEmpty,
CommandGroup,
CommandItem
CommandItem,
CommandList
} from '@/components/ui/command'
import {
Popover,
Expand Down Expand Up @@ -91,18 +92,20 @@ export default function LanguageSelect<T extends string>({

<PopoverContent className="w-[115px] p-0" align="start">
<Command>
<CommandEmpty>No language found.</CommandEmpty>
<CommandGroup>
{options.map((option) => (
<CommandItem key={option} value={option} className="gap-x-2">
<Checkbox
checked={selectedValues.includes(option)}
onCheckedChange={() => handleCheckboxChange(option)}
></Checkbox>
{option}
</CommandItem>
))}
</CommandGroup>
<CommandList>
<CommandEmpty>No language found.</CommandEmpty>
<CommandGroup>
{options.map((option) => (
<CommandItem key={option} value={option} className="gap-x-2">
<Checkbox
checked={selectedValues.includes(option)}
onCheckedChange={() => handleCheckboxChange(option)}
></Checkbox>
{option}
</CommandItem>
))}
</CommandGroup>
</CommandList>
</Command>
</PopoverContent>
</Popover>
Expand Down
Loading

0 comments on commit 5c84331

Please sign in to comment.