Skip to content

Commit 0c9b7a6

Browse files
authored
Merge pull request #64 from Open-Webtoon-Reader/staging
Merge Staging to Main
2 parents 8dc6149 + c8040aa commit 0c9b7a6

File tree

72 files changed

+2899
-4275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2899
-4275
lines changed

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
npm-debug.log
3+
pnpm-debug.log
4+
.DS_Store
5+
.git
6+
.gitignore
7+
dist
8+
.env
9+
.cache
10+
images

.env.example

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
# Server
2-
SERVER_TYPE="http"
3-
BIND_ADDRESS="0.0.0.0"
4-
HTTP_PORT="3000"
5-
HTTPS_PORT="3001"
6-
7-
# SSL
8-
SSL_KEY_FILE=""
9-
SSL_CERT_FILE=""
10-
111
# API
122
PREFIX="api/v1/"
133

.eslintrc.js

Lines changed: 0 additions & 72 deletions
This file was deleted.

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM node:22-alpine
2+
3+
WORKDIR /app
4+
5+
RUN apk add --no-cache openssl
6+
7+
COPY package*.json pnpm-lock.yaml ./
8+
COPY tsconfig.json ./
9+
10+
RUN npm install -g corepack@latest && corepack enable && pnpm install --frozen-lockfile
11+
12+
COPY prisma ./prisma/
13+
RUN pnpm dlx prisma generate
14+
15+
COPY . .
16+
17+
ENV NODE_ENV=production
18+
19+
RUN pnpm run build
20+
21+
EXPOSE 4000
22+
23+
CMD pnpm dlx prisma migrate deploy && npx prisma db seed && pnpm run start:prod

docker-compose.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
services:
2+
owr-api:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
args:
7+
- DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres
8+
no_cache: true
9+
container_name: owr-api
10+
environment:
11+
- SERVICE_FQDN_OWR_4000
12+
- NODE_ENV=production
13+
- DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres
14+
- FILESYSTEM=${FILESYSTEM:-local}
15+
- ADMIN_KEY=${ADMIN_KEY}
16+
- S3_ENDPOINT=${S3_ENDPOINT}
17+
- S3_PORT=${S3_PORT}
18+
- S3_USE_SSL=${S3_USE_SSL:-true}
19+
- S3_REGION=${S3_REGION}
20+
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
21+
- S3_SECRET_KEY=${S3_SECRET_KEY}
22+
- S3_BUCKET_NAME=${S3_BUCKET_NAME}
23+
- S3_STORAGE_CLASS=${S3_STORAGE_CLASS:-EXPRESS_ONEZONE}
24+
- S3_BATCH_SIZE=${S3_BATCH_SIZE:-45}
25+
expose:
26+
- 4000
27+
depends_on:
28+
- postgres
29+
volumes:
30+
- owr-cache:/app/.cache
31+
- owr-images:/app/images
32+
healthcheck:
33+
test: [ "CMD", "curl", "-f", "http://localhost:4000/version" ]
34+
interval: 30s
35+
timeout: 10s
36+
retries: 3
37+
38+
postgres:
39+
image: postgres:17
40+
container_name: owr-postgres
41+
environment:
42+
- POSTGRES_DB=postgres
43+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
44+
- POSTGRES_USER=postgres
45+
- POSTGRES_PORT=5432
46+
volumes:
47+
- pg-data:/var/lib/postgresql/data
48+
healthcheck:
49+
test: [ "CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}" ]
50+
interval: 30s
51+
timeout: 10s
52+
retries: 3

eslint.config.mjs

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
import stylistic from "@stylistic/eslint-plugin";
2+
import parserTs from "@typescript-eslint/parser";
3+
4+
export default [
5+
{
6+
ignores: ["dist/"],
7+
},
8+
stylistic.configs["recommended-flat"],
9+
{
10+
plugins: {
11+
"@stylistic": stylistic,
12+
},
13+
languageOptions: {
14+
parser: parserTs,
15+
},
16+
files: ["**/*.ts", "**/*.js", "**/*.mjs"],
17+
18+
rules: {
19+
"@stylistic/interface-name-prefix": "off",
20+
"@stylistic/explicit-function-return-type": "off",
21+
"@stylistic/explicit-module-boundary-types": "off",
22+
"@stylistic/no-explicit-any": "off",
23+
"@/lines-between-class-members": [
24+
"error",
25+
{
26+
enforce: [
27+
{
28+
blankLine: "always",
29+
prev: "field",
30+
next: "method",
31+
},
32+
],
33+
},
34+
],
35+
"@/no-unused-vars": [
36+
"error",
37+
{
38+
caughtErrorsIgnorePattern: "^_",
39+
argsIgnorePattern: "^_|Service$",
40+
},
41+
],
42+
"@stylistic/brace-style": [
43+
"error",
44+
"1tbs",
45+
],
46+
"@stylistic/keyword-spacing": [
47+
"error",
48+
{
49+
overrides: {
50+
if: {
51+
before: false,
52+
after: false,
53+
},
54+
else: {
55+
before: false,
56+
after: false,
57+
},
58+
for: {
59+
before: false,
60+
after: false,
61+
},
62+
while: {
63+
before: false,
64+
after: false,
65+
},
66+
do: {
67+
before: false,
68+
after: false,
69+
},
70+
try: {
71+
before: false,
72+
after: false,
73+
},
74+
catch: {
75+
before: false,
76+
after: false,
77+
},
78+
finally: {
79+
before: false,
80+
after: false,
81+
},
82+
},
83+
before: true,
84+
after: true,
85+
},
86+
],
87+
"@stylistic/member-delimiter-style": [
88+
"error",
89+
{
90+
multiline: {
91+
delimiter: "semi",
92+
requireLast: true,
93+
},
94+
singleline: {
95+
delimiter: "semi",
96+
requireLast: true,
97+
},
98+
},
99+
],
100+
"@stylistic/indent": [
101+
"error", 4,
102+
],
103+
"@stylistic/quotes": [
104+
"error",
105+
"double",
106+
],
107+
"@stylistic/semi": [
108+
"error",
109+
"always",
110+
],
111+
"@stylistic/eol-last": [
112+
"error",
113+
"always",
114+
],
115+
"@stylistic/object-curly-spacing": [
116+
"error",
117+
"never",
118+
],
119+
"@stylistic/no-undef": [
120+
"off",
121+
],
122+
"@/func-style": [
123+
"error",
124+
"declaration",
125+
],
126+
"@stylistic/array-bracket-spacing": [
127+
"error",
128+
"never",
129+
],
130+
"@stylistic/space-infix-ops": [
131+
"error",
132+
],
133+
"@stylistic/space-before-function-paren": [
134+
"error",
135+
"never",
136+
],
137+
"@stylistic/space-in-parens": [
138+
"error",
139+
"never",
140+
],
141+
"@stylistic/space-before-blocks": [
142+
"error",
143+
"never",
144+
],
145+
},
146+
},
147+
];

nest-cli.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
{
2-
"$schema": "https://json.schemastore.org/nest-cli",
3-
"collection": "@nestjs/schematics",
4-
"sourceRoot": "src",
5-
"compilerOptions": {
6-
"deleteOutDir": true
7-
}
2+
"$schema": "https://json.schemastore.org/nest-cli",
3+
"collection": "@nestjs/schematics",
4+
"sourceRoot": "src",
5+
"entryFile": "app",
6+
"compilerOptions": {
7+
"deleteOutDir": true,
8+
"plugins": [{
9+
"name": "@nestjs/swagger",
10+
"options": {
11+
"dtoFileNameSuffix": [".dto.ts", ".entity.ts", ".response.ts"],
12+
"introspectComments": true
13+
}
14+
}]
15+
}
816
}

0 commit comments

Comments
 (0)