# CULTSCALE Monorepo

Infrastructure for independent cinema.

## Sites

- **CULTSCALE** (`cultscale.com`) - Main website
- **CULTSHOT** (`cultshot.com`) - CULTSHOT website

## Quick Start

**Development:**
```bash
npm run dev              # CULTSCALE dev server (:4321)
npm run dev:cultscale    # CULTSCALE dev server (:4321)
npm run dev:cultshot     # CULTSHOT dev server (:4322)
```

**Build:**
```bash
npm run build            # Build CULTSCALE
npm run build:cultscale  # Build CULTSCALE
npm run build:cultshot   # Build CULTSHOT
```

**Deploy:**
```bash
npm run deploy:cultscale  # Deploy CULTSCALE to Cloudflare Pages
npm run deploy:cultshot   # Deploy CULTSHOT to Cloudflare Pages
```

## Architecture

Multi-site monorepo with shared asset build system:
- Each site lives in `src/sites/{sitename}/`
- Each site builds to `dist/{sitename}/`
- Each site deploys to its own Cloudflare Pages project
- Each site has independent Astro and Wrangler configs

## Documentation

- `.github/copilot-instructions.md` - Development standards and patterns
- `src/assets/README.md` - Asset build system
- `content/branding-guidelines.md` - Brand identity guidelines
- `dns/README.md` - DNS management with OctoDNS

## Repository Structure

```
cultscale/
├── .github/
│   ├── instructions/     # Path-specific technical instructions
│   ├── workflows/        # GitHub Actions
│   └── copilot-instructions.md
├── content/              # Business strategy, product docs, team bios
├── src/
│   ├── assets/          # Brand assets and build system
│   │   ├── src/         # Source files (logos, social media, web images)
│   │   ├── out/         # Generated assets (built by Makefile)
│   │   ├── lib/         # External assets (Git LFS)
│   │   └── Makefile     # Asset build system
│   ├── components/      # Astro UI components
│   ├── layouts/         # Page layouts
│   ├── pages/           # Website pages
│   └── styles/          # Global styles
├── public/              # Static assets (robots.txt, _redirects)
```

## Development

### Prerequisites

- Node.js 24+
- npm
- ImageMagick, Inkscape, rsvg-convert (for asset builds)
- **Termux users**: See `.github/instructions/termux.instructions.md`

### Commands

```bash
# Install dependencies
npm install

# Development servers
npm run dev              # CULTSCALE on :4321
npm run dev:cultscale    # CULTSCALE on :4321
npm run dev:cultshot     # CULTSHOT on :4322

# Build sites
npm run build:cultscale
npm run build:cultshot

# Preview production builds
npm run preview:cultscale  # Preview on :4321
npm run preview:cultshot   # Preview on :4323
```

### Building Assets

```bash
cd src/assets
make all                 # Build all assets (logo, icons, social covers)
```

See `src/assets/README.md` for detailed asset workflow.

## Deployment

Sites auto-deploy to Cloudflare Pages on push to `main`:
- **CULTSCALE**: `.github/workflows/deploy-cultscale.yml`
- **CULTSHOT**: `.github/workflows/deploy-cultshot.yml`

### Domain Aliases (Temporary)

All CULTSCALE brand domains (except `cultshot.com`) currently redirect to `cultscale.com` as an interim solution.

**Alias domains:**
- cultborn.com
- cultreel.com
- cultroll.{app,com,net,org}
- cultscale.{net,org}
- cultsonic.com
- cultsync.com

**DNS Configuration:**
- Redirect-only domains use proxied placeholder A records (`192.0.2.0`) so Cloudflare can intercept traffic at the edge.
- Zone files are in `dns/zones/`

`cultshot.com` is a first-party site on `cultshot-web.pages.dev` and does not participate in the alias redirect.

**Redirect Behavior:**
- Domain redirects are managed via **Cloudflare Bulk Redirects** (GitOps): `dns/bulk-redirects.json` + `.github/workflows/sync-bulk-redirects.yml`.
- `_headers` is used for security/cache headers and `X-Robots-Tag: noindex` on alias domains.

**Managing DNS:**
```bash
cd dns
make validate    # Dry-run changes
make sync        # Apply to Cloudflare
```

## Documentation

- `.github/copilot-instructions.md` - Development standards and workflows
- `src/assets/README.md` - Asset build system
- `content/branding-guidelines.md` - Brand identity guidelines

## Technology Stack

- **Framework**: Astro 5.16+
- **Deployment**: Cloudflare Pages
- **Image Processing**: Sharp (libvips)
- **Build Tools**: Make, ImageMagick, Inkscape
- **Version Control**: Git + Git LFS

---

© 2024-2025 CULTSCALE LLC. All rights reserved.
