| Server IP : 3.147.158.171 / Your IP : 216.73.216.216 Web Server : Apache/2.4.67 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-2-178.us-east-2.compute.internal 6.1.172-216.329.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 20 06:31:34 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.21 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /tsai/admin/ |
Upload File : |
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Context
This is the **admin workspace** on the VibeChat EC2 server (Amazon Linux 2023). The primary codebase lives at `/tsai/repo` and has its own detailed `CLAUDE.md` there. This file covers server-level administration.
## Server Layout (`/tsai/`)
```
/tsai/
├── admin/ # Admin workspace (this directory)
├── repo/ # Main codebase (see /tsai/repo/CLAUDE.md)
│ ├── api/ # FastAPI backend (Python, port 8000)
│ ├── chatbot/ # Angular 20 multi-project workspace
│ ├── builder/ # Site orchestration system
│ ├── sites/ # WordPress installations
│ ├── store/ # Drupal 11 SaaS store
│ └── drupal/ # Drupal content/config server
├── cb-build/ # Deployed chatbot builds (creator, player, sas, banner)
├── infra/ # Server config tracking repo (working copy)
├── source/ # Bare git repos (infra.git, john.git, tsai-plugin.git, etc.)
├── www/html/ # Apache document roots (per-subdomain directories)
└── alldb.sql # Latest database dump
```
## Running Services
| Service | Command | Notes |
|---------|---------|-------|
| Apache | `sudo systemctl restart httpd` | Serves all subdomains |
| MariaDB | `sudo systemctl restart mariadb` | Database server |
| PHP-FPM | `sudo systemctl restart php-fpm` | PHP for WordPress/Drupal |
| FastAPI | `sudo systemctl restart jpt-fastapi` | Proxied via `api.turmansolutions.ai` |
FastAPI service definition: `/etc/systemd/system/jpt-fastapi.service`
FastAPI logs: `/tsai/repo/api/python.log`
## Web Hosting
Apache proxies `api.turmansolutions.ai` → `localhost:8000` (FastAPI).
All other subdomains serve static files or PHP from `/tsai/www/html/{subdomain}/`.
### Adding a New Site
Provision via the builder:
```bash
cd /tsai/repo/builder/backend
python run_build.py --config configs/create-site-production.json
```
Or manually add a vhost entry in `/tsai/infra/etc/httpd/conf.d/vhosts.conf`, then:
```bash
sudo systemctl reload httpd
```
## Git Repos
### Source (Bare Repos) at `/tsai/source/`
- `infra.git` — server config files
- `john.git` — main application code (pushed from dev)
- `tsai-plugin.git` — WordPress plugin
- `cb-build.git` — compiled chatbot builds
### Working Copies
- `/tsai/repo/` — working copy of `john.git` (the main app)
- `/tsai/infra/` — working copy of `infra.git` (server configs)
- `/tsai/cb-build/` — working copy of `cb-build.git` (built Angular apps)
## Infrastructure Repo (`/tsai/infra`)
Tracks server config files as symlinks. Most files in `/etc/httpd/conf.d/` symlink into this repo.
**Exception — `/etc/httpd/conf/httpd.conf`:** Tracked in git but NOT symlinked (a broken symlink would prevent Apache from starting). After editing, manually copy:
```bash
cd /tsai/infra && git pull
sudo cp etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf
sudo systemctl restart httpd
```
**Adding new config files to infra tracking:**
```bash
mkdir -p /tsai/infra/etc/someservice
sudo cp -a /etc/someservice/config.conf /tsai/infra/etc/someservice/
sudo chown -R ec2-user:ec2-user /tsai/infra/etc/someservice
sudo mv /etc/someservice/config.conf /etc/someservice/config.conf.bak
sudo ln -s /tsai/infra/etc/someservice/config.conf /etc/someservice/config.conf
cd /tsai/infra && git add . && git commit -m "Track someservice config" && git push
```
## Deployed Chatbot Builds
`/tsai/cb-build/` contains compiled Angular apps (creator, player, sas, banner), served as static files. These are updated by the build/deploy pipeline from `/tsai/repo`.
## Key Domains
| Domain | Purpose |
|--------|---------|
| `turmansolutions.ai` | Main site |
| `api.turmansolutions.ai` | FastAPI backend (proxied to :8000) |
| `chat.turmansolutions.ai` | Player chatbot app |
| `sas.turmansolutions.ai` | SAS widget |
| `cms.turmansolutions.ai` | Drupal CMS |
| `store.turmansolutions.ai` | Drupal SaaS store |
| `{slug}.turmansolutions.ai` | Provisioned WordPress sites |
| `chat-{slug}.turmansolutions.ai` | Provisioned chatbot sites |
## See Also
`/tsai/repo/CLAUDE.md` — full codebase documentation including:
- VibeChat architecture diagram
- Angular project structure and commands
- FastAPI API endpoints
- WordPress/Drupal CMS roles
- Builder system and provisioning workflow
- Environment variables and site configuration
- Testing instructions