Major Feature Update: Modern Chat System & Admin Management
Features Added: 🔥 Modern Chat System: - Real-time messaging with modern Tailwind CSS design - Post-linked discussions for adventure sharing - Chat categories (general, technical-support, adventure-planning) - Mobile-responsive interface with gradient backgrounds - JavaScript polling for live message updates 🎯 Comprehensive Admin Panel: - Chat room management with merge capabilities - Password reset system with email templates - User management with admin controls - Chat statistics and analytics dashboard - Room binding to posts and categorization �� Mobile API Integration: - RESTful API endpoints at /api/v1/chat - Session-based authentication for mobile apps - Comprehensive endpoints for rooms, messages, users - Mobile app compatibility (React Native, Flutter) 🛠️ Technical Improvements: - Enhanced database models with ChatRoom categories - Password reset token system with email verification - Template synchronization fixes for Docker deployment - Migration scripts for database schema updates - Improved error handling and validation 🎨 UI/UX Enhancements: - Modern card-based layouts matching app design - Consistent styling across chat and admin interfaces - Mobile-optimized touch interactions - Professional gradient designs and glass morphism effects 📚 Documentation: - Updated README with comprehensive API documentation - Added deployment instructions for Docker (port 8100) - Configuration guide for production environments - Mobile integration examples and endpoints This update transforms the platform into a comprehensive motorcycle adventure community with modern chat capabilities and professional admin management tools.
This commit is contained in:
39
migrations/add_category_to_chat_rooms.py
Normal file
39
migrations/add_category_to_chat_rooms.py
Normal file
@@ -0,0 +1,39 @@
|
||||
"""
|
||||
Database migration to add category field to chat_rooms table
|
||||
"""
|
||||
|
||||
from app.extensions import db
|
||||
|
||||
def upgrade():
|
||||
"""Add category field to chat_rooms table"""
|
||||
try:
|
||||
# Add the category column
|
||||
db.engine.execute("""
|
||||
ALTER TABLE chat_rooms
|
||||
ADD COLUMN category VARCHAR(50) DEFAULT 'general'
|
||||
""")
|
||||
|
||||
# Update existing rooms to have category based on room_type
|
||||
db.engine.execute("""
|
||||
UPDATE chat_rooms
|
||||
SET category = CASE
|
||||
WHEN room_type = 'general' THEN 'general'
|
||||
WHEN room_type = 'post_discussion' THEN 'general'
|
||||
WHEN room_type = 'admin_support' THEN 'technical'
|
||||
WHEN room_type = 'password_reset' THEN 'technical'
|
||||
ELSE 'general'
|
||||
END
|
||||
""")
|
||||
|
||||
print("✅ Successfully added category field to chat_rooms table")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Error adding category field: {e}")
|
||||
# If column already exists, that's fine
|
||||
if "duplicate column name" in str(e).lower() or "already exists" in str(e).lower():
|
||||
print("ℹ️ Category column already exists")
|
||||
else:
|
||||
raise
|
||||
|
||||
if __name__ == "__main__":
|
||||
upgrade()
|
||||
66
migrations/add_password_reset_system.py
Normal file
66
migrations/add_password_reset_system.py
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Database migration script for Password Reset System
|
||||
Adds PasswordResetRequest and PasswordResetToken tables
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from app.extensions import db
|
||||
from app.models import PasswordResetRequest, PasswordResetToken
|
||||
from config import Config
|
||||
|
||||
def create_password_reset_tables():
|
||||
"""Create password reset tables"""
|
||||
try:
|
||||
# Create tables
|
||||
db.create_all()
|
||||
print("✅ Password reset tables created successfully!")
|
||||
|
||||
# Verify tables exist
|
||||
from sqlalchemy import inspect
|
||||
inspector = inspect(db.engine)
|
||||
tables = inspector.get_table_names()
|
||||
|
||||
if 'password_reset_request' in tables:
|
||||
print("✅ PasswordResetRequest table exists")
|
||||
else:
|
||||
print("❌ PasswordResetRequest table missing")
|
||||
|
||||
if 'password_reset_token' in tables:
|
||||
print("✅ PasswordResetToken table exists")
|
||||
else:
|
||||
print("❌ PasswordResetToken table missing")
|
||||
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Error creating tables: {e}")
|
||||
return False
|
||||
|
||||
def main():
|
||||
"""Main migration function"""
|
||||
print("🔄 Starting password reset system migration...")
|
||||
|
||||
# Import app to initialize database
|
||||
from run import app
|
||||
|
||||
with app.app_context():
|
||||
success = create_password_reset_tables()
|
||||
|
||||
if success:
|
||||
print("✅ Migration completed successfully!")
|
||||
print("\nNew features available:")
|
||||
print("- Admin can view password reset requests")
|
||||
print("- Admin can generate secure reset tokens")
|
||||
print("- Email templates for manual sending")
|
||||
print("- Token usage tracking")
|
||||
print("- Request status management")
|
||||
else:
|
||||
print("❌ Migration failed!")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
0
migrations/add_password_reset_tables.py
Normal file
0
migrations/add_password_reset_tables.py
Normal file
Reference in New Issue
Block a user