# Codebase Index

## Overview
- Primary stack: PHP application with a Node.js companion service, MySQL SQL dump present, Nginx/Apache/IIS configs included, FFmpeg binaries for media processing.
- Likely product: Social/community platform (folders like themes/wowonder, wowonder.sql, sources/forum, groups, pages, blogs, messaging, etc.).

## Entry points and main apps
- Web entrypoints:
  - index.php (root site)
  - admincp.php, admin-panel/ (admin interface)
  - api.php, api-v2.php, app_api.php; plus REST subfolders under api/ (v2, phone, windows_app)
  - xhr/ (large set of PHP endpoints for AJAX/XHR actions)
- Node.js service:
  - nodejs/main.js with controllers, events, listeners, models, templates
  - nodejs/package.json, package-lock.json

## Core application directories
- sources/ — page controllers and feature modules (e.g., blog, forum, events, jobs, groups, pages, explore, auth flows, etc.).
- xhr/ — AJAX endpoints for actions like chat, payments, user/profile edits, calls, uploads, etc.
- assets/ — PHP init, libraries, languages, includes (common bootstrap/config pieces typically live here: assets/init.php).
- themes/ — Frontend themes (wowonder, sunshine).
- upload/ — User-generated content (photos, videos, sounds, files, games).
- admin-panel/ — Admin UI (pages/, vendors/, assets/, videos/).
- api/ — API HTML placeholder plus platforms (v2, phone, windows_app).

## Configuration and infrastructure
- config.php — Primary PHP configuration (database and app settings likely).
- assets/init.php — App bootstrap/init (commonly included across endpoints).
- nginx.conf — Nginx config.
- htaccess.txt — Apache rules (may be used as .htaccess on Apache).
- web.config.xml — IIS configuration.
- php.ini — PHP configuration overrides.
- OneSignalSDKWorker.js — Push notifications service worker.
- robots.txt, sitemap.xml, sitemap-index.xml.

## Media processing
- ffmpeg/ — Bundled FFmpeg binaries, qt-faststart, manpages; used for video/audio processing.

## Data and caching
- wowonder.sql — Database dump/schema.
- cache/ — Template/HTML fragments and groups; many sidebar-*.tpl files present.
- script_backups/ — Dated backups (e.g., 24-07-2025).

## Utilities and cron
- cron-job.php — Scheduled tasks runner.
- updater.php — Update/migration entrypoint.
- system_status.php — System diagnostics/status.
- phpmyadmin/ — Bundled phpMyAdmin (note: consider securing or removing in production).

## Payments and integrations (via xhr/ and sources/)
- Multiple gateway handlers (2Checkout, Coinbase, Braintree, Cashfree, Bank transfer, etc.).
- SMS/phone verification flows (confirm_sms*.php).
- OneSignal worker present; likely push notifications integrated.

## Notes and cautions
- phpmyadmin/ present in web root — ensure it’s disabled or protected in production.
- ffmpeg binaries committed — confirm they match server environment and permissions.
- Large cache/ directory committed — consider gitignoring volatile caches if not needed.
- Mixed web server configs (nginx.conf, htaccess.txt, web.config.xml) — select the one relevant to your deployment.

## Suggested next steps
- Save a CODEBASE_INDEX.md to /docs with this content (this file).
- Optional deeper index:
  - Enumerate API and XHR endpoints with brief descriptions.
  - Map major PHP includes/bootstraps and global config flow.
  - Extract Node.js service responsibilities and dependencies.
  - Generate a DB schema overview from wowonder.sql.
  - Produce a dependency diagram and request flow for key features (auth, posts, chat, payments).

