Files
scriptshare-cursor-clone/README.md

146 lines
4.2 KiB
Markdown
Raw Normal View History

# ScriptShare - Bash Script Library
2025-08-12 20:26:28 +00:00
A modern, community-driven platform for discovering, sharing, and collaborating on bash scripts for system administration, automation, and development.
## Features
- 🚀 **Browse & Search**: Find scripts by category, OS compatibility, and other filters
- 📝 **Submit Scripts**: Share your scripts with the community
- 🔍 **Advanced Filtering**: Filter by OS, categories, date added, and more
- 👥 **User Profiles**: Manage your scripts and track contributions
- 🛡️ **Community Review**: All scripts are reviewed for quality and security
- 📊 **Analytics**: Track script views, downloads, and popularity
-**Rating System**: Community ratings and feedback
- 🎨 **Modern UI**: Beautiful, responsive design with dark/light themes
- 🔐 **Authentication**: Secure user accounts and profiles
## Tech Stack
- **Frontend**: React 18 + TypeScript + Vite
- **Styling**: Tailwind CSS + shadcn/ui components
- **Database**: MySQL (Digital Ocean Managed Database)
- **ORM**: Drizzle ORM
- **State Management**: React Query + React Context
- **Routing**: React Router DOM
- **Forms**: React Hook Form + Zod validation
## Getting Started
1. **Install dependencies**:
```bash
npm install
```
2. **Set up environment variables**:
```bash
cp .env.example .env.local
# Edit .env.local with your database credentials
```
3. **Set up the database**:
```bash
npm run db:generate
npm run db:migrate
```
4. **Start development server**:
```bash
npm run dev
```
5. **Open your browser**:
Navigate to `http://localhost:5173`
## Database Setup
This app uses a MySQL database hosted on Digital Ocean. You'll need to:
1. Create a managed MySQL database on Digital Ocean
2. Get your connection credentials
3. Update the `.env.local` file with your database details
## Superuser Admin Setup
### Option 1: Interactive Setup (Recommended for First Time)
Run the interactive setup script to create your first superuser account:
```bash
npm run create-superuser
```
This will prompt you for:
- Email address
- Username
- Display name
- Password
- Bio (optional)
- Avatar URL (optional)
### 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
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 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
### Access Instructions
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
1. Users submit scripts through the `/submit` page
2. Scripts are reviewed by community moderators
3. Approved scripts appear in the public library
4. Users can rate and download approved scripts
## Contributing
We welcome contributions! Please see our contributing guidelines for more details.
## License
This project is licensed under the MIT License.