Universal links for the ATmosphere. Share ATProto content with anyone, let them choose where to view it.
at testing 97 lines 2.9 kB view raw
1#!/usr/bin/env node 2 3/** 4 * Setup script for forking aturi.to 5 * 6 * This interactive script helps you configure your fork by: 7 * - Creating a .env.local file with your settings 8 * - Updating key configuration values 9 * - Providing next steps for deployment 10 * 11 * Usage: node scripts/setup-fork.js 12 */ 13 14const fs = require('fs'); 15const path = require('path'); 16const readline = require('readline'); 17 18const rl = readline.createInterface({ 19 input: process.stdin, 20 output: process.stdout, 21}); 22 23function question(prompt) { 24 return new Promise((resolve) => { 25 rl.question(prompt, resolve); 26 }); 27} 28 29async function main() { 30 console.log('\n🌟 Welcome to aturi.to fork setup!\n'); 31 console.log('This script will help you configure your custom instance.\n'); 32 33 // Get configuration from user 34 const domain = await question('What is your custom domain? (e.g., myshare.app): '); 35 const siteName = await question(`Site name [${domain}]: `) || domain; 36 const description = await question('Site description [Universal links for the ATmosphere]: ') || 'Universal links for the ATmosphere'; 37 const authorName = await question('Your name: '); 38 const authorUrl = await question('Your website/profile URL (optional): '); 39 const repoUrl = await question('Your repository URL: '); 40 41 console.log('\n📝 Creating .env.local file...\n'); 42 43 // Create .env.local content 44 const envContent = `# aturi.to Fork Configuration 45# Generated by setup-fork.js 46 47# Your custom domain 48NEXT_PUBLIC_DOMAIN=${domain} 49 50# Site branding 51NEXT_PUBLIC_SITE_NAME=${siteName} 52NEXT_PUBLIC_SITE_DESCRIPTION=${description} 53 54# Author/Creator info 55NEXT_PUBLIC_AUTHOR_NAME=${authorName} 56${authorUrl ? `NEXT_PUBLIC_AUTHOR_URL=${authorUrl}` : '# NEXT_PUBLIC_AUTHOR_URL='} 57 58# Source code repository URL 59NEXT_PUBLIC_REPO_URL=${repoUrl} 60 61# Analytics (optional) 62# NEXT_PUBLIC_ANALYTICS_ENABLED=true 63 64# Feature flags 65NEXT_PUBLIC_SHOW_INTEGRATION_PROMO=true 66`; 67 68 // Write .env.local 69 const envPath = path.join(process.cwd(), '.env.local'); 70 fs.writeFileSync(envPath, envContent); 71 72 console.log('✅ Created .env.local\n'); 73 74 // Update config.ts with defaults 75 console.log('💡 Your configuration is ready!\n'); 76 77 console.log('Next steps:\n'); 78 console.log('1. Review src/lib/config.ts if you need more customization'); 79 console.log('2. Customize waypoints in src/utils/waypoints.tsx'); 80 console.log('3. Update branding (logo, colors) in src/app/globals.css'); 81 console.log('4. Test locally: npm run dev'); 82 console.log('5. Deploy to Vercel and configure your domain\n'); 83 84 console.log('📚 See FORKING.md for detailed instructions.\n'); 85 console.log('⚖️ Remember: Keep your fork open source under GPL v3!\n'); 86 87 console.log('🎉 Setup complete! Happy forking!\n'); 88 89 rl.close(); 90} 91 92main().catch((error) => { 93 console.error('Error:', error); 94 process.exit(1); 95}); 96 97