-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade template structure and dependencies
- Loading branch information
1 parent
0c10839
commit 635cfa6
Showing
63 changed files
with
2,684 additions
and
2,425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
"trailingComma": "all", | ||
"semi": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default async () => ({ | ||
app: (await import('./app')).default, | ||
amqp: (await import('./amqp')).default, | ||
database: (await import('./database')).default, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { number, string } from 'joi'; | ||
|
||
export default { | ||
AMQP_HOST: string().required(), | ||
AMQP_PORT: number(), | ||
AMQP_USERNAME: string().required(), | ||
AMQP_PASSWORD: string().required(), | ||
AMQP_VHOST: string().uri(), | ||
AMQP_QUEUE_PREFIX: string(), | ||
AMQP_SEND_EMAIL_QUEUE: string(), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { string, number } from 'joi'; | ||
|
||
export default { | ||
NODE_ENV: string() | ||
.valid('development', 'production', 'test', 'provision') | ||
.default('development'), | ||
PORT: number().default(3000), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { string, number } from 'joi'; | ||
|
||
export default { | ||
TYPEORM_TYPE: string().required().default('mysql'), | ||
TYPEORM_HOST: string().required(), | ||
TYPEORM_USERNAME: string().required(), | ||
TYPEORM_PASSWORD: string().required(), | ||
TYPEORM_DATABASE: string().required().default('docmodule'), | ||
TYPEORM_PORT: number().required().default(3306), | ||
TYPEORM_LOGGING: string().default('false'), | ||
TYPEORM_MIGRATIONS_RUN: string().default('true'), | ||
TYPEORM_SYNCHRONIZE: string().default('false'), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { object as joiObject } from 'joi'; | ||
import app from './app'; | ||
import database from './database'; | ||
import amqp from './amqp'; | ||
|
||
export default joiObject({ | ||
...app, | ||
...amqp, | ||
...database, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,71 @@ | ||
version: "3.0" | ||
version: '3.8' | ||
|
||
services: | ||
mysql-db: | ||
image: mariadb:10.4 | ||
restart: "always" | ||
mariadb: | ||
image: mariadb | ||
restart: 'no' | ||
volumes: | ||
- mysql:/var/lib/mysql | ||
- mariadb-data:/var/lib/mariadb | ||
ports: | ||
- 3306:3306 | ||
environment: | ||
MYSQL_RANDOM_ROOT_PASSWORD: "yes" | ||
MYSQL_DATABASE: "core" | ||
MYSQL_USER: "root" | ||
MYSQL_PASSWORD: "password" | ||
MYSQL_RANDOM_ROOT_PASSWORD: yes | ||
MYSQL_DATABASE: core | ||
MYSQL_USER: guest | ||
MYSQL_PASSWORD: guest | ||
|
||
adminer: | ||
image: adminer | ||
ports: | ||
- 8081:8080 | ||
environment: | ||
ADMINER_DEFAULT_DB_DRIVER: mysql | ||
ADMINER_DEFAULT_DB_HOST: mariadb | ||
ADMINER_DEFAULT_DB_SERVER: mariadb | ||
ADMINER_DEFAULT_SERVER: mariadb | ||
ADMINER_DEFAULT_DB_NAME: core | ||
ADMINER_DESIGN: dracula | ||
ADMINER_PLUGINS: tables-filter tinymce | ||
expose: | ||
- 8081 | ||
depends_on: | ||
- mariadb | ||
|
||
mq-service: | ||
image: rabbitmq:3-management-alpine | ||
ports: | ||
- 15672:15672 | ||
- 5672:5672 | ||
environment: | ||
RABBITMQ_DEFAULT_USER: "test" | ||
RABBITMQ_DEFAULT_PASS: "password" | ||
RABBITMQ_DEFAULT_USER: 'test' | ||
RABBITMQ_DEFAULT_PASS: 'password' | ||
volumes: | ||
- rabbitmq-data:/var/lib/rabbitmq | ||
|
||
api: | ||
build: . | ||
container_name: api | ||
tty: true | ||
command: yarn start | ||
ports: | ||
- ${APP_PORT}:3000 | ||
- 3000:3000 | ||
expose: | ||
- 3000 | ||
volumes: | ||
- ./:/usr/app | ||
- ./node_modules:/usr/app/node_modules | ||
- api-data:/var/lib/api | ||
env_file: .env | ||
depends_on: | ||
- mysql-db | ||
- mq-service | ||
- mariadb | ||
environment: | ||
NODE_ENV: 'development' | ||
APP_PORT: 3000 | ||
TYPEORM_HOST: mariadb | ||
REDIS_HOST: redis | ||
AMQP_HOST: mq-service | ||
|
||
volumes: | ||
mysql: | ||
rabbitmq-data: | ||
mariadb-data: | ||
driver: local | ||
rabbitmq-data: | ||
driver: local | ||
api-data: | ||
driver: local |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"moduleNameMapper": { | ||
"^@root/(.*)$": "<rootDir>/$1", | ||
"^@app/(.*)$": "<rootDir>/src/$1" | ||
} | ||
} |
Oops, something went wrong.