Skip to content

Commit 73acfad

Browse files
committed
up
1 parent fd57972 commit 73acfad

55 files changed

Lines changed: 7458 additions & 90 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
jobs:
9+
backend:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: backend
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
cache: npm
20+
cache-dependency-path: backend/package-lock.json
21+
- run: npm ci
22+
- run: npm run build
23+
- run: npm test
24+
25+
frontend:
26+
runs-on: ubuntu-latest
27+
defaults:
28+
run:
29+
working-directory: frontend
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: '20'
35+
cache: npm
36+
cache-dependency-path: frontend/package-lock.json
37+
- run: npm ci
38+
- run: npm run build

backend/fix-env.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
const webpush = require('web-push');
4+
5+
const envPath = path.join(__dirname, '.env');
6+
let envContent = fs.readFileSync(envPath, 'utf8');
7+
8+
const keys = webpush.generateVAPIDKeys();
9+
10+
envContent = envContent.replace(
11+
/^VAPID_PUBLIC_KEY=.*$/m,
12+
`VAPID_PUBLIC_KEY=${keys.publicKey}`
13+
);
14+
15+
envContent = envContent.replace(
16+
/^VAPID_PRIVATE_KEY=.*$/m,
17+
`VAPID_PRIVATE_KEY=${keys.privateKey}`
18+
);
19+
20+
fs.writeFileSync(envPath, envContent, 'utf8');
21+
console.log('Fixed .env with properly encoded clean VAPID keys.');

backend/fix-password.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const { PrismaClient } = require('@prisma/client');
2+
const bcrypt = require('bcryptjs');
3+
4+
const prisma = new PrismaClient();
5+
6+
async function main() {
7+
const email = 'system@quantumproject.app';
8+
const password = 'quantum123';
9+
const hashedPassword = await bcrypt.hash(password, 12);
10+
11+
console.log(`Setting password for ${email} to ${password}`);
12+
console.log(`Hashed password: ${hashedPassword}`);
13+
14+
const user = await prisma.user.update({
15+
where: { email },
16+
data: { password: hashedPassword }
17+
});
18+
19+
const isMatch = await bcrypt.compare(password, user.password);
20+
console.log(`Verification match: ${isMatch}`);
21+
22+
process.exit(0);
23+
}
24+
25+
main().catch(e => {
26+
console.error(e);
27+
process.exit(1);
28+
});

0 commit comments

Comments
 (0)