# EasyStream TiviMate Admin Panel
## Overview
The EasyStream TiviMate Admin Panel is a comprehensive IPTV management platform designed specifically for TiviMate compatibility. This professional-grade solution provides complete control over user management, DNS settings, support systems, and API integration for IPTV service providers.
##

Key Features
### Multi-Level User Management System
- **Admin Role**: Full system access with user creation, management, and system configuration
- **Reseller Role**: Limited access for managing their own customers with credit system
- **Standard User**: Basic access to DNS settings and support tickets
- **Credit System**: Built-in credit management for resellers with transaction history
- **Secure Authentication**: CSRF protection, session management, and password hashing
### DNS/Portal Management (main.php)
- **Real-time DNS Configuration**: Manage multiple IPTV portals simultaneously
- **Status Monitoring**: Live status updates for all configured DNS servers
- **User Assignment**: Assign specific DNS servers to individual users
- **Active/Inactive Toggle**: Enable or disable DNS servers as needed
- **Creation Tracking**: Monitor who created which DNS entries
### Advanced Support System
- **Ticket Management**: Create, track, and manage support tickets
- **Priority Levels**: Low, Medium, High priority classification
- **Status Tracking**: Open, In Progress, Closed status management
- **Message History**: Complete conversation history for each ticket
- **Real-time Communication**: Direct messaging between users and support
- **Admin Controls**: Full ticket management for administrators
### User Profile Management
- **Credential Updates**: Change username and password securely
- **Session Security**: Automatic session regeneration for security
- **Profile Customization**: Personal settings and preferences
- **Security Notifications**: Real-time security status updates
### Internal Notes System
- **Note Creation**: Create and manage internal notes
- **Date Tracking**: Automatic timestamp for all notes
- **Content Management**: Rich text support for detailed notes
- **Search Functionality**: Quick note retrieval system
## Technical Architecture
### Backend Technology Stack
- **PHP 7.4+**: Modern PHP with full OOP support
- **MySQL Database**: Optimized relational database structure
- **Custom MySQL Wrapper**: Secure database abstraction layer
- **Session Management**: Secure session handling with CSRF protection
- **AJAX Integration**: Asynchronous operations for smooth UX
### Frontend Technology Stack
- **Tailwind CSS**: Modern utility-first CSS framework
- **Responsive Design**: Mobile-first approach with full responsive support
- **Font Awesome Icons**: Professional icon library
- **JavaScript ES6+**: Modern JavaScript with async/await support
- **Progressive Web App**: PWA-ready with offline capabilities
### Security Features
- **CSRF Protection**: Cross-Site Request Forgery protection on all forms
- **SQL Injection Prevention**: Prepared statements and parameterized queries
- **XSS Protection**: Input sanitization and output encoding
- **Session Security**: Secure session configuration with HTTP-only cookies
- **Password Hashing**: Bcrypt password hashing with salt
- **Access Control**: Role-based access control (RBAC)
## API System
### TiviMate API Integration
The panel includes a complete RESTful API system designed specifically for TiviMate compatibility:
#### API Endpoint Structure
```