chore: cleanup project structure and update readme for beta release

This commit is contained in:
2025-12-23 04:59:21 +07:00
parent 1640ced748
commit 10a00bac0e
122 changed files with 8320 additions and 661 deletions

82
config/broadcasting.php Normal file
View File

@@ -0,0 +1,82 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "reverb", "pusher", "ably", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_CONNECTION', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over WebSockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'reverb' => [
'driver' => 'reverb',
'key' => env('REVERB_APP_KEY'),
'secret' => env('REVERB_APP_SECRET'),
'app_id' => env('REVERB_APP_ID'),
'options' => [
'host' => env('REVERB_HOST'),
'port' => env('REVERB_PORT', 443),
'scheme' => env('REVERB_SCHEME', 'https'),
'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],
'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];

View File

@@ -0,0 +1,253 @@
<?php
/*
|--------------------------------------------------------------------------
| HD Avatar Configuration
|--------------------------------------------------------------------------
| Configuration for high-definition avatar generation with enhanced
| performance through image export and storage optimization.
|
*/
return [
/*
|--------------------------------------------------------------------------
| HD Image Settings
|--------------------------------------------------------------------------
| Configuration for high-definition avatar generation
|
*/
'hd' => [
// Enable HD mode - when true, uses higher resolution settings
'enabled' => env('AVATAR_HD_ENABLED', true),
// HD dimensions (default: 512x512, supports up to 2048x2048)
'width' => env('AVATAR_HD_WIDTH', 512),
'height' => env('AVATAR_HD_HEIGHT', 512),
// HD font size (scales with dimensions)
'fontSize' => env('AVATAR_HD_FONT_SIZE', 192),
// Export quality settings
'quality' => [
'png' => env('AVATAR_HD_PNG_QUALITY', 95),
'jpg' => env('AVATAR_HD_JPG_QUALITY', 90),
'webp' => env('AVATAR_HD_WEBP_QUALITY', 85),
],
// Anti-aliasing for smoother edges
'antialiasing' => env('AVATAR_HD_ANTIALIASING', true),
// DPI for high-quality rendering
'dpi' => env('AVATAR_HD_DPI', 300),
],
/*
|--------------------------------------------------------------------------
| Export and Storage Settings
|--------------------------------------------------------------------------
| Configuration for image export and storage optimization
|
*/
'export' => [
// Default export format
'format' => env('AVATAR_EXPORT_FORMAT', 'png'), // png, jpg, webp
// Export path (relative to storage/app)
'path' => env('AVATAR_EXPORT_PATH', 'avatars'),
// Filename pattern: {name}, {initials}, {hash}, {timestamp}
'filename_pattern' => env('AVATAR_EXPORT_FILENAME', '{hash}_{timestamp}.{format}'),
// Enable multiple format export
'multiple_formats' => env('AVATAR_EXPORT_MULTIPLE', false),
// Progressive JPEG for better loading
'progressive_jpeg' => env('AVATAR_PROGRESSIVE_JPEG', true),
// WebP lossless compression
'webp_lossless' => env('AVATAR_WEBP_LOSSLESS', false),
],
/*
|--------------------------------------------------------------------------
| Performance and Caching
|--------------------------------------------------------------------------
| Enhanced caching and performance settings for HD avatars
|
*/
'performance' => [
// Enable file-based caching in addition to memory cache
'file_cache' => env('AVATAR_FILE_CACHE', true),
// Cache different sizes separately
'size_based_cache' => env('AVATAR_SIZE_CACHE', true),
// Preload fonts for better performance
'preload_fonts' => env('AVATAR_PRELOAD_FONTS', true),
// Background processing for large batches
'background_processing' => env('AVATAR_BACKGROUND_PROCESSING', false),
// Lazy loading support
'lazy_loading' => env('AVATAR_LAZY_LOADING', true),
// Compression levels
'compression' => [
'png' => env('AVATAR_PNG_COMPRESSION', 6), // 0-9
'webp' => env('AVATAR_WEBP_COMPRESSION', 80), // 0-100
],
],
/*
|--------------------------------------------------------------------------
| Storage Management
|--------------------------------------------------------------------------
| Configuration for storage optimization and cleanup
|
*/
'storage' => [
// Automatic cleanup of old files
'auto_cleanup' => env('AVATAR_AUTO_CLEANUP', true),
// Maximum age for cached files (in days)
'max_age_days' => env('AVATAR_MAX_AGE_DAYS', 30),
// Maximum storage size (in MB, 0 = unlimited)
'max_storage_mb' => env('AVATAR_MAX_STORAGE_MB', 500),
// Storage driver (local, s3, etc.)
'disk' => env('AVATAR_STORAGE_DISK', 'local'),
// CDN URL for serving images
'cdn_url' => env('AVATAR_CDN_URL', null),
// Enable storage metrics
'metrics' => env('AVATAR_STORAGE_METRICS', false),
],
/*
|--------------------------------------------------------------------------
| HD Themes
|--------------------------------------------------------------------------
| Enhanced themes with HD-specific optimizations
|
*/
'hd_themes' => [
'ultra-hd' => [
'width' => 1024,
'height' => 1024,
'fontSize' => 384,
'backgrounds' => [
'#667eea', '#764ba2', '#f093fb', '#f5576c',
'#4facfe', '#00f2fe', '#43e97b', '#38f9d7',
'#ffecd2', '#fcb69f', '#a8edea', '#fed6e3',
],
'foregrounds' => ['#FFFFFF'],
'border' => [
'size' => 4,
'color' => 'foreground',
'radius' => 8,
],
],
'retina' => [
'width' => 512,
'height' => 512,
'fontSize' => 192,
'backgrounds' => [
'#667eea', '#764ba2', '#f093fb', '#f5576c',
'#4facfe', '#00f2fe', '#43e97b', '#38f9d7',
],
'foregrounds' => ['#FFFFFF'],
],
'material-hd' => [
'width' => 384,
'height' => 384,
'fontSize' => 144,
'shape' => 'circle',
'backgrounds' => [
'#1976D2', '#388E3C', '#F57C00', '#7B1FA2',
'#5D4037', '#455A64', '#E64A19', '#00796B',
],
'foregrounds' => ['#FFFFFF'],
'border' => [
'size' => 2,
'color' => 'background',
'radius' => 0,
],
],
],
/*
|--------------------------------------------------------------------------
| Responsive Sizes
|--------------------------------------------------------------------------
| Predefined sizes for responsive avatar generation
|
*/
'responsive_sizes' => [
'thumbnail' => ['width' => 64, 'height' => 64, 'fontSize' => 24],
'small' => ['width' => 128, 'height' => 128, 'fontSize' => 48],
'medium' => ['width' => 256, 'height' => 256, 'fontSize' => 96],
'large' => ['width' => 512, 'height' => 512, 'fontSize' => 192],
'xl' => ['width' => 768, 'height' => 768, 'fontSize' => 288],
'xxl' => ['width' => 1024, 'height' => 1024, 'fontSize' => 384],
],
/*
|--------------------------------------------------------------------------
| Advanced Features
|--------------------------------------------------------------------------
| Additional HD avatar features
|
*/
'features' => [
// Generate avatar sprites for animations
'sprites' => env('AVATAR_SPRITES', false),
// Generate avatar variations (different colors/styles)
'variations' => env('AVATAR_VARIATIONS', false),
// Generate blur placeholder images
'placeholders' => env('AVATAR_PLACEHOLDERS', true),
// Generate different aspect ratios
'aspect_ratios' => env('AVATAR_ASPECT_RATIOS', false),
// Watermarking support
'watermark' => [
'enabled' => env('AVATAR_WATERMARK', false),
'text' => env('AVATAR_WATERMARK_TEXT', ''),
'opacity' => env('AVATAR_WATERMARK_OPACITY', 0.3),
'position' => env('AVATAR_WATERMARK_POSITION', 'bottom-right'),
],
],
/*
|--------------------------------------------------------------------------
| API Settings
|--------------------------------------------------------------------------
| Configuration for avatar API endpoints
|
*/
'api' => [
// Enable avatar API endpoints
'enabled' => env('AVATAR_API_ENABLED', true),
// Rate limiting (requests per minute)
'rate_limit' => env('AVATAR_API_RATE_LIMIT', 60),
// Enable CORS for API endpoints
'cors' => env('AVATAR_API_CORS', true),
// API authentication
'auth' => env('AVATAR_API_AUTH', false),
// Response headers
'headers' => [
'Cache-Control' => 'public, max-age=31536000', // 1 year
'Expires' => gmdate('D, d M Y H:i:s', time() + 31536000).' GMT',
],
],
];

174
config/laravolt/avatar.php Normal file
View File

@@ -0,0 +1,174 @@
<?php
/*
* Set specific configuration variables here
*/
return [
/*
|--------------------------------------------------------------------------
| Image Driver
|--------------------------------------------------------------------------
| Avatar use Intervention Image library to process image.
| Meanwhile, Intervention Image supports "GD Library" and "Imagick" to process images
| internally. You may choose one of them according to your PHP
| configuration. By default PHP's "GD Library" implementation is used.
|
| Supported: "gd", "imagick"
|
*/
'driver' => env('IMAGE_DRIVER', 'gd'),
/*
|--------------------------------------------------------------------------
| Cache Configuration
|--------------------------------------------------------------------------
| Control caching behavior for avatars
|
*/
'cache' => [
// Set to true to enable caching, false to disable
'enabled' => env('AVATAR_CACHE_ENABLED', true),
// Cache prefix to avoid conflicts with other cached items
'key_prefix' => 'avatar_',
// Cache duration in seconds
// Set to null to cache forever, 0 to disable cache
// Default: 86400 (24 hours)
'duration' => env('AVATAR_CACHE_DURATION', 86400),
],
// Initial generator class
'generator' => \Laravolt\Avatar\Generator\DefaultGenerator::class,
// Whether all characters supplied must be replaced with their closest ASCII counterparts
'ascii' => false,
// Image shape: circle or square
'shape' => 'circle',
// Image width, in pixel
'width' => 100,
// Image height, in pixel
'height' => 100,
// Responsive SVG, height and width attributes are not added when true
'responsive' => false,
// Number of characters used as initials. If name consists of single word, the first N character will be used
'chars' => 2,
// font size
'fontSize' => 48,
// convert initial letter in uppercase
'uppercase' => false,
// Right to Left (RTL)
'rtl' => false,
// Fonts used to render text.
// If contains more than one fonts, randomly selected based on name supplied
'fonts' => [__DIR__.'/../fonts/OpenSans-Bold.ttf', __DIR__.'/../fonts/rockwell.ttf'],
// List of foreground colors to be used, randomly selected based on name supplied
'foregrounds' => [
'#FFFFFF',
],
// List of background colors to be used, randomly selected based on name supplied
'backgrounds' => [
'#f44336',
'#E91E63',
'#9C27B0',
'#673AB7',
'#3F51B5',
'#2196F3',
'#03A9F4',
'#00BCD4',
'#009688',
'#4CAF50',
'#8BC34A',
'#CDDC39',
'#FFC107',
'#FF9800',
'#FF5722',
],
'border' => [
'size' => 1,
// border color, available value are:
// 'foreground' (same as foreground color)
// 'background' (same as background color)
// or any valid hex ('#aabbcc')
'color' => 'background',
// border radius, currently only work for SVG
'radius' => 0,
],
// List of theme name to be used when rendering avatar
// Possible values are:
// 1. Theme name as string: 'colorful'
// 2. Or array of string name: ['grayscale-light', 'grayscale-dark']
// 3. Or wildcard "*" to use all defined themes
'theme' => ['colorful'],
// Predefined themes
// Available theme attributes are:
// shape, chars, backgrounds, foregrounds, fonts, fontSize, width, height, ascii, uppercase, and border.
'themes' => [
'grayscale-light' => [
'backgrounds' => ['#edf2f7', '#e2e8f0', '#cbd5e0'],
'foregrounds' => ['#a0aec0'],
],
'grayscale-dark' => [
'backgrounds' => ['#2d3748', '#4a5568', '#718096'],
'foregrounds' => ['#e2e8f0'],
],
'colorful' => [
'backgrounds' => [
'#f44336',
'#E91E63',
'#9C27B0',
'#673AB7',
'#3F51B5',
'#2196F3',
'#03A9F4',
'#00BCD4',
'#009688',
'#4CAF50',
'#8BC34A',
'#CDDC39',
'#FFC107',
'#FF9800',
'#FF5722',
],
'foregrounds' => ['#FFFFFF'],
],
'pastel' => [
'backgrounds' => [
'#ef9a9a',
'#F48FB1',
'#CE93D8',
'#B39DDB',
'#9FA8DA',
'#90CAF9',
'#81D4FA',
'#80DEEA',
'#80CBC4',
'#A5D6A7',
'#E6EE9C',
'#FFAB91',
'#FFCCBC',
'#D7CCC8',
],
'foregrounds' => [
'#FFF',
],
],
],
];

View File

@@ -50,6 +50,21 @@ return [
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
],
'support' => [
'transport' => env('MAIL_SUPPORT_MAILER', 'smtp'),
'host' => env('MAIL_SUPPORT_HOST', '127.0.0.1'),
'port' => env('MAIL_SUPPORT_PORT', 2525),
'username' => env('MAIL_SUPPORT_USERNAME'),
'password' => env('MAIL_SUPPORT_PASSWORD'),
'encryption' => env('MAIL_SUPPORT_ENCRYPTION', 'tls'),
'from' => [
'address' => env('MAIL_SUPPORT_FROM_ADDRESS', 'support@lab.dyzulk.com'),
'name' => env('MAIL_SUPPORT_FROM_NAME', 'DyDev Support'),
],
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
],
'ses' => [
'transport' => 'ses',
],

95
config/reverb.php Normal file
View File

@@ -0,0 +1,95 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Reverb Server
|--------------------------------------------------------------------------
|
| This option controls the default server used by Reverb to handle
| incoming messages as well as broadcasting message to all your
| connected clients. At this time only "reverb" is supported.
|
*/
'default' => env('REVERB_SERVER', 'reverb'),
/*
|--------------------------------------------------------------------------
| Reverb Servers
|--------------------------------------------------------------------------
|
| Here you may define details for each of the supported Reverb servers.
| Each server has its own configuration options that are defined in
| the array below. You should ensure all the options are present.
|
*/
'servers' => [
'reverb' => [
'host' => env('REVERB_SERVER_HOST', '0.0.0.0'),
'port' => env('REVERB_SERVER_PORT', 8080),
'path' => env('REVERB_SERVER_PATH', ''),
'hostname' => env('REVERB_HOST'),
'options' => [
'tls' => [],
],
'max_request_size' => env('REVERB_MAX_REQUEST_SIZE', 10_000),
'scaling' => [
'enabled' => env('REVERB_SCALING_ENABLED', false),
'channel' => env('REVERB_SCALING_CHANNEL', 'reverb'),
'server' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'port' => env('REDIS_PORT', '6379'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'database' => env('REDIS_DB', '0'),
'timeout' => env('REDIS_TIMEOUT', 60),
],
],
'pulse_ingest_interval' => env('REVERB_PULSE_INGEST_INTERVAL', 15),
'telescope_ingest_interval' => env('REVERB_TELESCOPE_INGEST_INTERVAL', 15),
],
],
/*
|--------------------------------------------------------------------------
| Reverb Applications
|--------------------------------------------------------------------------
|
| Here you may define how Reverb applications are managed. If you choose
| to use the "config" provider, you may define an array of apps which
| your server will support, including their connection credentials.
|
*/
'apps' => [
'provider' => 'config',
'apps' => [
[
'key' => env('REVERB_APP_KEY'),
'secret' => env('REVERB_APP_SECRET'),
'app_id' => env('REVERB_APP_ID'),
'options' => [
'host' => env('REVERB_HOST'),
'port' => env('REVERB_PORT', 443),
'scheme' => env('REVERB_SCHEME', 'https'),
'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
],
'allowed_origins' => ['*'],
'ping_interval' => env('REVERB_APP_PING_INTERVAL', 60),
'activity_timeout' => env('REVERB_APP_ACTIVITY_TIMEOUT', 30),
'max_connections' => env('REVERB_APP_MAX_CONNECTIONS'),
'max_message_size' => env('REVERB_APP_MAX_MESSAGE_SIZE', 10_000),
],
],
],
];