Skip to content
Merged
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
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Issue Template
about: 이슈 템플릿
title: ''
labels: ''
assignees: ''
---

## 💫 이슈 설명

-

## 🫡 예상 구현/해결 방법

-

## ⏳ 예상 마감 기한

-

## 📚 참고 사항

-
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ✅ PR List

## 💫 관련 이슈

> close #(이슈 번호) 표시
> 해결하고자 한 문제점, 구현 기능 등 추가적인 설명 또는 체크리스트 (선택)

- [ ]

## 📝 핵심 작업 내용

> 주요 변경 사항이나 핵심 코드에 대한 간단한 설명

## 🔍 기타 변경 사항

> 핵심 작업 내용 이외의 변경된 사항

## ✨ 동작 확인

> 스크린 샷, 화면 녹화 등

## 🙏 리뷰 요구 사항

> 리뷰어들이 특별히 봐주었으면 하는 부분
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PR test

on:
pull_request: # Pull Request 생성 또는 업데이트 시 트리거
branches:
- develop # develop 브랜치로의 PR에 대해서만 트리거
workflow_dispatch: # 수동 실행 가능하도록 추가

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

# 의존성 설치
- name: Install dependencies
run: yarn install

# Prisma Client 생성 검사
- name: Test prisma generate
run: yarn prisma generate

# 프로젝트 빌드 검사
- name: Test build
run: yarn build

# 타입 오류 검사
- name: Test type error
run: yarn tsc --noEmit
127 changes: 127 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.*

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
3 changes: 3 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require("gts/.prettierrc.json"),
};
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"javascript.preferences.importModuleSpecifierEnding": "js",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}

6 changes: 6 additions & 0 deletions @types/environment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare namespace NodeJS {
export interface ProcessEnv extends NodeJS.ProcessEnv {
PORT: string;
DATABASE_URL: string;
}
}
14 changes: 14 additions & 0 deletions @types/express.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'express';

declare global {
namespace Express {
export interface Response {
success(success: any): this;
error(error: {
errorCode?: string;
reason?: string | null;
data?: any | null;
}): this;
}
}
}
32 changes: 32 additions & 0 deletions config/tsoa.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"noImplicitAdditionalProperties": "throw-on-extras",
"entryFile": "src/app.ts",
"controllerPathGlobs": ["src/controllers/*.controller.ts"],
"spec": {
"outputDirectory": "./swagger",
"specVersion": 3,
"validate": true,
"spec": {
"servers": [
{
"url": "http://localhost:3000",
"description": "local server"
}
]
},
"securityDefinitions": {
"sessionAuth": {
"type": "apiKey",
"in": "cookie",
"name": "connect.sid"
}
},
"security": [{"sessionAuth": []}]
},
"routes": {
"routesDir": "./src/routers",
"middleware": "express",
"routesFileName": "tsoaRoutes.ts",
"esm": true
}
}
44 changes: 44 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default [
{
ignores: [
'node_modules',
'scripts',
'tsconfig.json',
'eslint.config.js',
'dist',
],
},
{
files: ['**/*.ts', '**/*.js'],
languageOptions: {
parser: tseslint.parser, // TypeScript 파서
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
project: './tsconfig.json', // tsconfig.json 경로 추가
},
},
plugins: {
'@typescript-eslint': tseslint.plugin, // 플러그인을 객체로 추가
},
rules: {
semi: ['error', 'always'],
quotes: ['error', 'single'],
'@typescript-eslint/no-namespace': 'off', // namespace 허용
'@typescript-eslint/no-explicit-any': 'warn', // 명시적 any 사용 경고
'@typescript-eslint/no-unused-vars': 'error', // 사용하지 않는 변수 금지
'no-console': 'warn', // console 사용 경고
'prefer-const': 'warn', // let 대신 const 사용 권장
'prefer-template': 'warn', // 문자열 연결 대신 템플릿 리터럴 사용 권장
'no-shadow': 'warn', // 외부 변수와 중복 변수 선언 경고
eqeqeq: ['error', 'always'], // == 대신 === 사용 권장
'no-duplicate-imports': 'error', // 중복 import 경고
'no-var': 'error', // var 사용 금지
'no-undef': 'off', // 선언되지 않은 변수 사용 일시적 허용 (로컬 테스트)
'no-const-assign': 'error', // const 재할당 금지
},
},
];
54 changes: 54 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "Server",
"type": "module",
"version": "1.0.0",
"description": "25-1 Capstone Server",
"main": "app.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node dist/app.cjs",
"build": "tsx scripts/build.ts",
"dev": "nodemon -e js,json,prisma,ts --exec \"prisma generate && tsx src/app.ts\"",
"lint": "gts lint",
"compile": "tsc",
"fix": "gts fix",
"prepare": "yarn run compile",
"pretest": "yarn run compile",
"posttest": "yarn run lint",
"swagger": "tsx swagger/swagger.ts",
"tsoa-swagger": "tsoa spec -c ./config/tsoa.json",
"tsoa-routes": "tsoa routes -c ./config/tsoa.json",
"clean": "gts clean"
},
"repository": "https://github.com/asjasj3964/Server.git",
"author": "asjasj3964 <[email protected]>",
"license": "ISC",
"dependencies": {
"@prisma/client": "^6.1.0",
"@tsoa/runtime": "^6.6.0",
"cors": "^2.8.5",
"dotenv": "^16.4.7",
"express": "^5.0.0-0",
"http-status-codes": "^2.3.0",
"prisma": "^6.1.0",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1"
},
"devDependencies": {
"@tsconfig/node20": "^20.1.4",
"@types/cors": "^2.8.17",
"@types/express": "^5.0.0",
"@types/node": "^22.7.5",
"@types/swagger-jsdoc": "^6.0.4",
"@types/swagger-ui-express": "^4.1.7",
"esbuild": "^0.24.2",
"esbuild-plugin-copy": "^2.1.1",
"eslint": "^9.17.0",
"gts": "^6.0.2",
"nodemon": "^3.1.9",
"tsoa": "^6.6.0",
"tsx": "^4.19.2",
"typescript": "^5.6.3",
"typescript-eslint": "^8.23.0"
}
}
Loading