Initial commit: PassMaster PWA MVP
This commit is contained in:
30
scripts/check-status.js
Normal file
30
scripts/check-status.js
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const http = require('http');
|
||||
|
||||
const options = {
|
||||
hostname: 'localhost',
|
||||
port: 3000,
|
||||
path: '/',
|
||||
method: 'GET',
|
||||
timeout: 5000
|
||||
};
|
||||
|
||||
const req = http.request(options, (res) => {
|
||||
console.log(`✅ Server is running! Status: ${res.statusCode}`);
|
||||
console.log(`🌐 Access the app at: http://localhost:3000`);
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
req.on('error', (err) => {
|
||||
console.log('❌ Server is not running or not accessible');
|
||||
console.log('💡 Make sure to run: npm run dev');
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
req.on('timeout', () => {
|
||||
console.log('⏰ Request timed out - server might be starting up');
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
req.end();
|
||||
51
scripts/create-screenshots.js
Normal file
51
scripts/create-screenshots.js
Normal file
@@ -0,0 +1,51 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const screenshotsDir = path.join(__dirname, '../public/screenshots');
|
||||
|
||||
// Ensure screenshots directory exists
|
||||
if (!fs.existsSync(screenshotsDir)) {
|
||||
fs.mkdirSync(screenshotsDir, { recursive: true });
|
||||
}
|
||||
|
||||
// Create a simple placeholder screenshot
|
||||
function createPlaceholderScreenshot(filename, width, height, description) {
|
||||
const svgContent = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="${width}" height="${height}" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="100%" height="100%" fill="#f3f4f6"/>
|
||||
<rect x="0" y="0" width="100%" height="60" fill="#3b82f6"/>
|
||||
<text x="50%" y="35" text-anchor="middle" fill="white" font-family="Arial, sans-serif" font-size="24" font-weight="bold">PassMaster</text>
|
||||
<text x="50%" y="80" text-anchor="middle" fill="#6b7280" font-family="Arial, sans-serif" font-size="16">${description}</text>
|
||||
<rect x="50" y="120" width="${width-100}" height="200" rx="8" fill="white" stroke="#d1d5db" stroke-width="2"/>
|
||||
<text x="50%" y="150" text-anchor="middle" fill="#374151" font-family="Arial, sans-serif" font-size="14">Password Generator Interface</text>
|
||||
<rect x="80" y="180" width="${width-160}" height="40" rx="4" fill="#f9fafb" stroke="#d1d5db"/>
|
||||
<text x="50%" y="205" text-anchor="middle" fill="#6b7280" font-family="monospace" font-size="12">••••••••••••••••</text>
|
||||
<rect x="80" y="240" width="120" height="40" rx="4" fill="#3b82f6"/>
|
||||
<text x="140" y="265" text-anchor="middle" fill="white" font-family="Arial, sans-serif" font-size="14">Generate</text>
|
||||
<text x="50%" y="${height-30}" text-anchor="middle" fill="#9ca3af" font-family="Arial, sans-serif" font-size="12">Screenshot Placeholder</text>
|
||||
</svg>`;
|
||||
|
||||
const outputPath = path.join(screenshotsDir, filename);
|
||||
fs.writeFileSync(outputPath, svgContent);
|
||||
console.log(`✅ Created ${filename}`);
|
||||
}
|
||||
|
||||
function createScreenshots() {
|
||||
console.log('🔄 Creating PWA screenshots...');
|
||||
|
||||
try {
|
||||
// Desktop screenshot
|
||||
createPlaceholderScreenshot('desktop.png', 1280, 720, 'Desktop Interface');
|
||||
|
||||
// Mobile screenshot
|
||||
createPlaceholderScreenshot('mobile.png', 390, 844, 'Mobile Interface');
|
||||
|
||||
console.log('🎉 All screenshots created successfully!');
|
||||
console.log('📝 Note: These are placeholder SVGs. Replace with actual screenshots');
|
||||
console.log(' of your application for better app store listings.');
|
||||
} catch (error) {
|
||||
console.error('❌ Error creating screenshots:', error);
|
||||
}
|
||||
}
|
||||
|
||||
createScreenshots();
|
||||
43
scripts/generate-icons.js
Normal file
43
scripts/generate-icons.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const sizes = [72, 96, 128, 144, 152, 192, 384, 512];
|
||||
const inputIcon = path.join(__dirname, '../public/icon.png');
|
||||
const outputDir = path.join(__dirname, '../public/icons');
|
||||
|
||||
// Ensure output directory exists
|
||||
if (!fs.existsSync(outputDir)) {
|
||||
fs.mkdirSync(outputDir, { recursive: true });
|
||||
}
|
||||
|
||||
// Check if input icon exists
|
||||
if (!fs.existsSync(inputIcon)) {
|
||||
console.error('❌ Input icon not found:', inputIcon);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function generateIcons() {
|
||||
console.log('🔄 Generating PWA icons...');
|
||||
|
||||
try {
|
||||
// Read the original icon
|
||||
const iconBuffer = fs.readFileSync(inputIcon);
|
||||
|
||||
for (const size of sizes) {
|
||||
const outputPath = path.join(outputDir, `icon-${size}.png`);
|
||||
|
||||
// Copy the original icon to create the size variants
|
||||
fs.writeFileSync(outputPath, iconBuffer);
|
||||
|
||||
console.log(`✅ Generated icon-${size}.png`);
|
||||
}
|
||||
|
||||
console.log('🎉 All icons generated successfully!');
|
||||
console.log('📝 Note: All icons are copies of the original. For optimal quality,');
|
||||
console.log(' consider resizing them manually or using an image editor.');
|
||||
} catch (error) {
|
||||
console.error('❌ Error generating icons:', error);
|
||||
}
|
||||
}
|
||||
|
||||
generateIcons();
|
||||
46
scripts/setup.js
Normal file
46
scripts/setup.js
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
console.log('🚀 PassMaster Setup Script');
|
||||
console.log('==========================');
|
||||
|
||||
// Create .env.local if it doesn't exist
|
||||
const envPath = path.join(process.cwd(), '.env.local');
|
||||
if (!fs.existsSync(envPath)) {
|
||||
const envContent = `# Site URL for metadata and PWA
|
||||
NEXT_PUBLIC_SITE_URL=http://localhost:3000
|
||||
|
||||
# For production, change to your actual domain
|
||||
# NEXT_PUBLIC_SITE_URL=https://passmaster.app
|
||||
`;
|
||||
fs.writeFileSync(envPath, envContent);
|
||||
console.log('✅ Created .env.local file');
|
||||
} else {
|
||||
console.log('ℹ️ .env.local already exists');
|
||||
}
|
||||
|
||||
// Check if node_modules exists
|
||||
const nodeModulesPath = path.join(process.cwd(), 'node_modules');
|
||||
if (!fs.existsSync(nodeModulesPath)) {
|
||||
console.log('📦 Installing dependencies...');
|
||||
const { execSync } = require('child_process');
|
||||
try {
|
||||
execSync('npm install', { stdio: 'inherit' });
|
||||
console.log('✅ Dependencies installed');
|
||||
} catch (error) {
|
||||
console.error('❌ Failed to install dependencies:', error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
} else {
|
||||
console.log('ℹ️ Dependencies already installed');
|
||||
}
|
||||
|
||||
console.log('\n🎉 Setup complete!');
|
||||
console.log('\nNext steps:');
|
||||
console.log('1. Run "npm run dev" to start the development server');
|
||||
console.log('2. Open http://localhost:3000 in your browser');
|
||||
console.log('3. Add icon files to public/icons/ directory');
|
||||
console.log('4. Update .env.local with your production URL when deploying');
|
||||
console.log('\nHappy coding! 🚀');
|
||||
Reference in New Issue
Block a user