FILE ORGANIZATION
Comprehensive guidelines for AI-assisted development within the Editor platform
📁 SIMPLIFIED FILE ORGANIZATION - JULY 12, 2025
🎉 MAJOR IMPROVEMENTS COMPLETED
✅ ELIMINATED: Confusing Multiple Directories
BEFORE (CONFUSING):
📁 dist/
├── 📁 deployment/dist/ ❌ Confusing nested dist!
├── 📁 production/
└── 📁 apps/
📁 deployment/
├── 📁 dist/ ❌ Another dist directory!
├── 📁 deployment/dist/ ❌ Triple nesting!
└── files...
📁 servers/
└── 📁 dist-minimal-production/ ❌ Old duplicate structure!
AFTER (CLEAN & SIMPLE):
📁 dist/ ✅ Single main build directory
├── 📁 production/ ✅ Production builds ONLY
├── 📁 apps/ ✅ Development builds
└── 📁 libs/ ✅ Library builds
📁 deployment/ ✅ Deployment server files ONLY
├── production-server.js ✅ Production server
├── production.config.js ✅ Server configuration
├── start-railway-production-server.sh ✅ Railway startup
├── package.json ✅ Deployment dependencies
└── DEPLOYMENT.md ✅ Deployment instructions
🎯 CURRENT STRUCTURE (SIMPLIFIED)
Build Outputs (dist/)
dist/production/- Production-ready applicationsux-test/- Testing applicationeditor-web/- Visual editorspace-map/- Universe visualizationdocs/- Documentation site
dist/apps/- Development buildsdist/libs/- Library builds & unified dashboard
Deployment (deployment/)
production-server.js- Main production serverproduction.config.js- Server configurationstart-railway-production-server.sh- Railway startup scriptpackage.json- Production dependenciesDEPLOYMENT.md- Deployment instructions
🚀 DEPLOYMENT WORKFLOW
Local Deployment
# 1. Build everything
yarn build
yarn build:dashboard
yarn unified:build
# 2. Deploy locally
cd deployment/
yarn install --production
cp .env.example .env
# Edit .env and set ANTHROPIC_API_KEY
node production-server.js --serve-only
Railway Deployment
- Uses
deployment/Dockerfile.railway - Automatically builds and deploys
- Server files correctly placed outside
dist/
✅ BENEFITS OF NEW STRUCTURE
- 🔥 SAFETY: Server files outside deletable
dist/directory - 📝 CLARITY: Single purpose for each directory
- 🚀 SIMPLICITY: No confusing nested structures
- ⚡ PERFORMANCE: No file duplication or symlinks needed
- 🛠️ MAINTAINABILITY: Clear separation of concerns
🚨 CRITICAL FIXES APPLIED
- Eliminated Dangerous Server Placement: Moved
production-server.jsfromdist/deployment/to safedeployment/ - Removed Directory Duplication: Eliminated
deployment/dist/,deployment/deployment/,servers/dist-minimal-production/ - Fixed Railway Deployment: Updated all paths and eliminated build errors
- Simplified Scripts: Deployment script now creates clean structure
📋 PRODUCTION CHECKLIST
- Directory structure simplified and clarified
- Server files safely outside
dist/directory - Railway deployment paths fixed
- Build scripts updated for new structure
- Documentation updated
- TypeScript build errors resolved (in progress)
- Full end-to-end deployment test
🎊 RESULT: CLEAN, PROFESSIONAL STRUCTURE
The project now has a clean, professional directory structure that eliminates confusion and ensures deployment safety. No more multiple dist directories or confusing nested structures!