Skip to content

Commit 5b7eb46

Browse files
committed
Upgrade dependencies, quickstart
1 parent 67fa72e commit 5b7eb46

6 files changed

Lines changed: 1262 additions & 1307 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Middleware, ExpressMiddlewareInterface } from 'routing-controllers';
2+
3+
@Middleware({ type: 'before' })
4+
export class LoggingMiddleware implements ExpressMiddlewareInterface {
5+
use(request: any, response: any, next: (err: any) => any): void {
6+
// TODO maybe remove this middleware, idk if I'll really need it.
7+
// Or maybe keep it but only do this if debugging is on.
8+
// But I'd want the proper logging object for this.
9+
console.log('Incoming', request.method, request.url);
10+
next(undefined);
11+
}
12+
}

backend/src/services/unix-signal-service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ export class UnixSignalService implements IUnixSignalService {
6060
handler: ISignalHandler,
6161
): Promise<void> {
6262
if (!this._handlers.has(signal)) {
63-
this._handlers.set(signal, [() => process.exit()]);
63+
this._handlers.set(signal, [() => {
64+
// TODO I don't know why
65+
console.error("process.exit", signal, handler)
66+
process.exit()
67+
}]);
6468

6569
process.on(signal, () => this.handleSignal(signal));
6670
}

backend/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"experimentalDecorators": true,
66
"importHelpers": true,
77
"module": "commonjs",
8-
"noUnusedLocals": true,
9-
"noUnusedParameters": true,
8+
"noUnusedLocals": false,
9+
"noUnusedParameters": false,
1010
"outDir": "dist/",
1111
"strict": true,
1212
"target": "ES2022",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"@types/react-dom": "^19.0.4",
8585
"@types/sha256": "^0.2.2",
8686
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.1",
87-
"bcrypt": "^5.0.0",
87+
"bcrypt": "^6.0.0",
8888
"class-transformer": "^0.5.1",
8989
"class-validator": "^0.14.0",
9090
"convict": "^6.0.0",

quickstart.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Quickstart
2+
3+
```sh
4+
# prep
5+
cp backend/.env.example backend/.env
6+
docker run --name backend --network host -v $(pwd):/app -w /app node:alpine yarn
7+
8+
# start everything
9+
docker compose up db phpmyadmin maildev
10+
docker run --name backend --network host -v $(pwd):/app -w /app node:alpine sh \
11+
-c "yarn backend::start"
12+
docker run --name frontend --network host -v $(pwd):/app -w /app node:alpine sh \
13+
-c "API_BASE_URL='http://localhost:3000/api' yarn frontend::start" \
14+
```
15+
16+
Visit http://localhost:8080/
17+
18+
Edit code, frontend and backend restart automatically.
19+
20+
21+
# Quickstop
22+
23+
```sh
24+
docker rm -f backend frontend
25+
docker compose down
26+
```

0 commit comments

Comments
 (0)