Skip to content

Commit 98b48ae

Browse files
authored
Merge pull request #27 from USTakAssociation/dev
Dev to Main PR's already reviewed into dev
2 parents 5551452 + a5d7233 commit 98b48ae

Some content is hidden

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

45 files changed

+4740
-3383
lines changed

.github/workflows/api-cd-dev.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111

12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313

1414
environment: Beta
1515

@@ -61,7 +61,6 @@ jobs:
6161
RATING_OUTPUT_PATH: ${{ secrets.RATING_OUTPUT_PATH }}
6262
RATING_CRON_VALUE: ${{ secrets.RATING_CRON_VALUE }}
6363
run : |
64-
rm .env
6564
touch .env
6665
echo "PORT = ${PORT}" >> .env
6766
echo "NODE_ENV = ${NODE_ENV}" >> .env

.github/workflows/api-cd-prod.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111

12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313

1414
environment: Prod
1515

@@ -52,7 +52,6 @@ jobs:
5252
RATING_OUTPUT_PATH: ${{ secrets.RATING_OUTPUT_PATH }}
5353
RATING_CRON_VALUE: ${{ secrets.RATING_CRON_VALUE }}
5454
run : |
55-
rm .env
5655
touch .env
5756
echo "PORT = ${PORT}" >> .env
5857
echo "NODE_ENV = ${NODE_ENV}" >> .env

api/.env renamed to api/.env.example

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
PORT=3004
2-
DB_NAME=irms
3-
DB_PATH=/playtakdb
2+
DB_PATH=../playtakdb
43
NODE_ENV=local
54
APP_ENV=Local
65
CORS_DOMAIN='*'
7-
ANON_DB_PATH=/playtakdb/games_anon.db
6+
ANON_DB_PATH=../playtakdb/games_anon.db
87
DIST_PATH=dist/
98
PREVIOUS_FILE=previous.txt
109
RATING_OUTPUT_PATH=dist/

api/.eslintrc

Lines changed: 0 additions & 36 deletions
This file was deleted.

api/.eslintrc.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

api/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ lerna-debug.log*
3636
!.vscode/launch.json
3737
!.vscode/extensions.json
3838

39-
previous.txt
39+
previous.txt
40+
.env

api/.prettierrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"singleQuote": true,
3-
"trailingComma": "all",
3+
"trailingComma": "none",
44
"useTabs": true,
5-
"tabWidth": 4
5+
"tabWidth": 4,
6+
"printWidth": 120
67
}

api/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-alpine3.21 AS development
1+
FROM node:22-alpine3.21 AS development
22
WORKDIR /usr/src/app
33

44
# Copy package files

api/README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ npm install
1717

1818
## Running the app
1919

20+
First, need to set up the .env file which you can copy from the .env.example file.
21+
```
22+
cp .env.example .env
23+
```
24+
2025
There are two options to run the project: manually, or with docker (recommended).
2126

2227
Either way, you will need to create two databases, which can be done with the following bash script:
@@ -73,21 +78,24 @@ $ npm run test:cov
7378
SwaggerOpenAPI Documentation
7479

7580
https://api.playtak.com/api
76-
7781
https://api.beta.playtak.com/api
7882

7983
Events
8084

81-
- /events
85+
- GET /events
8286

8387
Games History
8488

85-
- /v1/games-history/
86-
- /v1/games-history/{id}
87-
- /v1/games-history/ptn/{id}
88-
- /v1/hames-history/db
89+
- GET /v1/games-history/
90+
- GET /v1/games-history/{id}
91+
- GET /v1/games-history/ptn/{id}
92+
- GET /v1/hames-history/db
8993

9094
Ratings
9195

92-
- /v1/ratings
93-
- /v1/ratings/{player_name}
96+
- GET /v1/ratings
97+
- GET /v1/ratings/{player_name}
98+
99+
Misc
100+
101+
- GET /health

api/eslint.config.mjs

Lines changed: 49 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,67 @@
1-
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin";
2-
import globals from "globals";
3-
import tsParser from "@typescript-eslint/parser";
4-
import path from "node:path";
5-
import { fileURLToPath } from "node:url";
6-
import js from "@eslint/js";
7-
import { FlatCompat } from "@eslint/eslintrc";
1+
import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin';
2+
import globals from 'globals';
3+
import tsParser from '@typescript-eslint/parser';
4+
import path from 'node:path';
5+
import { fileURLToPath } from 'node:url';
6+
import js from '@eslint/js';
7+
import { FlatCompat } from '@eslint/eslintrc';
88

99
const __filename = fileURLToPath(import.meta.url);
1010
const __dirname = path.dirname(__filename);
1111
const compat = new FlatCompat({
1212
baseDirectory: __dirname,
1313
recommendedConfig: js.configs.recommended,
14-
allConfig: js.configs.all
14+
allConfig: js.configs.all,
1515
});
1616

17-
export default [{
18-
ignores: ["**/.eslintrc.js"],
19-
}, ...compat.extends("plugin:@typescript-eslint/recommended"), {
20-
plugins: {
21-
"@typescript-eslint": typescriptEslintEslintPlugin,
17+
export default [
18+
{
19+
ignores: ['**/eslint.config.mjs'],
2220
},
23-
24-
languageOptions: {
25-
globals: {
26-
...globals.node,
27-
...globals.jest,
21+
...compat.extends(
22+
'plugin:@typescript-eslint/recommended',
23+
'plugin:prettier/recommended',
24+
),
25+
{
26+
plugins: {
27+
'@typescript-eslint': typescriptEslintPlugin,
2828
},
2929

30-
parser: tsParser,
31-
ecmaVersion: 5,
32-
sourceType: "module",
30+
languageOptions: {
31+
globals: {
32+
...globals.node,
33+
...globals.jest,
34+
},
3335

34-
parserOptions: {
35-
project: "tsconfig.json",
36-
tsconfigRootDir: "./",
37-
},
38-
},
36+
parser: tsParser,
37+
ecmaVersion: 5,
38+
sourceType: 'module',
3939

40-
rules: {
41-
"@typescript-eslint/interface-name-prefix": "off",
42-
"@typescript-eslint/explicit-function-return-type": "off",
43-
"@typescript-eslint/explicit-module-boundary-types": "off",
44-
"@typescript-eslint/no-explicit-any": "off",
45-
"@typescript-eslint/no-unused-expressions": "off",
46-
"eol-last": "off",
47-
"brace-style": "off",
48-
"comma-dangle": "off",
49-
"comma-spacing": "off",
50-
eqeqeq: "off",
51-
indent: "off",
52-
"key-spacing": "off",
53-
"keyword-spacing": "off",
54-
"max-len": "off",
55-
"no-ex-assign": "off",
56-
"no-extra-boolean-cast": "off",
57-
"no-floating-decimal": "off",
58-
"no-multi-spaces": "off",
59-
"no-throw-literal": "off",
60-
"no-unreachable": "off",
61-
radix: "off",
62-
"quote-props": "off",
63-
quotes: "off",
64-
"space-before-function-paren": "off",
65-
"space-in-parens": "off",
66-
"space-infix-ops": "off",
67-
"space-unary-ops": "off",
68-
"spaced-comment": "off",
69-
indent: ["warn", "tab", {
70-
SwitchCase: 1,
40+
parserOptions: {
41+
project: path.resolve(__dirname, 'tsconfig.json'),
42+
},
43+
},
7144

72-
ignoredNodes: [
73-
"FunctionExpression > .params[decorators.length > 0]",
45+
rules: {
46+
'@typescript-eslint/interface-name-prefix': 'off',
47+
'@typescript-eslint/explicit-function-return-type': 'off',
48+
'@typescript-eslint/explicit-module-boundary-types': 'off',
49+
'@typescript-eslint/no-explicit-any': 'off',
50+
indent: [
51+
'error',
52+
'tab',
53+
{
54+
SwitchCase: 1,
55+
flatTernaryExpressions: false,
56+
ignoredNodes: [
57+
'FunctionExpression[params]:has(Identifier[decorators])',
58+
"FunctionExpression > .params[decorators.length > 0]",
7459
"FunctionExpression > .params > :matches(Decorator, :not(:first-child))",
7560
"ClassBody.body > PropertyDefinition[decorators.length > 0] > .key",
61+
],
62+
},
7663
],
77-
}],
64+
'comma-dangle': 'off',
65+
},
7866
},
79-
}];
67+
];

0 commit comments

Comments
 (0)