Skip to content

Commit

Permalink
[#1] initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
le2sky committed Feb 25, 2022
0 parents commit e30c811
Show file tree
Hide file tree
Showing 21 changed files with 17,297 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
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',
},
};
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"tabWidth": 2,
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all",
"useTabs": false,
"semi": true,
"bracketSpacing": true,
"arrowParens": "always"
}
50 changes: 50 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
language: generic

sudo: required

services:
- docker

jobs:
include:
- name: development server deployment
if: branch = develop
before_install:
- docker build -t le2sky/oleunaelim/server-test-app -f ./docker/Dockerfile.dev
script:
- docker run -e CI=true le2sky/oleunaelim/server-test-app npm test
after_success:
- docker build -t le2sky/oleunaelim-develop-server -f ./docker/Dockerfile.dev

- echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_ID" --password-stdin

- docker push le2sky/oleunaelim-develop-server

- mv ./docker/docker-compose.dev.yml ./docker-compose.yml
deploy:
provider: elasticbeanstalk
region: 'ap-northeast-2'
app: 'oleunaelim-test-server'
env: 'oleunaelim-test-server-env'
bucket_name: elasticbeanstalk-ap-northeast-2-315199840269
bucket_path: 'oleunaelim-test-server'
on:
branch: develop

access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_ACCESS_KEY

- name: production server deployment
if: branch = main
before_install:
- docker build -t le2sky/oleunaelim/server-test-app -f ./docker/Dockerfile
script:
- docker run -e CI=true le2sky/oleunaelim/server-test-app npm test
after_success:
- docker build -t le2sky/oleunaelim-production-server -f ./docker/Dockerfile

- echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_ID" --password-stdin

- docker push le2sky/oleunaelim-production-server

- mv ./docker/docker-compose.prod.yml ./docker-compose.yml
73 changes: 73 additions & 0 deletions 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_text.svg" width="320" 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
$ npm install
```

## Running the app

```bash
# development
$ npm run start

# watch mode
$ npm run start:dev

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

## Test

```bash
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm 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).
15 changes: 15 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:14.18.1

WORKDIR /app

COPY package.json .

RUN npm install -g cross-env

RUN npm install

COPY . .

RUN npm run build

CMD npm run start:prod
15 changes: 15 additions & 0 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:14.18.1

WORKDIR /app

COPY package.json .

RUN npm install -g cross-env

RUN npm install

COPY . .

RUN npm run build

CMD npm run start:dev
34 changes: 34 additions & 0 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3.9'
services:
backend:
image: le2sky/oleunaelim-develop-server
container_name: le2sky/oleunaelim-develop-server
ports:
- 8080:3000
volumes:
- .:/app
depends_on:
- db
networks:
- oleunaelim
environment:
- TZ=Asia/Seoul
env_file:
- src/config/env/.development.env
db:
image: postgres:latest
container_name: oleunaelim-db
restart: always
environment:
MYSQL_DATABASE: oleunaelim
MYSQL_ROOT_PASSWORD: root
TZ: Asia/Seoul
volumes:
- .dbdata:/var/lib/mysql
ports:
- 5432:5432
networks:
- oleunaelim

networks:
oleunaelim:
17 changes: 17 additions & 0 deletions docker/docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3.9'
services:
backend:
image: le2sky/oleunaelim-production-server
container_name: le2sky/oleunaelim-production-server
ports:
- 8080:3000
volumes:
- .:/app
networks:
- oleunaelim
environment:
- TZ=Asia/Seoul
env_file:
- src/config/env/.production.env
networks:
oleunaelim:
12 changes: 12 additions & 0 deletions nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"assets": [
{
"include": "./config/env/*.env",
"outDir": "./dist"
}
]
}
}
Loading

0 comments on commit e30c811

Please sign in to comment.