127 lines
3.8 KiB
Markdown
127 lines
3.8 KiB
Markdown
# ScriptShare - Bash Script Library
|
|
|
|
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
|
|
- 💬 **Comments & Ratings**: Community feedback and discussion
|
|
- 🎨 **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
|
|
|
|
ScriptShare includes a comprehensive admin system with superuser capabilities:
|
|
|
|
### Creating Your First Superuser
|
|
|
|
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.
|
|
|
|
3. **Both scripts will output** your superuser credentials and save them to JSON files
|
|
|
|
### 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
|
|
|
|
### 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
|
|
|
|
### Accessing the Admin Panel
|
|
|
|
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.
|
|
|
|
## 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, comment, 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. |