6d25a499b202e99f9d2de8bb5d9afe6d85b665c9
BREAKING CHANGE: Replaced all direct useNavigate() usage with HandleNavigate hook
## Summary
- Complete frontend navigation refactoring
- Centralized route management with routes.js
- Converted 18+ components to use HandleNavigate
- Enhanced navigation with 20+ type-safe functions
## New Files
- src/utils/routes.js - Central route constants and helpers
- Documentations/FRONTEND_CODING_GUIDELINES.md - Frontend best practices (300+ lines)
- Documentations/NAVIGATION_REFACTORING_REPORT.md - Detailed refactoring report (400+ lines)
## Modified Components (18+)
### Pages
- Home.jsx, LoginForm.jsx, RegisterForm.jsx
- ResetPassword.jsx, VerifyEmailPage.jsx
- DeckCreator.jsx, Card_display.jsx
- Lobby.jsx, GameTest.jsx, ChooseDeck.jsx, PlayerSetup.jsx
- Landingpage.jsx
### Components
- Userdetails.jsx, DeckInfoPopUp.jsx
- PlayMenu.jsx, LandingPage.jsx, DeckManager.jsx
### Hooks
- useRequireAuth.jsx
### Core
- App.jsx - Route constants integration
- HandleNavigate.jsx - Enhanced with 20+ navigation functions
## Key Improvements
Type-safe navigation (goDeckDetails(id) vs navigate('/deck/'+id))
Automatic scroll management
Centralized state passing
Single source of truth for routes
Backwards compatibility aliases
Zero compile errors
Production ready
## Validation
- useNavigate: Only in HandleNavigate.jsx
- navigate() calls: 0 direct usage
- Compile errors: 0
- Documentation: Complete
SerpentRace
- Frontend: React (Vite)
- Backend: Node.js (Express.js)
Development Commands
Start with File Watchers (Recommended)
# Windows
.\docker-manage.bat dev:watch
# Linux/Mac
./docker-manage.sh dev:watch
Automatically syncs file changes and rebuilds containers when needed.
Traditional Start
# Windows
.\docker-manage.bat dev:start
# Linux/Mac
./docker-manage.sh dev:start
Documentation
- Docker Watcher Guide - Comprehensive guide for file watching functionality
Description
Languages
TypeScript
61.8%
JavaScript
31.1%
HTML
3.2%
Batchfile
1.5%
PLpgSQL
1.3%
Other
1.1%