Skip to content

Commit

Permalink
server code
Browse files Browse the repository at this point in the history
  • Loading branch information
gmesserman committed Dec 6, 2020
1 parent d112bae commit abeae82
Show file tree
Hide file tree
Showing 51 changed files with 18,409 additions and 201 deletions.
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DATABASE_HOST=127.0.0.1
DATABASE_SCHEMA=broken_crystals
DATABASE_USER=gil
DATABASE_PASSWORD=
DATABASE_PORT=5432
DATABASE_DEBUG=true
AWS_BUCKET=https://neuralegion-open-bucket.s3.amazonaws.com
MAILGUN_API=fhlakjshdf8932pidkjshfasdjfy89234ks83pikanzkjahslka
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tmp
**/*.spec.ts
**/*.js
node_modules
188 changes: 188 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
{
"env": {
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"prettier",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2015,
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "import"],
"rules": {
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit",
"overrides": {
"accessors": "no-public",
"constructors": "no-public"
}
}
],
"@typescript-eslint/no-explicit-any": [
"warn",
{
"ignoreRestArgs": true
}
],
"@typescript-eslint/member-ordering": [
"error",
{
"default": [
"public-static-field",
"protected-static-field",
"private-static-field",
"public-instance-field",
"protected-instance-field",
"private-instance-field",
"constructor",
"public-static-method",
"protected-static-method",
"private-static-method",
"public-abstract-method",
"protected-abstract-method",
"private-abstract-method",
"public-instance-method",
"protected-instance-method",
"private-instance-method"
]
}
],
"@typescript-eslint/naming-convention": [
"error",
{
"format": ["camelCase"],
"leadingUnderscore": "forbid",
"selector": "default",
"trailingUnderscore": "forbid"
},
{
"format": ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"],
"selector": "variableLike"
},
{
"format": ["UPPER_CASE", "camelCase"],
"leadingUnderscore": "forbid",
"selector": "memberLike"
},
{
"format": ["UPPER_CASE", "camelCase", "PascalCase"],
"leadingUnderscore": "forbid",
"modifiers": ["static"],
"selector": "memberLike"
},
{
"format": ["camelCase", "UPPER_CASE"],
"leadingUnderscore": "allow",
"modifiers": ["private"],
"selector": "memberLike"
},
{
"format": ["PascalCase"],
"selector": "typeLike"
},
{
"format": ["UPPER_CASE"],
"selector": "enumMember"
},
{
"format": ["camelCase", "PascalCase"],
"selector": "function"
},
{
"format": ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"],
"leadingUnderscore": "allow",
"modifiers": ["public"],
"selector": "property"
},
{
"format": ["camelCase"],
"leadingUnderscore": "allow",
"selector": "parameter"
}
],
"@typescript-eslint/no-inferrable-types": [
"error",
{
"ignoreParameters": true,
"ignoreProperties": true
}
],
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/quotes": [
"error",
"single",
{
"allowTemplateLiterals": true,
"avoidEscape": true
}
],
"@typescript-eslint/typedef": [
"error",
{
"arrayDestructuring": true,
"arrowParameter": false,
"memberVariableDeclaration": false,
"variableDeclarationIgnoreFunction": true
}
],
"arrow-body-style": "error",
"camelcase": "off",
"complexity": [
"error",
{
"max": 10
}
],
"curly": "error",
"eqeqeq": ["error", "smart"],
"guard-for-in": "error",
"import/order": [
"error",
{
"groups": [
"index",
["sibling", "parent"],
"internal",
"external",
"builtin"
]
}
],
"max-classes-per-file": ["error", 1],
"max-depth": [
"error",
{
"max": 2
}
],
"no-bitwise": "error",
"no-caller": "error",
"no-console": "off",
"no-eval": "error",
"no-new-wrappers": "error",
"no-restricted-syntax": ["error", "ForInStatement"],
"no-throw-literal": "error",
"no-undef-init": "error",
"object-shorthand": "error",
"one-var": ["error", "never"],
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"next": "return",
"prev": "*"
}
],
"prefer-arrow-callback": "error",
"radix": "error"
}
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.github
/node_modules
/dist
9 changes: 9 additions & 0 deletions .prettierrc copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"tabWidth": 2,
"singleQuote": true,
"bracketSpacing": true,
"printWidth": 80,
"trailingComma": "none",
"arrowParens": "always",
"quoteProps": "consistent"
}
19 changes: 19 additions & 0 deletions mikro-orm.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Logger } from '@nestjs/common';
import { Options, ReflectMetadataProvider } from '@mikro-orm/core';
import { SqlHighlighter } from '@mikro-orm/sql-highlighter';

const logger = new Logger('MikroORM');

const config = {
entities: ['dist/model'],
entitiesTs: ['src/model'],
dbName: 'gil',
type: 'postgresql',
port: 5432,
metadataProvider: ReflectMetadataProvider,
highlighter: new SqlHighlighter(),
debug: true,
logger: logger.log.bind(logger)
} as Options;

export default config;
7 changes: 7 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"watch": ["src"],
"ext": "ts",
"ignore": ["src/**/*.spec.ts"],
"exec": "node --inspect=127.0.0.1:9223 -r ts-node/register -- src/main.ts",
"env": {}
}
Loading

0 comments on commit abeae82

Please sign in to comment.