Commit graph

277 commits

Author SHA1 Message Date
Harshad
5f9bbaba6d chore(model): replace model binary with instructions to download it 2026-02-27 19:57:34 +05:30
Harshad
d139c6cd01 fix(result): hide download info for failed video generation 2026-02-19 11:52:48 +05:30
michael
1e6462132d fix: prevent PostgreSQL connection exhaustion from Celery worker pool leak
Use NullPool for Celery workers so connections are opened/closed per task
instead of accumulating in per-process pools. Add worker_process_init
signal to dispose inherited engines on fork. Keep QueuePool for the web
service. Increase PostgreSQL max_connections to 200 as a safety net.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 06:42:40 -06:00
michael
7288d854c8 docs: add PDF version of architecture doc with rendered Mermaid diagrams
Pipeline: Mermaid CLI (mmdc) renders diagrams directly to PDF via
Puppeteer, pdfcrop trims whitespace, pandoc + xelatex produces the
final 20-page document with vector diagrams, syntax-highlighted code,
styled headers/footers, and table of contents.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 09:57:16 -06:00
michael
792e1323e9 docs: add backend architecture documentation for campaign reuse
Comprehensive technical reference covering system architecture, Celery
queue topology, Cloud Run video offloading, resilience patterns, and
configuration. Includes 6 Mermaid diagrams.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 09:40:39 -06:00
michael
371b225d9c chore: increase video worker concurrency to 100
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 17:06:47 -06:00
Deepak Salunke
8263bc335f Result: Check if url session id is matching with storage then return pet name 2026-02-13 19:05:36 +05:30
Deepak Salunke
40e4932399 Landing: Revert error popup changes/message 2026-02-13 14:01:32 +05:30
michael
073fe9861e fix(results): return image_url and lyrics on failed video generation
These fields are populated by earlier tasks in the Celery chain and are
not dependent on video generation succeeding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 07:05:30 -06:00
Harshad
ee0997c97f fix(result): remove download if video generation failed 2026-02-12 17:18:55 +05:30
Harshad
51eae23183 fix(waiting): redirect page if streaming Ready 2026-02-11 22:52:44 +05:30
Harshad
a47ca02d6d minor UI updates 2026-02-11 22:44:11 +05:30
Harshad
0e7173b3f0 fix(waiting): update countdown timer to 5mins 2026-02-11 20:16:53 +05:30
Harshad
b23f501a2f fix(result): countdown timer logic 2026-02-11 18:36:39 +05:30
Harshad
fff1245c10 chore(admin): improve page speed 2026-02-10 23:57:57 +05:30
Harshad
e69d3d0db3 fix(admin): dashboard data points 2026-02-10 23:38:10 +05:30
Harshad
a2ca82aacd feat(admin): update dashboard UI with status metrics 2026-02-10 21:58:40 +05:30
michael
3a6a8ba6e9 feat(deploy): add persistent Redis volume and queue-safe deploy script
Add a named volume for Redis so queue data survives container restarts.
Add deploy-backend-safe.sh that rebuilds and recreates only app/worker
containers while leaving db and redis untouched, preserving the queue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 10:15:08 -06:00
michael
3e89e28716 feat(video): move video generation to Cloud Run
Offload CPU-intensive FFmpeg video creation to an autoscaling Cloud Run
service to clear the 1600+ task backlog. The Celery video worker becomes
a thin HTTP client (concurrency bumped from 2 to 50) that dispatches to
Cloud Run when CLOUD_RUN_VIDEO_URL is set, with local fallback for dev.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 09:58:57 -06:00
Harshad
35b579c702 chore(deploy): update script for analytics 2026-02-10 14:58:03 +05:30
Harshad
874bc5875d feat(analytics): add Google Analytics partial 2026-02-10 14:26:38 +05:30
Harshad
e1b67d9e5f chore(bannedWords): update word list 2026-02-09 18:10:32 +05:30
Deepak Salunke
2606cfd7b8 Footer text & OG image updated 2026-02-09 15:55:27 +05:30
Harshad
7feff85e38 feat(home): draf & drop image 2026-02-09 15:05:40 +05:30
Deepak Salunke
ae71ee58bb Result: Fetch pet name from result api if name not found in local storage 2026-02-09 13:35:51 +05:30
Deepak Salunke
1f56d7134e Pet name spacing issue solved 2026-02-09 13:11:40 +05:30
michael
5393b6ae98 feat(safety): stricter Gemini filter - require pet in image, fail on content block
- Prompt now requires an animal/pet as primary subject; rejects human-primary
  images, non-photos, and images with no animals
- Gemini content filter blocks (empty response or safety exception) now
  reject the image instead of failing open

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:27:37 -06:00
michael
7951c2fd65 fix(safety): use gemini-3-flash-preview model
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:17:46 -06:00
michael
f40726004e feat(safety): add Gemini as alternative image safety classifier
Adds Google Gemini vision API as a configurable alternative to NudeNet
for image safety checks. Controlled via IMAGE_SAFETY_METHOD env var
(default: gemini). Gemini checks for a broader range of unsafe content
including nudity, violence, and offensive material. Fail-open on errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:16:51 -06:00
Harshad
0f81c978e7 chore(bannedWords): update list 2026-02-08 11:50:59 +05:30
Harshad
df601ad09c fix: apple touch icon 2026-02-08 11:10:55 +05:30
Harshad
5bec514b65 chore(bannedWords): update list with new words 2026-02-08 10:30:49 +05:30
michael
854fc33246 fix(safety): use substring matching for banned words filter
Remove word-boundary anchors so banned words are caught even when
embedded in larger strings (e.g. "xBatmanx" now matches "Batman").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:42:02 -06:00
Michael Clervi
3e019be8fc added words to banned words list 2026-02-06 21:24:03 +00:00
Deepak Salunke
aa09b62aa7 Result: Show pet name from local storage 2026-02-07 02:06:01 +05:30
Deepak Salunke
6a3fae3725 Result: Fetched uploaded image & shown in record 2026-02-07 01:23:11 +05:30
Michael Clervi
b2b368d2d7 adjusted banned_words.txt 2026-02-06 19:30:17 +00:00
Deepak Salunke
8296d12f3a Result: Record image style changes 2026-02-07 00:14:31 +05:30
Deepak Salunke
ad3aec64e8 Result: Record image style changes 2026-02-07 00:07:50 +05:30
Deepak Salunke
e37abeb0b6 Merge branch 'main' of https://github.com/DeepakasBTG/PAH 2026-02-06 23:51:37 +05:30
DeepakasBTG
d0b6067702 Merge pull request #65 from DeepakasBTG/bugs
Result: Ad banners updated
2026-02-06 23:33:22 +05:30
Deepak Salunke
f3217223fe Result: Ad banners updated 2026-02-06 23:32:41 +05:30
DeepakasBTG
82797d3a96 Merge pull request #64 from DeepakasBTG/bugs
Result: Copy changes for share box
2026-02-06 23:08:07 +05:30
Deepak Salunke
c147f4611d Result: Copy changes for share box 2026-02-06 23:07:26 +05:30
michael
cde8ca7038 chore: track banned words list for profanity filtering
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 11:24:16 -06:00
michael
7a4d3ab4c6 feat(safety): augment profanity filter with custom banned words list
Load banned_words.txt at module init and check against it using
word-boundary regex matching, alongside the existing better-profanity
library check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 11:09:40 -06:00
Harshad
46eb04c440 WIP: result page record 2026-02-06 22:29:09 +05:30
Harshad Parulekar
f68482d652 fix(deploy): script parameters implemented again 2026-02-06 22:25:25 +05:30
DeepakasBTG
bc4df6be2d Merge pull request #63 from DeepakasBTG/bugs
Footer: Address typo correction
2026-02-06 21:30:41 +05:30
Deepak Salunke
8b12b139b9 Footer: Address typo correction 2026-02-06 21:29:59 +05:30