Skip to content

Commit 17a9026

Browse files
Setup image removal
1 parent 7aa82b7 commit 17a9026

File tree

9 files changed

+27247
-1
lines changed

9 files changed

+27247
-1
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,21 @@ logfile
3737
*.hp
3838

3939
.kamal/secrets
40+
41+
# Large image assets (served from CloudFront CDN in both dev and prod)
42+
# Run `make fetch-images` to download locally if needed
43+
frontend/public/img/arkham/cards/
44+
frontend/public/img/arkham/es/
45+
frontend/public/img/arkham/fr/
46+
frontend/public/img/arkham/ita/
47+
frontend/public/img/arkham/ko/
48+
frontend/public/img/arkham/zh/
49+
frontend/public/img/arkham/boxes/
50+
frontend/public/img/arkham/portraits/
51+
frontend/public/img/arkham/tarot/
52+
frontend/public/img/arkham/encounter-sets/
53+
frontend/public/img/arkham/mini-cards/
54+
frontend/public/img/arkham/sets/
55+
frontend/public/img/arkham/customizations/
56+
frontend/public/img/arkham/seals/
57+
frontend/public/img/arkham/playing-cards/

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,33 @@ sync-images:
3636
cd frontend/public && aws s3 sync . s3://arkham-horror-assets --acl public-read --exclude ".DS_Store"
3737
.PHONY: sync-images
3838

39+
## Fetch images from CDN for local development
40+
fetch-images:
41+
./scripts/fetch-assets.sh all
42+
.PHONY: fetch-images
43+
44+
## Fetch only English card images from CDN
45+
fetch-cards:
46+
./scripts/fetch-assets.sh cards
47+
.PHONY: fetch-cards
48+
49+
## Regenerate image manifest (run after adding new images, before committing)
50+
generate-manifest:
51+
node scripts/generate-manifest.cjs
52+
.PHONY: generate-manifest
53+
54+
## Sync images to S3 and regenerate manifest
55+
sync-and-manifest:
56+
./scripts/sync-and-manifest.sh
57+
.PHONY: sync-and-manifest
58+
59+
## Install git hooks
60+
install-hooks:
61+
cp scripts/check-manifest.sh .git/hooks/pre-commit
62+
chmod +x .git/hooks/pre-commit
63+
@echo "Pre-commit hook installed."
64+
.PHONY: install-hooks
65+
3966
## Count lines of code
4067
count:
4168
cloc . --include-lang=Haskell,TypeScript,Vue --exclude-dir=node_modules,dist,.stack-work --timeout=0

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,39 @@ Run `stack setup` in the `backend` directory, then run `stack build --fast` (not
9595

9696
Run `npm install` in the `frontend` directory
9797

98+
#### Images
99+
100+
Image assets (~2.9 GB) are **not stored in the git repository**. They are hosted
101+
on CloudFront and the app loads them from the CDN by default in both development
102+
and production — no extra setup needed.
103+
104+
If you need local copies (e.g. for offline development), the fetch script
105+
downloads directly from the public CDN using `curl` (no AWS credentials needed):
106+
107+
```
108+
make fetch-images # Download all images (~2.9 GB)
109+
make fetch-cards # Download only English card images (~755 MB)
110+
111+
# Or use the script directly for specific languages:
112+
./scripts/fetch-assets.sh fr # French only
113+
./scripts/fetch-assets.sh en # All English images
114+
```
115+
116+
To use local images instead of CDN, create `frontend/.env.development.local`:
117+
```
118+
VITE_ASSET_HOST=
119+
```
120+
121+
If you add new images, sync them to S3 and regenerate the manifest:
122+
```
123+
make sync-and-manifest
124+
```
125+
126+
To install a git hook that warns if you forget to update the manifest:
127+
```
128+
make install-hooks
129+
```
130+
98131
#### Database
99132
Create the local database:
100133

0 commit comments

Comments
 (0)