Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b7febb2
:heavy_plus_sign: add prisma
Anon-136 May 24, 2023
e6b3e02
:recycle: migrate user and auth to prisma
Anon-136 May 24, 2023
45fe942
:recycle: migrate submission and user module
Anon-136 May 25, 2023
9333048
:recycle: migrate problem module
Anon-136 May 25, 2023
a028062
:recycle: migrate contest module
Anon-136 Jul 9, 2023
b724829
:recycle: migrate chat module
Anon-136 Jul 9, 2023
5ed4b3e
:recycle: migrate announcement module
Anon-136 Jul 9, 2023
a88398e
:recycle: migrate create user function
Anon-136 Jul 9, 2023
dfd57a3
:fire: remove sequalize ts, providers, and entities
Anon-136 Jul 9, 2023
62543e7
:bug: change return of create user function
Anon-136 Jul 9, 2023
dd568b7
:heavy_plus_sign: :arrow_up: add ts-rest and fix types
Anon-136 Jul 10, 2023
280050c
:sparkles: add ts-rest open-api
Anon-136 Jul 10, 2023
e050242
:sparkles: migrate announcement module
Anon-136 Jul 11, 2023
0b44201
:sparkles: migrate chat module
Anon-136 Jul 12, 2023
5b02426
:sparkles: migrate submission module
Anon-136 Jul 13, 2023
6ea84e8
:sparkles: migrate contest and user module
Anon-136 Jul 13, 2023
4fe25dd
:sparkles: migrate problem module
Anon-136 Jul 13, 2023
59910dc
:sparkles: migrate auth module
Anon-136 Jul 13, 2023
0078a63
:sparkles: migrate app module
Anon-136 Jul 13, 2023
12696de
:fire: remove method controller
Anon-136 Jul 13, 2023
f2db90c
:art: format prisma file
Anon-136 Jul 13, 2023
6f9dae4
:package: use pnpm instead of yarn and upgrade packages
Anon-136 Jul 13, 2023
716adb0
Merge branch 'main'
Anon-136 Jul 14, 2023
b202a3b
:wrench: add database url template
Anon-136 Jul 14, 2023
3172844
:fire: remove duplicated code
Anon-136 Jul 14, 2023
6170c41
:label: fix export contract type
Anon-136 Feb 19, 2024
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
4 changes: 3 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ USE_S3=false
S3_REGION=
S3_ENDPOINT=
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_SECRET_ACCESS_KEY=

DATABASE_URL=
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
generated/
node_modules/
13 changes: 8 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.tabSize": 2
}
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.tabSize": 2,
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
}
}
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
FROM node:14-alpine As build

FROM node:16-alpine As base
RUN npm i -g pnpm
WORKDIR /usr/src/app

COPY ["package.json", "yarn.lock", "./"]

RUN yarn install --frozen-lockfile
COPY ["package.json", "pnpm-lock.yaml", "./"]
RUN pnpm install --frozen-lockfile

FROM base as build
ENV NODE_ENV production

COPY . .

RUN yarn build
RUN pnpm generate
RUN pnpm build

FROM build as prod-deps
# Prune unused dependencies
RUN npm prune --production
RUN pnpm prune --prod

FROM node:14-alpine
FROM base AS production

USER node

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ First, run the database using docker
docker compose -f docker-compose.dev.yml up -d
```

Then, run yarn to install dependencies
Then, run pnpm to install dependencies

```bash
yarn
pnpm i
```

Use `.env.template` to setup your local environment
Expand All @@ -61,7 +61,7 @@ Copy and rename it to `.env.dev`
After that, run the dev server

```bash
yarn start:dev
pnpm dev
```

## Bug Report
Expand Down
43 changes: 27 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"dev": "pnpm start:dev",
"start:dev": "cross-env NODE_ENV=development nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "cross-env NODE_ENV=production node dist/main",
Expand All @@ -19,7 +20,7 @@
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"prepare": "husky install"
"generate": "prisma generate --schema=./src/prisma/schema.prisma"
},
"dependencies": {
"@nestjs/common": "^8.2.1",
Expand All @@ -28,9 +29,13 @@
"@nestjs/jwt": "^8.0.0",
"@nestjs/passport": "^8.0.1",
"@nestjs/platform-express": "^8.2.1",
"@nestjs/platform-socket.io": "^8.2.1",
"@nestjs/platform-socket.io": "^10.0.5",
"@nestjs/swagger": "^5.1.4",
"@nestjs/websockets": "^8.2.1",
"@nestjs/websockets": "^10.0.5",
"@prisma/client": "4.11.0",
"@ts-rest/core": "^3.26.3",
"@ts-rest/nest": "^3.26.3",
"@ts-rest/open-api": "^3.26.3",
"@types/passport-jwt": "^3.0.3",
"aws-sdk": "^2.1347.0",
"cookie-parser": "^1.4.5",
Expand All @@ -45,36 +50,38 @@
"passport-local": "^1.0.0",
"pg": "^8.7.1",
"pg-hstore": "^2.3.4",
"prisma": "4.11.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7",
"sequelize": "^6.29.1",
"sequelize-typescript": "^2.1.0",
"rxjs": "^7.8.1",
"socket.io": "^4.7.1",
"swagger-ui-express": "^4.1.6",
"unzipper": "^0.10.11",
"uuid": "^8.3.2"
"uuid": "^8.3.2",
"zod": "3.21.1",
"zod-prisma-types": "^2.7.4"
},
"devDependencies": {
"@nestjs/cli": "^8.1.4",
"@nestjs/schematics": "^8.0.5",
"@nestjs/testing": "^8.2.1",
"@types/cookie-parser": "^1.4.2",
"@types/estree": "^1.0.1",
"@types/express": "^4.17.8",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^26.0.15",
"@types/mime-types": "^2.1.1",
"@types/multer": "^1.4.5",
"@types/mv": "^2.1.2",
"@types/node": "^14.14.6",
"@types/node": "^18.11.9",
"@types/passport-local": "^1.0.33",
"@types/socket.io": "^3.0.2",
"@types/supertest": "^2.0.10",
"@types/unzipper": "^0.10.3",
"@types/uuid": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"cross-env": "^7.0.3",
"eslint": "^7.30.0",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^7.0.0",
Expand All @@ -83,10 +90,10 @@
"prettier": "^2.3.2",
"supertest": "^6.0.0",
"ts-jest": "^26.4.3",
"ts-loader": "^8.0.8",
"ts-node": "^9.0.0",
"tsconfig-paths": "^3.9.0",
"typescript": "^4.3.5"
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "~4.9.5"
},
"jest": {
"moduleFileExtensions": [
Expand All @@ -110,5 +117,9 @@
"eslint --fix"
],
"*.{js,jsx,ts,tsx,json}": "prettier --write"
},
"engines": {
"node": "^16.20",
"pnpm": ">=8"
}
}
Loading