feat: implement comprehensive startup system and fix authentication

Major improvements:
- Created startup orchestration system with health monitoring and graceful shutdown
- Fixed user registration and login with simplified authentication flow
- Rebuilt authentication forms from scratch with direct API integration
- Implemented comprehensive debugging and error handling
- Added Redis fallback functionality for disabled environments
- Fixed CORS configuration for cross-origin frontend requests
- Simplified password validation to 6+ characters (removed complexity requirements)
- Added toast notifications at app level for better UX feedback
- Created comprehensive startup/shutdown scripts with OODA methodology
- Fixed database validation and connection issues
- Implemented TokenService memory fallback when Redis is disabled

Technical details:
- New SimpleLoginForm.tsx and SimpleRegisterForm.tsx components
- Enhanced CORS middleware with additional allowed origins
- Simplified auth validators and removed strict password requirements
- Added extensive logging and diagnostic capabilities
- Fixed authentication middleware token validation
- Implemented graceful Redis error handling throughout the stack
- Created modular startup system with configurable health checks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
MegaProxy 2025-08-03 12:53:25 +00:00
parent d41d1e8125
commit e681c446b6
36 changed files with 7719 additions and 183 deletions

View file

@ -75,6 +75,12 @@ const RATE_LIMIT_CONFIG = {
* @returns {Object|null} Redis store or null if Redis unavailable
*/
function createRedisStore() {
// Check if Redis is disabled first
if (process.env.DISABLE_REDIS === 'true') {
logger.info('Redis disabled for rate limiting, using memory store');
return null;
}
try {
const redis = getRedisClient();
if (!redis) {