- NestJS backend: auth, restaurants, orders, drivers, payments, tracking, reviews, zones, admin, email - Next.js 14 frontend: landing, restaurants, checkout, tracking, dashboards, onboarding - Expo mobile app: driver orders and earnings screens - PostgreSQL + PostGIS schema with seed data - Docker Compose for local dev (Postgres, Redis, OSRM) - MapLibre GL + OpenStreetMap integration - Stripe subscription and payment processing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
1.7 KiB
JavaScript
49 lines
1.7 KiB
JavaScript
/**
|
|
* Reset dev seed user passwords to known values.
|
|
* Run once after docker compose up:
|
|
* node packages/database/reset-dev-passwords.js
|
|
*/
|
|
|
|
const { Client } = require('pg')
|
|
const bcrypt = require('bcrypt')
|
|
|
|
const DEV_USERS = [
|
|
{ email: 'admin@thevibe.ca', password: 'Admin@123', role: 'admin' },
|
|
{ email: 'owner@pizzanapoli.ca', password: 'Owner@123', role: 'restaurant_owner' },
|
|
{ email: 'owner@burgerhaus.ca', password: 'Owner@123', role: 'restaurant_owner' },
|
|
{ email: 'owner@tokyoramen.ca', password: 'Owner@123', role: 'restaurant_owner' },
|
|
{ email: 'driver@example.ca', password: 'Driver@123', role: 'driver' },
|
|
{ email: 'customer@example.ca', password: 'Customer@123', role: 'customer' },
|
|
]
|
|
|
|
async function main() {
|
|
const client = new Client({
|
|
host: process.env.POSTGRES_HOST || 'localhost',
|
|
port: parseInt(process.env.POSTGRES_PORT || '5432'),
|
|
user: process.env.POSTGRES_USER || 'vibe',
|
|
password: process.env.POSTGRES_PASSWORD || 'vibepass',
|
|
database: process.env.POSTGRES_DB || 'vibe_db',
|
|
})
|
|
|
|
await client.connect()
|
|
console.log('Connected to database\n')
|
|
|
|
for (const user of DEV_USERS) {
|
|
const hash = await bcrypt.hash(user.password, 12)
|
|
const result = await client.query(
|
|
'UPDATE users SET password_hash = $1 WHERE email = $2 RETURNING email',
|
|
[hash, user.email]
|
|
)
|
|
if (result.rowCount > 0) {
|
|
console.log(`✓ ${user.email} → password: ${user.password}`)
|
|
} else {
|
|
console.log(`✗ ${user.email} — user not found (seed may not have run)`)
|
|
}
|
|
}
|
|
|
|
await client.end()
|
|
console.log('\nDone. You can now log in with any of the accounts above.')
|
|
}
|
|
|
|
main().catch((e) => { console.error(e); process.exit(1) })
|