-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
3,547 additions
and
1,026 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# For more information about the properties used in | ||
# this file, please see the EditorConfig documentation: | ||
# https://editorconfig.org/ | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = 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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/* SPDX-FileCopyrightText: 2016-present Kriasoft <[email protected]> */ | ||
/* SPDX-License-Identifier: MIT */ | ||
|
||
/** | ||
* ESLint configuration. | ||
* | ||
* @see https://eslint.org/docs/user-guide/configuring | ||
* @type {import("eslint").Linter.Config} | ||
* | ||
* @copyright 2016-present Kriasoft (https://git.io/JYNud) | ||
*/ | ||
|
||
module.exports = { | ||
root: true, | ||
|
||
|
@@ -23,7 +23,7 @@ module.exports = { | |
|
||
overrides: [ | ||
{ | ||
files: ["*.ts"], | ||
files: ["*.ts", ".tsx"], | ||
parser: "@typescript-eslint/parser", | ||
extends: ["plugin:@typescript-eslint/recommended"], | ||
plugins: ["@typescript-eslint"], | ||
|
@@ -44,6 +44,12 @@ module.exports = { | |
sourceType: "module", | ||
}, | ||
}, | ||
{ | ||
files: ["db/types.ts"], | ||
rules: { | ||
"@typescript-eslint/no-explicit-any": "off", | ||
}, | ||
}, | ||
], | ||
|
||
ignorePatterns: [ | ||
|
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.build | ||
.cache | ||
.yarn | ||
.pnp.js | ||
tsconfig.json |
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,22 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "pwa-node", | ||
"request": "launch", | ||
"name": "api", | ||
"skipFiles": ["<node_internals>/**"], | ||
"runtimeExecutable": "yarn", | ||
"runtimeArgs": [ | ||
"node", | ||
"-r", | ||
"./env/config", | ||
"-e", | ||
"require('./.build/index').api.listen(8080)" | ||
] | ||
} | ||
] | ||
} |
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
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,34 @@ | ||
/* SPDX-FileCopyrightText: 2016-present Kriasoft <[email protected]> */ | ||
/* SPDX-License-Identifier: MIT */ | ||
|
||
import Email from "email-templates"; | ||
import env from "../env"; | ||
|
||
/** | ||
* Email renderer and sender (for transactional emails). | ||
* | ||
* @see https://github.com/forwardemail/email-templates | ||
*/ | ||
export default new Email({ | ||
message: { | ||
from: `"${env.APP_NAME}" <${env.EMAIL_FROM}>`, | ||
}, | ||
views: { | ||
options: { | ||
extension: "hbs", | ||
}, | ||
locals: { | ||
appName: env.APP_NAME, | ||
}, | ||
}, | ||
// https://nodemailer.com/smtp/ | ||
transport: { | ||
host: "smtp.gmail.com", | ||
port: 587, | ||
secure: true, | ||
auth: { | ||
user: env.EMAIL_FROM, | ||
pass: env.EMAIL_PASSWORD, | ||
}, | ||
}, | ||
}); |
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,35 @@ | ||
/* SPDX-FileCopyrightText: 2016-present Kriasoft <[email protected]> */ | ||
/* SPDX-License-Identifier: MIT */ | ||
|
||
import { ErrorRequestHandler } from "express"; | ||
import { isHttpError } from "http-errors"; | ||
|
||
/** | ||
* Renders an error page. | ||
*/ | ||
export const handleError: ErrorRequestHandler = function ( | ||
err, | ||
req, | ||
res, | ||
next // eslint-disable-line @typescript-eslint/no-unused-vars | ||
) { | ||
const statusCode = isHttpError(err) ? err.statusCode : 500; | ||
res.status(statusCode); | ||
|
||
if (/application\/json;/.test(req.get("accept") ?? "")) { | ||
res.send(err); | ||
} else if (statusCode === 404) { | ||
res.render("error", { | ||
title: "Page Not Found", | ||
message: "Sorry, but the page you were trying to view does not exist.", | ||
layout: false, | ||
}); | ||
} else { | ||
res.render("error", { | ||
title: "Application Error", | ||
message: "An error occurred while processing this request.", | ||
stack: err.stack, | ||
layout: false, | ||
}); | ||
} | ||
}; |
Oops, something went wrong.