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:
173
README.md
173
README.md
@@ -28,6 +28,10 @@ A modern Flask-based web application for motorcycle enthusiasts featuring advent
|
||||
- **Adventure Posts**: Rich content creation with titles, subtitles, and detailed stories
|
||||
- **Comment System**: Community discussions on adventure posts
|
||||
- **Like System**: Engagement tracking with real-time updates
|
||||
- **Real-time Chat System**: Modern chat interface with room management
|
||||
- **Post-linked Discussions**: Chat rooms connected to specific adventure posts
|
||||
- **Chat Categories**: Organized rooms for different topics (general, technical, routes, etc.)
|
||||
- **Mobile API Integration**: RESTful API for mobile app connectivity
|
||||
- **User Profiles**: Personal dashboards with adventure statistics
|
||||
- **Difficulty Ratings**: 5-star system for adventure difficulty assessment
|
||||
- **Publication Workflow**: Admin approval system for content moderation
|
||||
@@ -40,13 +44,25 @@ A modern Flask-based web application for motorcycle enthusiasts featuring advent
|
||||
- **Registration System**: Email-based user registration
|
||||
|
||||
### 🛠️ Admin Panel & Analytics
|
||||
- **Comprehensive Dashboard**: User and post management interface
|
||||
- **Comprehensive Dashboard**: User and post management interface with statistics
|
||||
- **Content Moderation**: Review and approve community posts
|
||||
- **User Analytics**: User engagement and activity metrics
|
||||
- **User Analytics**: User engagement and activity metrics with page view tracking
|
||||
- **Post Management**: Bulk operations and detailed post information
|
||||
- **Chat Management**: Full chat room administration with merge capabilities
|
||||
- **Password Reset System**: Admin-controlled password reset with secure tokens
|
||||
- **Mail System Configuration**: SMTP settings and email template management
|
||||
- **System Configuration**: Admin-only settings and controls
|
||||
|
||||
### 📱 Mobile-Optimized Experience
|
||||
### <EFBFBD> Real-time Chat System
|
||||
- **Modern Chat Interface**: App-style design with gradient backgrounds and card layouts
|
||||
- **Room Management**: Create, join, and manage chat rooms with categories
|
||||
- **Post Integration**: Link chat rooms to specific adventure posts for focused discussions
|
||||
- **Admin Controls**: Comprehensive chat administration with room merging and moderation
|
||||
- **Mobile API**: RESTful API endpoints for mobile app integration
|
||||
- **Real-time Updates**: JavaScript polling for live message updates
|
||||
- **Message Features**: Text messages with editing, deletion, and system notifications
|
||||
|
||||
### <20>📱 Mobile-Optimized Experience
|
||||
- **Touch-Friendly Interface**: Optimized buttons and interactions for mobile devices
|
||||
- **Responsive Grids**: Adaptive layouts that work perfectly on phones and tablets
|
||||
- **Progressive Enhancement**: Graceful degradation for older browsers
|
||||
@@ -62,6 +78,8 @@ A modern Flask-based web application for motorcycle enthusiasts featuring advent
|
||||
- **Frontend**: Tailwind CSS 3.x with custom components
|
||||
- **Maps**: Leaflet.js with OpenStreetMap integration
|
||||
- **File Handling**: Secure media uploads with thumbnail generation
|
||||
- **Chat System**: Real-time messaging with WebSocket-ready architecture
|
||||
- **API**: RESTful endpoints for mobile app integration
|
||||
- **Deployment**: Docker with Gunicorn WSGI server
|
||||
|
||||
## 📁 Project Structure
|
||||
@@ -112,7 +130,106 @@ A modern Flask-based web application for motorcycle enthusiasts featuring advent
|
||||
└── docker-compose.yml # Docker Compose setup
|
||||
```
|
||||
|
||||
## 🚀 Quick Start
|
||||
## <EFBFBD> API Documentation
|
||||
|
||||
The platform provides a comprehensive RESTful API for mobile app integration and third-party services.
|
||||
|
||||
### Base URL
|
||||
```
|
||||
https://your-domain.com/api/v1
|
||||
```
|
||||
|
||||
### Authentication
|
||||
All API endpoints use session-based authentication. Mobile apps can authenticate using:
|
||||
|
||||
```http
|
||||
POST /auth/login
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"email": "user@example.com",
|
||||
"password": "password"
|
||||
}
|
||||
```
|
||||
|
||||
### Chat API Endpoints
|
||||
|
||||
#### Get Chat Rooms
|
||||
```http
|
||||
GET /api/v1/chat/rooms
|
||||
```
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"rooms": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "General Discussion",
|
||||
"category": "general",
|
||||
"post_id": null,
|
||||
"created_at": "2024-01-01T10:00:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Join Chat Room
|
||||
```http
|
||||
POST /api/v1/chat/rooms/{room_id}/join
|
||||
```
|
||||
|
||||
#### Send Message
|
||||
```http
|
||||
POST /api/v1/chat/rooms/{room_id}/messages
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"content": "Hello, world!"
|
||||
}
|
||||
```
|
||||
|
||||
#### Get Messages
|
||||
```http
|
||||
GET /api/v1/chat/rooms/{room_id}/messages?page=1&per_page=50
|
||||
```
|
||||
|
||||
### Posts API Endpoints
|
||||
|
||||
#### Get Posts
|
||||
```http
|
||||
GET /api/v1/posts?page=1&per_page=20
|
||||
```
|
||||
|
||||
#### Create Post
|
||||
```http
|
||||
POST /api/v1/posts
|
||||
Content-Type: multipart/form-data
|
||||
|
||||
title: "Adventure Title"
|
||||
content: "Post content"
|
||||
images: [file uploads]
|
||||
gpx_file: [GPX file upload]
|
||||
```
|
||||
|
||||
### User API Endpoints
|
||||
|
||||
#### Get User Profile
|
||||
```http
|
||||
GET /api/v1/users/{user_id}
|
||||
```
|
||||
|
||||
#### Update Profile
|
||||
```http
|
||||
PUT /api/v1/users/profile
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"bio": "Updated bio",
|
||||
"location": "New location"
|
||||
}
|
||||
```
|
||||
|
||||
## <20>🚀 Quick Start
|
||||
|
||||
### Local Development
|
||||
|
||||
@@ -172,8 +289,54 @@ A modern Flask-based web application for motorcycle enthusiasts featuring advent
|
||||
```
|
||||
|
||||
2. **Access the application**
|
||||
- Web application: http://localhost:5000
|
||||
- Web application: http://localhost:8100
|
||||
- PostgreSQL database: localhost:5432
|
||||
- API endpoints: http://localhost:8100/api/v1
|
||||
|
||||
3. **Production deployment**
|
||||
```bash
|
||||
# Set production environment variables
|
||||
export FLASK_ENV=production
|
||||
export SECRET_KEY="your-secure-production-key"
|
||||
export DATABASE_URL="postgresql://user:password@localhost:5432/moto_adventure"
|
||||
export MAIL_SERVER="your-smtp-server.com"
|
||||
export MAIL_USERNAME="your-email@domain.com"
|
||||
export MAIL_PASSWORD="your-email-password"
|
||||
|
||||
# Run in production mode
|
||||
docker-compose -f docker-compose.prod.yml up -d
|
||||
```
|
||||
|
||||
### 🔧 Configuration
|
||||
|
||||
#### Environment Variables
|
||||
- `SECRET_KEY`: Flask secret key for session management
|
||||
- `DATABASE_URL`: Database connection string
|
||||
- `MAIL_SERVER`: SMTP server for email notifications
|
||||
- `MAIL_PORT`: SMTP port (default: 587)
|
||||
- `MAIL_USE_TLS`: Enable TLS for email (default: True)
|
||||
- `MAIL_USERNAME`: Email account username
|
||||
- `MAIL_PASSWORD`: Email account password
|
||||
- `UPLOAD_PATH`: Custom upload directory path
|
||||
- `MAX_CONTENT_LENGTH`: Maximum file upload size
|
||||
|
||||
#### Admin Configuration
|
||||
To create an admin user:
|
||||
```bash
|
||||
# Access the container
|
||||
docker exec -it moto-adventure-app bash
|
||||
|
||||
# Run Python shell
|
||||
python
|
||||
>>> from app import create_app, db
|
||||
>>> from app.models import User
|
||||
>>> app = create_app()
|
||||
>>> with app.app_context():
|
||||
... admin = User(email='admin@example.com', is_admin=True)
|
||||
... admin.set_password('secure_password')
|
||||
... db.session.add(admin)
|
||||
... db.session.commit()
|
||||
```
|
||||
|
||||
### 📱 Testing Features
|
||||
|
||||
|
||||
Reference in New Issue
Block a user