Skip to content

Commit

Permalink
Server/feature/#63 (#64)
Browse files Browse the repository at this point in the history
* [Server] 개발환경 세팅 (#4)

* build: open-list-server init

* chore: @nestjs/config class-validator class-transformer 설치

* chore: 루트 레벨에서 설치한 패키지 삭제

* chore: NestJs 개발 환경 세팅

* chore: @nestjs/config class-validator class-transformer 설치

* Server/feature/#13 (#25)

* chore: postgresql, nestjs docker 세팅

* chore: @nestjs/typeorm, typeorm, pg 설치

* chore: Typeorm 세팅 및 TestModel 테이블 생성

* 테스트용 유저 API 구현 (#30)

* chore: common resource 추가

* chore: users resource 추가

* feature: base entity 구현

* feature: usersEntity 구현

* feature: 모듈에 usersModel 추가

* style: entity,dto의 users -> user로 변경

* feature: CreateUserDto 구현

* feature: userEntity 이메일 필드 추가

* feature: createUserDto 이메일 필드 추가

* feature: user patch->put으로 변경

* feature: updateUserDto 구현

* feature : create user 구현

* feature: 모든 유저의 정보를 가져오는 API 구현

* feature: 특정 유저의 정보를 가져오는 API 구현

* feature: user 정보 수정 API 구현

* feature: user 삭제 API 구현

* feature: ValidationPipe 적용

* refactor: usersService 리팩토링

* [Server] 유닛 테스트 환경 세팅 (#32)

* chore: test 경로 설정

* feature: TestCommonModule 구현

* feature: users.service.spec.ts 의존성 주입

* feature: users.controller.spec.ts 의존성 주입

* [Server] Users resource 이름 변경 (#34)

* style: usersController 네이밍에 컨벤션 맞게 변경

* style: usersService 컨벤션에 따른 네이밍 변경

* style: UsersModel -> UserModel 컨벤션에 따른 네이밍 변경

* feature: usersService 테스트 코드 작성 (#39)

* [Server] Folder entity 생성 및 crud 구현 (#42)

* feat: folders crud 구현

* chore: TestModel 삭제 및 관련된 종속성 제거

* feat: folders.controller.spec.ts 삭제, folders.service.spec.ts 구현

* feature: docker파일 수정 (#57)

* feat: private checklist entity 생성 및 crud 구현 (#61)

* chore: 개발용 postgres 포트변경 5432->5433, .env도 port 5433으로 변경필요

* feat: checklists res 생성

* feat: checklist, private-checklist, shared-checklisst 엔티티 생성, user모델과 folder모델과의 의존관계 주입

* feat: author->editor로 수정, 공유체크리스트와 사용자의 relation을 many to many로 업데이트

* feat: 개인, 공유 체크리스트에 대해 생성과 업데이트 시 dto 생성

* fix: class 이름 오타 수정

* refactor: rest api 방식에 따라 함수명 변경

* feat: CheckListModel에서 진행률 컬럼 삭제

* feat: folder와 user간의 manyToOne relation적용

* feat: private-checklist crud 작성

* feat: folder service 커버리지 100 달성

* test: private-checklist test code 작성, 커버리지 92퍼센트

* feat: GET / :src/public 내 정적인 파일 서빙

---------

Co-authored-by: YangDongsuk <[email protected]>
  • Loading branch information
pminsung12 and yangdongsuk authored Nov 21, 2023
1 parent 71fca9a commit 2f1e822
Show file tree
Hide file tree
Showing 57 changed files with 7,525 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 디폴트 무시된 파일
/.idea/shelf/
/.idea/workspace.xml
# 에디터 기반 HTTP 클라이언트 요청
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

/.idea
4 changes: 4 additions & 0 deletions server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.gitignore
Dockerfile
node_modules
dist
25 changes: 25 additions & 0 deletions server/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
38 changes: 38 additions & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# compiled output
/dist
/node_modules

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

.env
postgres-data
4 changes: 4 additions & 0 deletions server/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
14 changes: 14 additions & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:18
RUN mkdir -p /app
WORKDIR /app
ADD . /app/

RUN rm yarn.lock || true
RUN rm package-lock.json || true
RUN yarn
RUN yarn build

ENV HOST 0.0.0.0
EXPOSE 3000

CMD [ "yarn", "start"]
73 changes: 73 additions & 0 deletions server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
</p>

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

## Installation

```bash
$ yarn install
```

## Running the app

```bash
# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod
```

## Test

```bash
# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov
```

## Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).

## Stay in touch

- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Nest is [MIT licensed](LICENSE).
30 changes: 30 additions & 0 deletions server/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3.8'
services:
postgresql_db:
image: postgres:15
restart: always
volumes:
- ./postgres-data:/var/lib/postgresql/data
ports:
- '5433:5432'
environment:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}

nestjs_server:
build: .
ports:
- '3000:3000'
depends_on:
- postgresql_db
environment:
JWT_SECRET: ${JWT_SECRET}
HASH_ROUNDS: ${HASH_ROUNDS}
PROTOCOL: ${PROTOCOL}
HOST: ${HOST}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
8 changes: 8 additions & 0 deletions server/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
80 changes: 80 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"name": "server",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"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"
},
"dependencies": {
"@nestjs/common": "^10.0.0",
"@nestjs/config": "^3.1.1",
"@nestjs/core": "^10.0.0",
"@nestjs/mapped-types": "*",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/typeorm": "^10.0.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"pg": "^8.11.3",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"typeorm": "^0.3.17"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
"prettier": "^3.0.0",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.1.3"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"moduleNameMapper": {
"^src/(.*)$": "<rootDir>/$1",
"^test/(.*)$": "<rootDir>/../test/$1"
},
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
64 changes: 64 additions & 0 deletions server/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html>
<head>
<title>Download OpenList</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<script src="https://kit.fontawesome.com/95a02bd20d.js"></script>

<div class="container">
<!-- <div class="card">
<div class="face face1">
<div class="content">
<i class="fab fa-windows"></i>
<h3>Windows</h3>
</div>
</div>
<div class="face face2">
<div class="content">
<p> Lorem ipsum dolor sit amet consectetur adipisicing elit. Unde ab repudiandae, explicabo voluptate et hic cum ratione a. Officia delectus illum perferendis maiores quia molestias vitae fugiat aspernatur alias corporis?</p>
<a href="#" type="button">Read More</a>
</div>
</div>
</div>
<div class="card">
<div class="face face1">
<div class="content">
<i class="fab fa-android"></i> <h3>Android</h3>
</div>
</div>
<div class="face face2">
<div class="content">
<p> Lorem ipsum dolor sit amet consectetur adipisicing elit. Unde ab repudiandae, explicabo voluptate et hic cum ratione a. Officia delectus illum perferendis maiores quia molestias vitae fugiat aspernatur alias corporis?</p>
<a href="#" type="button">Read More</a>
</div>
</div>
</div> -->


<div class="card">
<div class="face face1">
<div class="content">
<i class="fab fa-apple"></i>
<h3>Apple</h3>
</div>
</div>
<div class="face face2">
<div class="content">
relaease 0.1.0
<a href="itms-services://?action=download-manifest&url=https://openlist.kro.kr/app/manifest.plist" type="button">Download</a>
</div>
</div>
</div>






</div>

</body>
</html>
Loading

0 comments on commit 2f1e822

Please sign in to comment.