|
| 1 | +# StreamBase - OTT Accounts & Cookies Manager |
| 2 | + |
| 3 | +A modern web application for managing and distributing OTT (Over-The-Top) streaming service accounts and cookies. Built with Flask and Supabase for scalable account management. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- 🎬 **Service Management**: Add and manage multiple OTT streaming services |
| 12 | +- 🔐 **Account Distribution**: Support for both credential-based accounts and cookie data |
| 13 | +- 🎨 **Custom Branding**: Upload custom icons and set colors for each service |
| 14 | +- 📱 **Responsive Design**: Mobile-friendly interface with dark/light theme support |
| 15 | +- 👨💼 **Admin Dashboard**: Comprehensive admin panel for service management |
| 16 | +- ⚙️ **Per-Service Settings**: Customize field labels for each service individually |
| 17 | +- 🔔 **New Account Notifications**: Visual indicators for newly added accounts |
| 18 | +- 📊 **Account Analytics**: Track account counts and types per service |
| 19 | + |
| 20 | +## Tech Stack |
| 21 | + |
| 22 | +- **Backend**: Flask (Python) |
| 23 | +- **Database**: Supabase (PostgreSQL) |
| 24 | +- **Storage**: Supabase Storage for icon uploads |
| 25 | +- **Frontend**: HTML5, CSS3, JavaScript (Vanilla) |
| 26 | +- **Styling**: Custom CSS with CSS Variables for theming |
| 27 | + |
| 28 | +## Prerequisites |
| 29 | + |
| 30 | +- Python 3.8 or higher |
| 31 | +- Supabase account and project |
| 32 | +- Modern web browser |
| 33 | + |
| 34 | +-- All credit goes to Replit and ChatGPT😓 |
| 35 | + |
| 36 | +## Installation |
| 37 | + |
| 38 | +1. **Clone the repository** |
| 39 | + ```bash |
| 40 | + git clone https://github.com/walterwhite-69/StreamBase.git |
| 41 | + cd streambase |
| 42 | + ``` |
| 43 | + |
| 44 | +2. **Install dependencies** |
| 45 | + ```bash |
| 46 | + pip install -r requirements.txt |
| 47 | + ``` |
| 48 | + |
| 49 | +3. **Environment Configuration** |
| 50 | + - Copy `.env.template` to `.env` |
| 51 | + - Update the environment variables with your Supabase credentials: |
| 52 | + ```bash |
| 53 | + cp .env.template .env |
| 54 | + ``` |
| 55 | + |
| 56 | +4. **Database Setup** |
| 57 | + |
| 58 | + Create the following tables in your Supabase database: |
| 59 | + |
| 60 | + **Services Table:** |
| 61 | + ```sql |
| 62 | + CREATE TABLE services ( |
| 63 | + id BIGSERIAL PRIMARY KEY, |
| 64 | + name TEXT NOT NULL, |
| 65 | + comments TEXT, |
| 66 | + account_type TEXT DEFAULT 'credentials', |
| 67 | + icon_class TEXT, |
| 68 | + icon_url TEXT, |
| 69 | + color TEXT, |
| 70 | + accounts JSONB DEFAULT '[]', |
| 71 | + has_new_accounts BOOLEAN DEFAULT false, |
| 72 | + created_at TIMESTAMPTZ DEFAULT NOW(), |
| 73 | + updated_at TIMESTAMPTZ DEFAULT NOW() |
| 74 | + ); |
| 75 | + ``` |
| 76 | + |
| 77 | + **Service Settings Table:** |
| 78 | + ```sql |
| 79 | + CREATE TABLE service_settings ( |
| 80 | + id BIGSERIAL PRIMARY KEY, |
| 81 | + service_id BIGINT REFERENCES services(id) ON DELETE CASCADE, |
| 82 | + settings JSONB DEFAULT '{}', |
| 83 | + created_at TIMESTAMPTZ DEFAULT NOW(), |
| 84 | + updated_at TIMESTAMPTZ DEFAULT NOW() |
| 85 | + ); |
| 86 | + ``` |
| 87 | + |
| 88 | + **Global Settings Table:** |
| 89 | + ```sql |
| 90 | + CREATE TABLE settings ( |
| 91 | + id BIGSERIAL PRIMARY KEY, |
| 92 | + key TEXT UNIQUE NOT NULL, |
| 93 | + value JSONB DEFAULT '{}', |
| 94 | + created_at TIMESTAMPTZ DEFAULT NOW(), |
| 95 | + updated_at TIMESTAMPTZ DEFAULT NOW() |
| 96 | + ); |
| 97 | + |
| 98 | + INSERT INTO settings (key, value) VALUES ( |
| 99 | + 'global', |
| 100 | + '{"placeholders": {"user": "User", "pass": "Pass", "expiry": "Expiry", "additional": "Additional"}}' |
| 101 | + ); |
| 102 | + ``` |
| 103 | + |
| 104 | + **Storage Bucket:** |
| 105 | + - Create a storage bucket named `service-icons` in your Supabase project |
| 106 | + - Set the bucket to public access for icon display |
| 107 | + |
| 108 | +## Usage |
| 109 | + |
| 110 | +1. **Start the application** |
| 111 | + ```bash |
| 112 | + python app.py |
| 113 | + ``` |
| 114 | + |
| 115 | +2. **Access the application** |
| 116 | + - Public interface: `http://localhost:5000` |
| 117 | + - Admin dashboard: `http://localhost:5000/admin` |
| 118 | + |
| 119 | +3. **Admin Setup** |
| 120 | + - Use the email configured in your `.env` file to access the admin dashboard |
| 121 | + - Default template email: `admin@access.com` |
| 122 | + |
| 123 | +## Configuration |
| 124 | + |
| 125 | +### Environment Variables |
| 126 | + |
| 127 | +| Variable | Description | Required | |
| 128 | +|----------|-------------|----------| |
| 129 | +| `SUPABASE_URL` | Your Supabase project URL | Yes | |
| 130 | +| `SUPABASE_ANON_KEY` | Your Supabase anonymous key | Yes | |
| 131 | +| `SESSION_SECRET` | Secret key for Flask sessions | Yes | |
| 132 | +| `ADMIN_EMAIL` | Email address for admin access | Yes | |
| 133 | + |
| 134 | +### Service Configuration |
| 135 | + |
| 136 | +Services support two account types: |
| 137 | + |
| 138 | +1. **Credentials**: Traditional username/password accounts |
| 139 | +2. **Cookies**: Browser cookie data for authenticated sessions |
| 140 | + |
| 141 | +### Field Customization |
| 142 | + |
| 143 | +Each service can have customized field labels through the admin settings: |
| 144 | +- Username/Email field label |
| 145 | +- Password field label |
| 146 | +- Expiry field label |
| 147 | +- Additional field label |
| 148 | + |
| 149 | +## File Structure |
| 150 | + |
| 151 | +``` |
| 152 | +streambase/ |
| 153 | +├── app.py # Main Flask application |
| 154 | +├── .env # Environment variables (not in repo) |
| 155 | +├── .env.template # Environment template |
| 156 | +├── requirements.txt # Python dependencies |
| 157 | +├── static/ # Static assets |
| 158 | +│ ├── css/style.css # Main stylesheet |
| 159 | +│ ├── js/main.js # JavaScript functionality |
| 160 | +│ └── walter-white.gif # Static assets |
| 161 | +├── templates/ # Jinja2 templates |
| 162 | +│ ├── base.html # Base template |
| 163 | +│ ├── index.html # Homepage |
| 164 | +│ ├── service.html # Service detail page |
| 165 | +│ ├── admin_login.html # Admin login |
| 166 | +│ ├── admin_dashboard.html # Admin dashboard |
| 167 | +│ ├── admin_service_form.html # Service creation/editing |
| 168 | +│ └── admin_service_settings.html # Service settings |
| 169 | +└── README.md # This file |
| 170 | +``` |
| 171 | + |
| 172 | +## Features Overview |
| 173 | + |
| 174 | +### Public Interface |
| 175 | +- Browse available OTT services |
| 176 | +- View account counts and types |
| 177 | +- Access accounts/cookies with one-click selection |
| 178 | +- Responsive design with theme toggle |
| 179 | + |
| 180 | +### Admin Dashboard |
| 181 | +- Add/edit/delete services |
| 182 | +- Upload custom service icons |
| 183 | +- Configure service colors and branding |
| 184 | +- Manage account data (credentials or cookies) |
| 185 | +- Per-service settings configuration |
| 186 | +- Account status management |
| 187 | + |
| 188 | +### Security Features |
| 189 | +- Session-based admin authentication |
| 190 | +- Environment variable configuration |
| 191 | +- Secure file upload handling |
| 192 | +- Input validation and sanitization |
| 193 | + |
| 194 | +## Browser Support |
| 195 | + |
| 196 | +- Chrome 80+ |
| 197 | +- Firefox 75+ |
| 198 | +- Safari 13+ |
| 199 | +- Edge 80+ |
| 200 | + |
| 201 | +## Find Me On |
| 202 | +-- Discord : @heisenburger_7 |
| 203 | + |
| 204 | +## Contributing |
| 205 | + |
| 206 | +1. Fork the repository |
| 207 | +2. Create a feature branch (`git checkout -b feature/new-feature`) |
| 208 | +3. Commit your changes (`git commit -am 'Add new feature'`) |
| 209 | +4. Push to the branch (`git push origin feature/new-feature`) |
| 210 | +5. Create a Pull Request |
| 211 | + |
| 212 | +## License |
| 213 | + |
| 214 | +This project is licensed under the MIT License - see the LICENSE file for details. |
| 215 | + |
| 216 | +## Support |
| 217 | + |
| 218 | +For support and questions, please open an issue in the GitHub repository. |
0 commit comments