Development
This guide covers the development workflow, available commands, project structure, and deployment process for Omega Social Media, including the Expo mobile app.
Development Commands
Server & Assets
# Start Vite with hot module replacement
npm run dev
Locally, the project's guidelines assume Laravel Herd (served at <kebab-case-project-dir>.test); any PHP server pointing at public/ also works.
Database & Admin
php artisan migrate
Queue, WebSockets & Scheduler
# Process queues (requires QUEUE_CONNECTION=redis)
php artisan horizon
Maintenance Commands
php artisan story:clear
Testing & Code Quality
./vendor/bin/pest
Backend tests live in tests/Unit and tests/Feature (the PHPUnit suites), with mobile API tests in tests/Feature/Api/Mobile and browser tests (Laravel Dusk) in tests/Browser. The test environment uses a MySQL database named omega_social_media, array cache and sessions, and a sync queue.
Mobile App Commands
Run from the mobile/ directory:
npm start
Mobile tests use Jest with the jest-expo preset and Testing Library for React Native. They are organized under mobile/__tests__/ into api, components, hooks, providers, screens, store, and utils.
Project Structure
Application Core
app/Models/— Eloquent models for users, posts, stories, chats, media, marketplace, jobs, ads, live streams, credits, payments, and withdrawals.app/Enums/— Domain enums (Ad, Chat, LiveStream, Payment, Wallet, and more).app/Actions/— Single-purpose actions such as deleting posts, comments, chats, stories, and users.app/Services/— Business logic: Payment, Credits, Donations, Agora, Discover, Geolocation, Translation, and others.app/Policies/,app/Rules/,app/Validation/— Authorization and validation.
HTTP & UI
app/Http/Controllers/—Admin,Api,Business,Downloads,User.app/Http/Resources/— API resources for the mobile API.app/Livewire/— Business and user Livewire components.resources/js/spa/apps/desktopandmobile— The two Vue SPAs.resources/js/admin,business,document,mpa— Entry points for admin, business, document, and multi-page scripts.
Routing
routes/web.php,social.php,business.php,document.php,downloads.php— Web routes.routes/admin/— Admin panel routes.routes/api.php,routes/api/mobile.php— Web SPA API and mobile API.routes/channels.php— Broadcast channel authorization.routes/webhooks/— Payment webhooks.
Background & Events
app/Jobs/— Media conversion, story video, view counting, and withdrawal jobs.app/Events/andapp/Listeners/— Broadcast events (live stream, chat, timeline) and listeners such asStripeEventListener.app/Console/Commands/— Admin, chat, demo, mail, story, and system commands.
Mobile App
mobile/
app/— Expo Router screens.src/api,store,providers,services,hooks,components,i18n,theme,types,utils.app.json,eas.json— Expo and EAS configuration.DEPLOY_GUIDE.md— App Store and Google Play submission guide.
Configuration
config/— Includespayment.php,credits.php,agora.php,mobile.php,reverb.php,horizon.php,social-login.php,ffmpeg.php,demo.php, and standard Laravel files..env.example— Documented environment template.
Tooling & CI
tests/— Pest tests (Unit, Feature) and Dusk browser tests..github/workflows/—lint.yml(Pint, Prettier, ESLint) andtests.yml(Pest and Dusk against MySQL 8.0 with FFmpeg).phpstan.neon,pint.json— Static analysis and code style.Envoy.blade.php— Zero-downtime deployment script.
Deployment
Backend (Laravel Envoy)
Deployment is a zero-downtime, release-directory flow run with Envoy:
php vendor/bin/envoy run deploy
Required variables in .env: DEPLOY_USER, DEPLOY_HOST, DEPLOY_REPOSITORY, DEPLOY_RELEASE_DIR, and DEPLOY_APP_DIR; DEPLOY_BRANCH defaults to main.
The script uses the GitHub CLI to read the latest CI run on main and refuses to deploy unless its conclusion is success. To roll back, push a correcting commit and deploy again.
What the Envoy Script Does
- clone-repository — Clones the repository into a new timestamped release directory and resets it to the commit of the successful CI run.
- update-symlinks — Links the shared
storagedirectory and.envinto the release and sets permissions. - run-composer — Runs
composer install,php artisan migrate --force, clears caches, publishes log-viewer assets, caches config, routes, views, and events, and runsphp artisan reverb:restart. - run-node — Installs npm dependencies and runs
npm run build. - switch-release — Points the
currentsymlink at the new release, runsphp artisan storage:link, runsphp artisan horizon:terminateso Horizon restarts on the new code, and reloads PHP-FPM. - clean-old-releases — Removes old releases.
Post-Deployment Configuration
- Process Manager — Keep
php artisan horizonandphp artisan reverb:startrunning under a process manager, and run the scheduler every minute (php artisan schedule:run). - Stripe — Configure the webhook signing secret in
STRIPE_WEBHOOK_SECRETand enable Stripe Connect withSTRIPE_CONNECT_ENABLED=trueif you pay out creators. - Environment — Set
APP_ENV=production,APP_DEBUG=false, andQUEUE_CONNECTION=redis. - Web Server — Point the document root at
public/; the app trusts proxies (trustProxies('*')). - Mobile Deep Links — Set the
MOBILE_*variables andMOBILE_REDIRECT_ENABLED=trueto prompt mobile visitors to open the native app. - Monitoring — Use Sentry, the Horizon dashboard, Spatie Health, and the
/uproute.
Mobile App (EAS)
- Install the EAS CLI (
npm install -g eas-cli) and runeas login. - Build with
eas build --profile production --platform all. Theproductionprofile setsEXPO_PUBLIC_API_URLineas.jsonand auto-increments build numbers; version numbers are managed remotely (appVersionSource: remote). - Submit with
eas submit --profile production. The Android submit profile uploads to theproductiontrack as a draft. - App identifiers are
com.omega.socialon both iOS and Android, with theomega-socialURL scheme. Runtime version isexposdk:54.0.0and OTA updates useexpo-updates. - Camera, microphone, and photo library permission strings are declared in
app.jsonfor live streaming and media sharing. Production APIs must use HTTPS.
See mobile/DEPLOY_GUIDE.md in the repository for the full store submission walkthrough, including Apple in-app purchase notes and common rejection reasons.