---
title: "IGA Social"
url: https://phatdev.net/en/projects/iga-social
lang: en
alternate:
  vi: https://phatdev.net/vi/projects/iga-social
markdown: https://phatdev.net/en/projects/iga-social.md
---

# IGA Social

> An internal app for gemstone marketing content: a full week of Facebook posts planned with one button, AI captions under strict rules and guardrails, vertical videos built from raw clips, YouTube publishing, plus a product catalog and posting accounts. AI drafts, a person decides.

- Role: Product · Full-stack · AI content
- Status: In daily internal operation
- Technology: Next.js 15, React 19, Docker, FFmpeg, Playwright
- Docs and changelog: https://phatdev.net/docs/iga-social
- All projects: https://phatdev.net/en/projects.md

## Project facts

- Role: Design, development, operations
- Platform: Next.js 15 in Docker, single sign-on through a shared auth service
- Data: JSON files in one folder, no database needed; nightly backups
- Output: Facebook posts, 1440x2560 vertical Reels, YouTube videos, product landing pages

## Metrics

- 303: finished video clips in the library
- 293: clips published to YouTube
- 4.556: products in the catalog synced from the shop website
- 77: API endpoints in the app

## Highlights

- **A weekly plan drafted for you, a person approves**: One button drafts seven posts for the week, rotating products, angles and tones, and attaching lunar-calendar occasions. Each post shows as a Facebook-style card to approve, edit or rewrite before scheduling; auto-posting is off by default.
- **AI captions with rules and guardrails**: The writing rules forbid promises about effects, keep feng shui light and remove filler phrases. Before publishing, a price blocker keeps public captions free of prices, and a duplicate check asks for confirmation if a post resembles one just published.
- **From phone clip to Reels and YouTube**: Raw clips are rebuilt into vertical videos with an intro, spec cards, music and an outro, then pass three checks before they are sent. YouTube descriptions are assembled from real product data, and AI may not add details of its own.
- **A large catalog, imported only when needed**: The catalog mirrors in-stock products from the shop website without downloading images. Only when an item is picked for content does the system fetch photos and create the product and a public landing page with structured data for search.
- **Posting accounts managed with a Chrome extension**: The extension collects the Facebook session and profile and supports quick sign-in with a 2FA code. Sensitive data is never sent back to the browser, and the server accepts calls only from the extension itself.

## In-depth analysis

### The problem

A gemstone shop has to post regularly: product photos, short videos, captions, and posts on Facebook and YouTube. The work is scattered. Clips shot on a phone sit in the phone or a chat group, product details live on the shop website, and captions are written by hand in a different style each time. When AI writes freely, it tends to invent details that do not exist or to promise feng shui effects too strongly. That is the kind of content Facebook removes, and it weakens the shop's credibility.

### The solution

IGA Social brings the whole workflow into one internal web app. Product data comes from the shop website, raw clips go into an inbox, AI may only write inside a set of rules, and the decision to publish always belongs to a person. The app runs in Docker and stores its data as JSON files in one folder, which keeps backup and recovery simple.

#### Weekly Facebook plan
One button drafts seven posts for the week. The system rotates through the least recently posted products, cycles seven writing angles (product, knowledge, tips, Q&A, behind the scenes, gifts, feng shui) and three tones. Lunar-calendar occasions such as the 1st, the full moon, Buddha's Birthday and Vu Lan are attached with an angle suggestion. Each post appears as a Facebook-style card where the reviewer can Approve, Edit, Rewrite or Drop it. Auto-posting is off by default.

#### Controlled AI captions
The writing rules keep feng shui light, forbid promises about effects and remove the stock phrases typical of AI writing. After the AI writes, a rule-based filter checks the result again. At publishing time, a price blocker ensures public captions do not show prices. The system also checks for duplicates: if the same product was just posted in the last few days, or the opening matches an older post, the user is asked to confirm before it goes out.

#### Video from raw clips
Vertical clips go through an encoding queue with an intro, spec cards, background music and an outro, exported as 1440x2560 H.264. Speech in the clip is detected to decide whether to keep it or replace it with music. Each video passes three checks (at render time, against the current spec, and a probe of every file) before it is sent. Clips with missing information are flagged for completion and kept out of the batch.

#### YouTube and the Fanpage
Clips are published to YouTube with descriptions assembled from real product data, and AI may not add details of its own. Posts and Reels go to the Fanpage through the official API, followed by a comment with the product link. If the comment fails, the system retries automatically.

#### Catalog and images
The catalog mirrors in-stock products from the shop website, grouped by priority. Only when an item is picked for content does the system download its photos, convert them to WebP and create a public landing page with structured data for search. Original images are always kept for publishing.

#### Accounts and the Chrome extension
The account store keeps the state of each posting account, while login credentials stay on the server side. Facebook group scans rotate between accounts so none is overused, and AI ranks the results so a person can decide which groups to join. The Chrome extension collects the session and profile data and supports quick sign-in with a 2FA code.

### Results

- 303 finished clips in the library, 293 of them already on YouTube.
- 4,556 products in the catalog, synced daily from the shop website.
- Seven draft posts ready for review every week, instead of writing each post by hand.
- YouTube descriptions and on-video specs come from real product data, so they stay consistent across channels.
- 77 API endpoints, in daily internal use.

### Reliable operation

- **A person decides.** New posts always wait for approval, and auto-posting runs only when switched on.
- **Secrets stay on the server.** Account cookies and passwords are never sent back to the browser, which only receives a yes-or-no flag.
- **Safe writes.** Every write goes through a temporary file and a rename, so a power cut cannot corrupt the main file.
- **Nightly backups.** Data is backed up every night, with a second copy kept in another storage location. Media files are not part of this backup.
- **Bounded background jobs.** Failed jobs are retried a limited number of times, and their status appears on the card for the user to see.
- **Central sign-in.** The app shares the auth service used by other internal tools, supports OTP codes, and keeps a session valid for 14 days.

### Comparison with common tools

| Feature | IGA Social | Meta Business Suite | Buffer | Canva |
|---|---|---|---|---|
| Schedule Facebook posts | ✓ | ✓ | ✓ | ~ |
| Publish to many social networks at once | ~ (Facebook, YouTube) | ~ (Facebook, Instagram) | ✓ | ~ |
| Auto-draft a weekly plan by product and lunar occasions | ✓ | ✗ | ✗ | ✗ |
| AI captions with industry rules, blocking prices and effect claims | ✓ | ✗ | ~ (generic AI assistant) | ~ |
| Vertical video from raw clips with spec cards | ✓ | ✗ | ✗ | ✓ |
| Catalog sync from the shop website | ✓ | ✗ | ✗ | ✗ |
| Free-form graphic design | ✗ | ✗ | ✗ | ✓ |
| Many clients and many collaborators | ✗ | ✓ | ✓ | ✓ |

> IGA Social does not replace Meta Business Suite for ad analytics, nor Canva for free-form design. It is strong at one narrow job: turning a gemstone shop's existing product data and clips into compliant posts, running on private infrastructure where the data stays with the shop owner.
