Skip to content

Commit 5725e49

Browse files
author
Kelvin Szolnoky
committed
rewrite
1 parent ee69960 commit 5725e49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+15252
-0
lines changed

.defualt.env

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
NODE_ENV=development
2+
ENVIRONMENT=test
3+
LOG_LEVEL=silly
4+
BEHIND_REVERSE_PROXY=false
5+
DATA_STORE_DIR=/store
6+
7+
PORT=80
8+
9+
MONGODB_URL=mongodb://digitalungdom:digitalungdom@mongo:27017/digitalungdom
10+
11+
12+
SECRET=
13+
14+
SEND_GRID_API_KEY=
15+
SEND_GRID_EMAIL=
16+

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Blacklist everything
2+
*
3+
4+
# Whitelist
5+
!src
6+
!tsconfig.json
7+
!package.json
8+
!package-lock.json

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/*

.eslintrc.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"jest/globals": true
5+
},
6+
"extends": ["eslint:recommended", "plugin:node/recommended", "plugin:security/recommended", "prettier", "plugin:jest/recommended"],
7+
"plugins": ["node", "prettier", "jest"],
8+
"globals": {
9+
"Atomics": "readonly",
10+
"SharedArrayBuffer": "readonly"
11+
},
12+
"rules": {
13+
"prettier/prettier": "error",
14+
"block-scoped-var": "error",
15+
"eqeqeq": "error",
16+
"no-warning-comments": "warn",
17+
"no-var": "error",
18+
"prefer-const": "error",
19+
"eol-last": "error",
20+
"node/no-unpublished-require": "off"
21+
},
22+
"overrides": [
23+
{
24+
"files": ["**/*.ts"],
25+
"parser": "@typescript-eslint/parser",
26+
"extends": ["plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/eslint-recommended"],
27+
"rules": {
28+
"@typescript-eslint/no-floating-promises": "error",
29+
"@typescript-eslint/no-explicit-any": "off",
30+
"@typescript-eslint/no-non-null-assertion": "off",
31+
"@typescript-eslint/no-use-before-define": "off",
32+
"@typescript-eslint/camelcase": "off",
33+
"@typescript-eslint/ban-types": "warn",
34+
"@typescript-eslint/explicit-module-boundary-types": "off",
35+
"node/no-missing-import": "off",
36+
"node/no-unsupported-features/es-syntax": "off",
37+
"node/no-missing-require": "off",
38+
"node/shebang": "off",
39+
"no-dupe-class-members": "off",
40+
"security/detect-object-injection": "off",
41+
"security/detect-non-literal-fs-filename": "off",
42+
"curly": "error"
43+
},
44+
"parserOptions": {
45+
"ecmaVersion": 2018,
46+
"sourceType": "module",
47+
"project": "./tsconfig.json"
48+
}
49+
}
50+
]
51+
}

.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
.prod.env
60+
.dev.env
61+
.test.env
62+
63+
64+
# next.js build output
65+
.next
66+
67+
# build folder
68+
build
69+
70+
# secrets
71+
certs
72+
secrets
73+
*-secrets.yaml
74+
75+
dontpush

.prettierrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"printWidth": 260,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": false,
7+
"quoteProps": "consistent",
8+
"jsxSingleQuote": false,
9+
"trailingComma": "all",
10+
"bracketSpacing": true,
11+
"jsxBracketSameLine": false,
12+
"arrowParens": "avoid",
13+
"endOfLine": "lf"
14+
}

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm install --silent
8+
9+
COPY . .
10+
11+
RUN npm run build-prod --silent
12+
13+
CMD [ "node", "build/index.js" ]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# api
2+

docker-compose.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
version: "3"
2+
services:
3+
digitalungdom-api:
4+
container_name: digitalungdom-api
5+
build:
6+
context: .
7+
ports:
8+
- "8080:80"
9+
expose:
10+
- "80"
11+
networks:
12+
- digitalungdom
13+
depends_on:
14+
- mongo
15+
links:
16+
- mongo
17+
env_file: .env
18+
# volumes:
19+
# - "./dontpush/store:/store"
20+
# - "./dontpush/tmp:/tmp"
21+
22+
mongo:
23+
image: mongo
24+
container_name: du-mongo
25+
restart: always
26+
networks:
27+
- digitalungdom
28+
expose:
29+
- 27017
30+
ports:
31+
- "27017:27017"
32+
environment:
33+
- MONGO_INITDB_ROOT_USERNAME=root
34+
- MONGO_INITDB_ROOT_PASSWORD=root
35+
- MONGO_INITDB_DATABASE=digitalungdom
36+
volumes:
37+
- ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
38+
39+
networks:
40+
digitalungdom:

0 commit comments

Comments
 (0)