> For the complete documentation index, see [llms.txt](https://docs.xenoraa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xenoraa.com/xenoraa-changelog-and-architecture/server-overview-and-architecture-3.md).

# Server Overview & Architecture

## Xenoraa — Server Overview & Architecture

> Auto-synced from `AGENTS.md` on every push to `main`. Last updated: 2026-07-09 19:48 UTC

***

### Server Information

* OS: Ubuntu (EC2)
* External IP: 69.62.75.225
* App directory: /var/www/xenoraa
* Web server: Nginx 1.24.0
* PHP: (system PHP)
* Database: PostgreSQL 16.14 (gopi\_portfolio) — migrated from MySQL on 2026-06-12
* DB User: gopi\_user (SUPERUSER — required for session\_replication\_role during migrations)
* MySQL: still installed but no longer used (backup at /root/mysql\_backup\_pre\_pg\_migration.sql)

### Domains Hosted

* xenoraa.com → /var/www/xenoraa/public
* gopi.blog → /var/www/xenoraa/public
* abirami.info → /var/www/xenoraa/public

### GitHub Repository

* <https://github.com/esscay2025/xenoraa.git>
* Branch: main

### Standard Deployment Command

```bash
cd /var/www/xenoraa
git pull origin main
php artisan migrate --force
php artisan config:cache && php artisan route:cache && php artisan view:cache
```

### Infrastructure

* APP\_URL: <https://xenoraa.com> (fixed from gopi.blog)
* QUEUE\_CONNECTION: redis (was sync)
* CACHE\_DRIVER: redis (was file)
* SESSION\_DRIVER: redis (was file)
* Supervisor config: /etc/supervisor/conf.d/xenoraa-worker.conf (2 workers)
* DB Backups: /root/xenoraa-backup.sh — daily 2:00 AM UTC, 7-day rotation, /var/backups/xenoraa-db/
* Staging: /var/www/xenoraa-staging — staging.xenoraa.com, DB: xenoraa\_staging
* GitHub Actions: .github/workflows/deploy-production.yml (push to main) + deploy-staging.yml (push to develop)
* GitHub Secret: SSH\_PRIVATE\_KEY (Ed25519 deploy key, public key in authorized\_keys)
* Cloudflare WAF: 5 custom rules (block scanners, exploit paths, direct IP, PHP exploits; challenge login)
* Cloudflare: SSL=full, HTTPS enforced, TLS 1.2+, brotli+minify on
* Slack error monitoring: LOG\_SLACK\_WEBHOOK\_URL set, stack=\[single+slack], level=error
* Slack workspace: T0BFX317UMC, channel: #xenoraa-errors

### Installed Packages & System Changes

* nginx (web server)
* MySQL (installed but no longer used — replaced by PostgreSQL)
* PostgreSQL 16.14 (active database)
* php8.3-pgsql (PHP PostgreSQL driver — installed 2026-06-12)
* pymysql, psycopg2-binary (Python DB drivers — installed for migration)
* pgloader (installed but unused — too old for MySQL 8 caching\_sha2\_password)
* PHP with required extensions
* sshpass (installed by Manus for remote deployment)
* redis-server (Phase 1 — cache/session/queue driver, running on 127.0.0.1:6379)
* supervisor (Phase 1 — manages 2 xenoraa-worker processes, auto-restart)
* php8.3-redis (phpredis extension for Laravel Redis)
* PHP OPcache (Phase 3 — 256MB, 20000 files, validate\_timestamps=0)

### GitBook Documentation

* Site: Xenoraa Developer Docs
* GitBook URL: <https://esscay.gitbook.io/xenoraa-developer-docs/>
* Custom Domain: <https://docs.xenoraa.com> (CNAME → 8e756977f8-hosting.gitbook.io, SSL provisioning)
* Organization: goesscay (f6hSPmdjMAnu6GIxg5kD)
* Site ID: site\_vuvNH
* Auto-sync: .github/workflows/sync-gitbook-docs.yml (triggers on push to main after deploy)
* Scripts: .github/scripts/generate\_gitbook\_docs.py + publish\_to\_gitbook\_ci.py
* GitHub Secret: GITBOOK\_TOKEN (API token for GitBook MCP)
* Pages: Welcome, Xena AI API, CRM 2.0, Accounts & Finance, E-Commerce & POS, Super Admin
* v10.0.2 (2026-07-10): Sentry Cron Monitoring — All Scheduled Jobs
  * Sentry SDK: sentry/sentry-laravel already installed (DSN configured in .env)
  * app/Console/Kernel.php: added .sentryMonitor() to all 3 Laravel scheduled commands
    * xenoraa-notification-reminders (every 30 min)
    * xenoraa-trial-reminders (daily 9AM)
    * xena-daily-snapshot (daily 6AM)
  * /usr/local/bin/xenoraa-backup.sh: added Sentry cron check-in curl calls
    * Monitor slug: xenoraa-db-backup (daily 2AM crontab: 0 2 \* \* \*)
    * Sends in\_progress check-in at start, ok on success, error on failure
    * checkin\_margin: 5 min, max\_runtime: 30 min, failure\_issue\_threshold: 1
  * /var/log/xenoraa-backup.log: permissions set to 666 (writable by postgres user)
  * All 4 monitors tested and verified: commands run successfully, backup script exit code 0
  * Monitors auto-created in Sentry on first check-in
  * Sentry Crons dashboard: <https://esscay.sentry.io/crons/>
* v10.0.3 (2026-07-09): Full Sentry Observability Suite — 8 Enhancements
  * \#1 Tenant user context: TenantMiddleware sets Sentry user (id, email, username) + tags (tenant\_id, tenant\_domain, tenant\_plan) on every request
  * \#2 Release tracking: SENTRY\_RELEASE auto-updated to git hash on every GitHub Actions deploy; SENTRY\_ENVIRONMENT=production in .env
  * \#3 Sentry Logs channel: config/logging.php stack now includes sentry\_logs driver; all Log::\* calls stream to Sentry Logs explorer (SENTRY\_ENABLE\_LOGS=true)
  * \#4 Queue job context: SendCampaignJob sets Sentry tags (job, campaign\_id, tenant\_id) + context before processing — every campaign failure shows which tenant
  * \#5 Dynamic traces sampler: AppServiceProvider::boot() registers traces\_sampler closure (100% for /admin/accounts/invoices, /pos/, /login, /payment, /api/, /admin/ecommerce/orders; 10% default)
  * \#6 /up health check endpoint: Route::get("/up") added to routes/web.php before catch-all; "up" added to reservedUsernames regex; returns JSON 200 on xenoraa.com, gopi.blog, staging.xenoraa.com
  * \#7 Business event capture: captureMessage() calls in PaymentController (subscription\_activated), OnboardingController (tenant\_registered), SendTrialExpiryReminders (trial\_expiry\_reminder)
  * \#8 Sentry Feedback widget: Sentry browser SDK + feedbackIntegration() injected in admin.blade.php before ; floating "🐛 Report" button for tenants; pre-fills user id/email/name
  * Fixed: stale bootstrap/cache/config.php had old app path (/var/www/gopi.blog/gopi-portfolio) causing PHP Fatal error; cleared and rebuilt
  * GitHub commit: 1250855
  * Sentry Uptime Monitors (manual setup): <https://esscay.sentry.io/uptime/> — add xenoraa.com/up (1min), gopi.blog/up (5min), staging.xenoraa.com/up (5min)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xenoraa.com/xenoraa-changelog-and-architecture/server-overview-and-architecture-3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
