Follower

PROJECT
Organization: Chhoun Devid

Chhoundevid

Budget


Transparent and open finances.

View all transactions
-$475.00USD
Completed
Balance transfer

Credit from Chhoun Devid to Follower

+$500.00USD
Completed
Contribution #903440
$
Today’s balance

--.-- USD

Total raised

$475.00 USD

Total disbursed

$475.00 USD

Estimated annual budget

$500.00 USD

About


/**
 * User Data Generator (5000 Accounts)
 * Usage: node seed_users.js > users_seed.sql
 */

const crypto = require('crypto'); // Built-in Node module

// --- Configuration ---
const TARGET_COUNT = 5000;
const DOMAINS = ['gmail.com', 'outlook.com', 'yahoo.com', 'petsocial.app'];
const COUNTRIES = ['USA', 'Canada', 'UK', 'Germany', 'France', 'Japan', 'Australia', 'Brazil', 'India'];

const FIRST_NAMES = [
  "Emma", "Liam", "Olivia", "Noah", "Ava", "Oliver", "Isabella", "Elijah", "Sophia", "Lucas",
  "Mia", "Mason", "Charlotte", "Logan", "Amelia", "Ethan", "Harper", "Aiden", "Evelyn", "Jackson"
];

const LAST_NAMES = [
  "Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "Miller", "Davis", "Rodriguez", "Martinez",
  "Hernandez", "Lopez", "Gonzalez", "Wilson", "Anderson", "Thomas", "Taylor", "Moore", "Jackson", "Martin"
];

// --- Helpers ---
const getRandom = (arr) => arr[Math.floor(Math.random() * arr.length)];

const generatePhone = () => {
  // Generates format: +XX XXX-XXX-XXXX
  const countryCode = Math.floor(Math.random() * 90) + 10;
  const area = Math.floor(Math.random() * 900) + 100;
  const exchange = Math.floor(Math.random() * 900) + 100;
  const sub = Math.floor(Math.random() * 9000) + 1000;
  return `+${countryCode} ${area}-${exchange}-${sub}`;
};

// --- Main Generator ---
console.log(`-- Generating ${TARGET_COUNT} users for PetSocial`);
console.log(`INSERT INTO users (id, email, password_hash, display_name, first_name, last_name, phone_number, country) VALUES`);

const usedEmails = new Set();

for (let i = 0; i < TARGET_COUNT; i++) {
  // 1. ID
  const id = crypto.randomUUID();

  // 2. Names
  const fName = getRandom(FIRST_NAMES);
  const lName = getRandom(LAST_NAMES);
  const fullName = `${fName} ${lName}`;

  // 3. Email (Ensure uniqueness)
  let emailBase = `${fName.toLowerCase()}.${lName.toLowerCase()}`;
  let email = `${emailBase}@${getRandom(DOMAINS)}`;
  let counter = 1;
  while (usedEmails.has(email)) {
    email = `${emailBase}${counter}@${getRandom(DOMAINS)}`;
    counter++;
  }
  usedEmails.add(email);

  // 4. Other details
  const phone = generatePhone();
  const country = getRandom(COUNTRIES);
  const passHash = '$2b$10$abcdefg...placeholder_hash'; // Placeholder for bcrypt hash

  // 5. Output SQL Value Tuple
  const isLast = i === TARGET_COUNT - 1;
  const terminator = isLast ? ';' : ',';
  
  console.log(`('${id}', '${email}', '${passHash}', '${fullName}', '${fName}', '${lName}', '${phone}', '${country}')${terminator}`);
}

console.log(`-- Done. Generated ${TARGET_COUNT} accounts.`);

Our team

Contribute


Become a financial contributor.

Financial Contributions

Goal
Chhoun Devid

chhoundevid2

$0.00 USD of $56,000 USD / month raised (0%)

$560 USD / month

Latest activity by


Be the first one to contribute!
Custom contribution
Donation
Make a custom one-time or recurring contribution.

Latest activity by


Follower is all of us

Our contributors 1

Thank you for supporting Follower.

Chhoun Devid

$500 USD