3 Commits

Author SHA1 Message Date
eneller
84fdd3801a chore: fix dev script 2026-08-02 13:06:22 +02:00
eneller
954d21c05d feat(client): adjust language 2026-08-02 12:42:04 +02:00
eneller
787eed80b0 chore: better dev scripts 2026-08-02 12:39:29 +02:00
4 changed files with 42 additions and 6 deletions

View File

@@ -3,12 +3,12 @@
<div class="col-lg-6 col-md-8"> <div class="col-lg-6 col-md-8">
<div class="card shadow-sm"> <div class="card shadow-sm">
<div class="card-header bg-success text-white"> <div class="card-header bg-success text-white">
<h3 class="mb-0">Receive Money</h3> <h3 class="mb-0">Request Money</h3>
</div> </div>
<div class="card-body p-4 text-center"> <div class="card-body p-4 text-center">
<!-- Large Amount Display --> <!-- Large Amount Display -->
<div class="mb-4"> <div class="mb-4">
<label class="form-label h5">Amount to Receive</label> <label class="form-label h5">Amount to request</label>
<div class="input-group input-group-lg mb-3"> <div class="input-group input-group-lg mb-3">
<span class="input-group-text"><i class="bi bi-wallet2"></i></span> <span class="input-group-text"><i class="bi bi-wallet2"></i></span>
<input <input
@@ -22,7 +22,7 @@
<!-- Shareable Link --> <!-- Shareable Link -->
<div class="mb-4"> <div class="mb-4">
<p class="text-muted">Share this link to receive money:</p> <p class="text-muted">Share this link to request money:</p>
<div class="input-group mb-3"> <div class="input-group mb-3">
<input <input
type="text" type="text"

View File

@@ -9,8 +9,7 @@
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"server": "npm run dev --workspace=server", "server": "npm run dev --workspace=server",
"client": "npm start --prefix client", "client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"", "dev": "concurrently \"npm run server\" \"npm run client\""
"teardown": "npm run teardown --workspace=server"
}, },
"workspaces": [ "workspaces": [
"client", "client",

View File

@@ -18,7 +18,8 @@
"hash": "ts-node src/scripts/hash.ts", "hash": "ts-node src/scripts/hash.ts",
"verify-hash": "ts-node src/scripts/verify-hash.ts", "verify-hash": "ts-node src/scripts/verify-hash.ts",
"create-user": "ts-node src/scripts/create-user.ts", "create-user": "ts-node src/scripts/create-user.ts",
"dev": "npm run setup && npm run node; npm run teardown" "dev-bg": "npm run setup && npm run node",
"dev": "ts-node src/scripts/dev.ts"
}, },
"dependencies": { "dependencies": {
"bcrypt": "^6.0.0", "bcrypt": "^6.0.0",

36
server/src/scripts/dev.ts Normal file
View File

@@ -0,0 +1,36 @@
//Dev-Script
//Runs `npm run dev-bg` and listens for interrupts to execute `npm run teardown`
import { spawn } from "node:child_process";
let isShuttingDown = false;
const child = spawn("npm", ["run", "dev-bg"], {
stdio: "inherit",
shell: true,
});
async function teardown() {
console.log("Running teardown...");
const teardownProcess = spawn("npm", ["run", "teardown"], {
stdio: "inherit",
shell: true,
detached: true
});
await new Promise((resolve) => teardownProcess.on("exit", resolve));
}
async function shutdown(signal: any) {
if(isShuttingDown) return;
isShuttingDown = true;
child.kill(signal);
await teardown();
process.exit();
}
process.on("SIGINT", () => shutdown("SIGINT"));
process.on("SIGTERM", () => shutdown("SIGTERM"));
child.on("exit", async (code) => {
process.exit(code ?? 0);
});