Public files and resources for Aman Bhargava's Engineering, Science, Applied Mathematics, and Natural/Philosophy educational resources and works.
  • JavaScript 51.4%
  • HTML 44.5%
  • CSS 2.6%
  • Python 1.4%
Find a file Use this template
Aman Bhargava 2709767f35 Publish Reaching In (Twenty Watts, chapter four); restore the Essays section
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-02 20:53:23 -07:00
functions/media IA pass per EngSci++ live-state handoff: /library/ hub, engsci-plus-plus index, robots.txt, real 404, project-stories redirect; llms-emotion remuxed to mp4; no-store on media 404s 2026-07-27 05:00:34 -07:00
public Publish Reaching In (Twenty Watts, chapter four); restore the Essays section 2026-09-02 20:53:23 -07:00
scripts scaffold aman.holdings: Pages + R2 lecture site, first lecture staged 2026-07-27 00:54:28 -07:00
.gitignore scaffold aman.holdings: Pages + R2 lecture site, first lecture staged 2026-07-27 00:54:28 -07:00
README.md scaffold aman.holdings: Pages + R2 lecture site, first lecture staged 2026-07-27 00:54:28 -07:00
wrangler.toml scaffold aman.holdings: Pages + R2 lecture site, first lecture staged 2026-07-27 00:54:28 -07:00

aman.holdings

Aman Bhargava's personal lecture site: the Engineering Science abridged series plus extensions and AI-augmented lectures, presented in the Cartesian Theatre player.

Architecture

  • Cloudflare Pages serves everything in public/ (viewer code, transcripts, slides, telemetry chunks — every file stays under the 25 MiB Pages limit).
  • Cloudflare R2 (aman-holdings-media) holds the multi-gigabyte media masters. functions/media/[[path]].ts serves them same-origin at /media/<key> with full byte-range support, so seeking is instant and no CORS or crossorigin plumbing is needed.
  • No servers. Storage is ~$0.015/GB-month; R2 egress is free.

Layout

public/
├── index.html                      # lecture library landing page
└── lectures/<slug>/                # one Cartesian Theatre package per lecture
functions/media/[[path]].ts         # R2-backed range-serving media route
scripts/upload-media.sh             # push a media master to R2
wrangler.toml                       # Pages config + R2 binding

Adding a lecture

  1. Copy the theatre package (everything except media/) to public/lectures/<slug>/.
  2. Edit DEFAULTS.mediaSrc in its app.js to /media/lectures/<slug>/<file>.mp4.
  3. scripts/upload-media.sh <local-master> lectures/<slug>/<file>.mp4
  4. Add a card to public/index.html.
  5. Deploy.

Deploy

npx wrangler pages deploy public --project-name aman-holdings

First deploy creates the project. Custom domain aman.holdings is attached once in the Cloudflare dashboard (Pages → aman-holdings → Custom domains).

Local dev

npx wrangler pages dev public

The local R2 binding starts empty; media 404s locally unless you seed the local bucket. Everything else works.