Enhance ESLint configuration for TypeScript and React, update dependencies, and add new super admin setup script. Update README for improved clarity on superuser setup options and modify user interface components for better user experience.

This commit is contained in:
2025-08-13 00:51:44 +01:00
parent aa10ea0b26
commit 936293ba92
32 changed files with 7266 additions and 184 deletions

View File

@ -61,55 +61,74 @@ This app uses a MySQL database hosted on Digital Ocean. You'll need to:
## Superuser Admin Setup
ScriptShare includes a comprehensive admin system with superuser capabilities:
### Option 1: Interactive Setup (Recommended for First Time)
### Creating Your First Superuser
Run the interactive setup script to create your first superuser account:
You have two options for creating your first superuser:
#### Option 1: Quick Setup (Recommended for Development)
```bash
npm run create-default-superuser
```
This creates a default superuser with these credentials:
- **Email**: admin@scriptshare.com
- **Password**: admin123
- **Username**: admin
- **Display Name**: System Administrator
⚠️ **Important**: Change the password immediately after first login!
#### Option 2: Interactive Setup
```bash
npm run create-superuser
```
This prompts you to enter custom details for your admin account.
This will prompt you for:
- Email address
- Username
- Display name
- Password
- Bio (optional)
- Avatar URL (optional)
3. **Both scripts will output** your superuser credentials and save them to JSON files
### Option 2: Default Superuser Setup
Create a default superuser with predefined credentials:
```bash
npm run create-default-superuser
```
This creates a superuser with:
- Email: `admin@scriptshare.com`
- Username: `admin`
- Password: `admin123`
### Option 3: Oliver Super Admin Setup
To set up 'Oliver' as the super admin (as requested):
1. **Open the setup tool**: Open `setup-oliver-admin.html` in your browser
2. **Click Setup**: Click the "Setup Oliver Super Admin" button
3. **Navigate to ScriptShare**: Go to your ScriptShare application
4. **Refresh the page**: You should now be logged in as Oliver Super Admin
**Oliver Super Admin Details:**
- Email: `oliver@scriptshare.com`
- Username: `oliver`
- Display Name: `Oliver`
- Role: Super Administrator
- Permissions: Full system access (12 permissions)
### Admin Panel Features
- **Dashboard**: Overview of platform statistics and recent activity
- **User Management**: Create and manage admin users and moderators
- **Content Moderation**: Review and approve submitted scripts
- **System Monitoring**: Track platform health and performance
- **Analytics**: View usage statistics and trends
Once logged in as a superuser, you can access the admin panel which includes:
- **Dashboard**: System overview and quick actions
- **User Management**: Create new admin users, promote existing users
- **Script Review**: Approve/reject submitted scripts
- **Analytics**: View system statistics and user activity
- **System Configuration**: Manage application settings
### Permission Levels
- **Super User**: Full system access including user management and system configuration
- **Admin User**: Content moderation and user management capabilities
- **Moderator**: Basic content review and approval permissions
- **Super User**: Full access to all features and permissions
- **Admin**: Can manage users, moderate content, and view analytics
- **Moderator**: Can approve/reject scripts and moderate comments
- **Regular User**: Can submit scripts, comment, and rate content
### Accessing the Admin Panel
### Access Instructions
1. Log in with your superuser account
2. Navigate to `/admin` or click "Super Admin" in the user menu
3. Use the dashboard to manage the platform
**Note**: Only users with admin privileges can access the admin panel.
1. Log in with your superuser/admin account
2. Click on your user avatar in the top-right corner
3. Select "Super Admin" (for superusers) or "Admin Panel" (for admins)
4. Navigate between different admin views using the sidebar
## Script Submission Process