# Project Cleanup - Files Marked for Deletion ## Overview This document identifies files that can be safely deleted to clean up the project repository. Files are categorized by type and include reasoning for deletion. ## Categories of Files to Delete ### 1. Debug Files These are standalone debug/test files that were used during development but are no longer needed in production. **Files to delete:** - `debug-dropdown.js` - Simple dropdown testing script - `debug-task-insert.mjs` - Database task insertion debugging - `debug-disabled/` - Entire folder containing disabled debug components: - `debug-disabled/comprehensive-polish-map/page.js` - `debug-disabled/debug-polish-orthophoto/` (entire folder) - `debug-disabled/test-improved-wmts/` (entire folder) - `debug-disabled/test-polish-map/` (entire folder) - `debug-disabled/test-polish-orthophoto/` (entire folder) ### 2. Standalone Test Files These are one-off test scripts that were used for verification but are not part of the official test suite. **Files to delete:** - `test-audit-logging.mjs` - Audit logging functionality test - `test-auth-api.mjs` - Authentication API testing - `test-auth-detailed.mjs` - Detailed auth flow testing - `test-auth-pages.mjs` - Auth pages testing - `test-auth-session.mjs` - Session testing - `test-auth.mjs` - General auth testing - `test-complete-auth.mjs` - Complete auth flow testing - `test-create-function.mjs` - Function creation testing - `test-current-audit-logs.mjs` - Current audit logs testing - `test-date-formatting.js` - Date formatting utility testing - `test-dropdown-comprehensive.html` - Comprehensive dropdown HTML test - `test-dropdown.html` - Basic dropdown HTML test - `test-edge-compatibility.mjs` - Edge runtime compatibility testing - `test-logged-in-flow.mjs` - Logged-in user flow testing - `test-logging.mjs` - General logging testing - `test-mobile.html` - Mobile interface testing - `test-nextauth.mjs` - NextAuth testing - `test-project-api.mjs` - Project API testing - `test-project-creation.mjs` - Project creation testing - `test-safe-audit-logging.mjs` - Safe audit logging testing - `test-task-api.mjs` - Task API testing - `test-user-tracking.mjs` - User tracking testing ### 3. Database Migration and Check Scripts These are one-time migration and verification scripts that are no longer needed after successful execution. **Files to delete:** - `check-audit-db.mjs` - Audit database verification - `check-columns.mjs` - Database column verification - `check-projects-table.mjs` - Projects table verification - `check-projects.mjs` - Projects data verification - `check-schema.mjs` - Schema verification - `check-task-schema.mjs` - Task schema verification - `fix-notes-columns.mjs` - Notes columns fix (completed) - `fix-task-columns.mjs` - Task columns fix (completed) - `init-db-temp.mjs` - Temporary database initialization - `migrate-project-status.mjs` - Project status migration (completed) - `migrate-to-username.js` - Username migration (completed) - `update-admin-username.js` - Admin username update (completed) - `update-queries.ps1` - PowerShell query update script (completed) - `verify-audit-fix.mjs` - Audit fix verification (completed) - `verify-project.mjs` - Project verification (completed) ### 4. Old Database Backups These are backup files that can be archived or deleted if no longer needed. **Files to delete (with caution):** - `data/database_old.sqlite` - Old database backup - `data/database_old2.sqlite` - Older database backup **Recommendation:** Archive these to external storage before deletion, or keep one as emergency backup. ### 5. Implementation Documentation These are detailed implementation notes that document completed work and are no longer needed for ongoing development. **Files to delete:** - `AUDIT_LOGGING_IMPLEMENTATION.md` - Audit logging implementation details - `AUTHORIZATION_IMPLEMENTATION.md` - Authorization implementation details - `DROPDOWN_COMPLETION_STATUS.md` - Dropdown completion status - `DROPDOWN_IMPLEMENTATION_SUMMARY.md` - Dropdown implementation summary - `EDGE_RUNTIME_FIX_FINAL.md` - Edge runtime fix documentation - `EDGE_RUNTIME_FIX.md` - Edge runtime fix details - `INTEGRATION_COMPLETE.md` - Integration completion documentation - `INTEGRATION_SUMMARY.md` - Integration summary - `MERGE_COMPLETE.md` - Merge completion documentation - `MERGE_PREPARATION_SUMMARY.md` - Merge preparation summary - `POLISH_LAYERS_IMPLEMENTATION.md` - Polish layers implementation ## Files to Keep (Official Documentation) These documentation files should be retained as they provide ongoing value: - `README.md` - Project overview and setup instructions - `ROADMAP.md` - Future development roadmap - `TESTING.md` - Testing documentation and procedures - `docs/MAP_LAYERS.md` - Map layers configuration guide ## Deletion Strategy ### Phase 1: Safe Deletions (Immediate) Delete these files immediately as they have no production value: - All debug files - All standalone test files - All migration/check scripts - Implementation documentation files ### Phase 2: Database Backups (With Caution) - Archive old database files to external storage - Keep one backup as emergency rollback option - Delete after confirming current database is stable ### Phase 3: Verification After deletion: 1. Run `npm run build` to ensure no broken references 2. Run `npm test` to ensure test suite still passes 3. Check for any import errors or missing dependencies ## Impact Assessment ### Positive Impacts: - **Reduced repository size** - Remove ~50+ unnecessary files - **Cleaner codebase** - Eliminate confusion from old debug/test files - **Better maintainability** - Focus on active code and official documentation - **Improved build performance** - Fewer files to process ### Potential Risks: - **Lost debugging context** - Some debug files might contain useful troubleshooting information - **Missing historical reference** - Implementation docs provide context for current architecture - **Accidental dependency** - Some files might be referenced in scripts or documentation ### Mitigation: - **Backup first** - Create a backup branch before deletion - **Gradual approach** - Delete in phases with verification between each - **Documentation preservation** - Keep essential docs, archive implementation details ## Commands to Execute Deletion ```bash # Phase 1: Safe deletions rm debug-dropdown.js rm debug-task-insert.mjs rm -rf debug-disabled/ rm test-*.mjs test-*.js test-*.html rm check-*.mjs migrate-*.mjs migrate-*.js update-*.js update-*.ps1 verify-*.mjs fix-*.mjs init-db-temp.mjs rm *_IMPLEMENTATION.md *_COMPLETE.md *_SUMMARY.md EDGE_RUNTIME_FIX*.md POLISH_LAYERS_IMPLEMENTATION.md # Phase 2: Database backups (after archiving) # rm data/database_old.sqlite data/database_old2.sqlite ``` ## Post-Deletion Checklist - [ ] Run `npm run build` successfully - [ ] Run `npm test` to ensure test suite passes - [ ] Check for any broken imports or references - [ ] Verify all functionality still works - [ ] Update any documentation that referenced deleted files - [ ] Commit changes with descriptive message --- *Generated on: December 19, 2025* *Total files identified for deletion: ~57+ files* *Estimated space savings: ~5-10MB* d:\panel\CLEANUP_PLAN.md