feat(backend): add fastify api, auth, prisma schema and jobs

This commit is contained in:
Anton
2026-04-23 16:04:44 +03:00
parent 5f6a551b6c
commit 2972090c48
34 changed files with 1313 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
// Local CLI helper — produces a bcrypt hash for an env USER*_PASSWORD_HASH value.
// Usage:
// pnpm hash-password "mySuperSecret"
//
// The plain password is only present in argv/RAM during this invocation.
// It is NOT logged anywhere; only the hash is printed to stdout. Copy it into .env.
import { hashPassword } from '../src/utils/password.js';
async function main(): Promise<void> {
const raw = process.argv.slice(2).join(' ').trim();
if (!raw) {
// eslint-disable-next-line no-console
console.error('Usage: pnpm hash-password "<password>"');
process.exit(1);
}
if (raw.length < 8) {
// eslint-disable-next-line no-console
console.error('Password must be at least 8 characters.');
process.exit(1);
}
const hash = await hashPassword(raw);
// Print ONLY the hash, nothing else, so it is trivial to redirect/copy.
process.stdout.write(hash + '\n');
}
void main();