# PostSync Pro — Documentation Index

**Last updated:** 2026-08-27  
**Stack:** Next.js 15 (App Router) · React 19 · MariaDB + JSON · Anthropic / OpenAI  
**Product vertical:** AI social publishing (auto + manual) for Facebook & LinkedIn

This folder is the **engineering + product knowledge base** for building:

1. **RAG** over current project/brand/context/post data (query via **GPT-4o mini** and/or **Claude**)
2. **Social publishing** — photo & video, **automatic** and **manual**, to:
   - Facebook **Page** (live today) and Facebook **personal** (gap)
   - LinkedIn **member profile** (live today) and LinkedIn **Company Page** (gap)

---

## Read order

| # | Doc | Purpose |
|---|-----|---------|
| 1 | [architecture/00-OVERVIEW.md](./architecture/00-OVERVIEW.md) | Vision, current vs target, system diagram |
| 2 | [rag/01-DATA-SOURCES.md](./rag/01-DATA-SOURCES.md) | What data exists today for retrieval |
| 3 | [rag/02-RAG-ARCHITECTURE.md](./rag/02-RAG-ARCHITECTURE.md) | Chunking, embeddings, store, query API |
| 4 | [rag/03-LLM-PROVIDERS.md](./rag/03-LLM-PROVIDERS.md) | GPT-4o mini + Claude wiring |
| 5 | [social/01-PUBLISHING-OVERVIEW.md](./social/01-PUBLISHING-OVERVIEW.md) | Auto vs manual, media types |
| 6 | [social/02-FACEBOOK.md](./social/02-FACEBOOK.md) | Page vs account — current + target |
| 7 | [social/03-LINKEDIN.md](./social/03-LINKEDIN.md) | Profile vs Company Page — current + target |
| 7b | [social/04-ENV-CONFIGURATION.md](./social/04-ENV-CONFIGURATION.md) | Enable flags + env vars |
| 7c | [social/05-PLATFORM-REVIEW.md](./social/05-PLATFORM-REVIEW.md) | Per-platform status matrix |
| 7d | [social/06-PRODUCTION-ARCHITECTURE.md](./social/06-PRODUCTION-ARCHITECTURE.md) | Jobs, retry, audit, registry |
| 7e | [social/07-SECURITY-REVIEW.md](./social/07-SECURITY-REVIEW.md) | Security checklist |
| 8 | [architecture/01-NEXTJS-APP-STRUCTURE.md](./architecture/01-NEXTJS-APP-STRUCTURE.md) | Folder / API / module layout for the build |
| 9 | [architecture/02-GLOBAL-REVIEW.md](./architecture/02-GLOBAL-REVIEW.md) | Industry peer review + gaps |
| 10 | [architecture/03-IMPLEMENTATION-ROADMAP.md](./architecture/03-IMPLEMENTATION-ROADMAP.md) | Phased delivery checklist |

### Existing companion docs

| Doc | Role |
|-----|------|
| [WORKFLOW-OVERVIEW.md](./WORKFLOW-OVERVIEW.md) | End-user product workflow (partly stale on “simulated publish”) |
| [DEPLOY-CENTOS-APACHE.md](./DEPLOY-CENTOS-APACHE.md) | Production deploy |
| [../extras/dev_doc/README.md](../extras/dev_doc/README.md) | Archived Next.js CMS plan (AI + manual/CSV) |
| [../extras/README.md](../extras/README.md) | Non-runtime archives (planning docs, dumps, repro scripts) |

---

## Target capability (one-liner)

> Ingest **current PostSync data** into a **RAG index**, answer grounded questions via **GPT-4o mini / Claude**, and **publish photos/videos** to **Facebook Pages (and accounts where API allows)** and **LinkedIn profiles + Company Pages**, both **on a schedule** and **on manual approve**.

## Learning workspace (RAG vectors — active work folder)

All SDLC-arranged learning / vector work lives in **[`../learning/`](../learning/)**:

| Item | Path |
|------|------|
| Start here | [`learning/README.md`](../learning/README.md) |
| Learning model explained | [`learning/LEARNING-MODEL.md`](../learning/LEARNING-MODEL.md) |
| **Independent channel data** (FB/LI/… × content/image/video) | [`learning/data/vertical/`](../learning/data/vertical/) |
| How to reuse slices | [`learning/data/vertical/HOW-TO-REUSE.md`](../learning/data/vertical/HOW-TO-REUSE.md) |
| Rebuild vertical vectors | `npm run learning:build-vertical` |

**Do you need vectors in the DB?** Not for v1 — **separate files per channel**. Optional schema: `learning/sql/009_rag_chunks.sql`.

---

## Learning workspace (RAG vectors — active work folder)

…existing learning links…

### Implementation plan (Next.js CMS)

Full AI + manual/CSV plan (archived): **[`../extras/dev_doc/README.md`](../extras/dev_doc/README.md)**

---

## Honest current state (summary)

| Capability | Status |
|------------|--------|
| Context push into prompts (no vector RAG) | Live |
| AI caption + image (+ optional FFmpeg video → YouTube) | Live |
| Manual quick publish | Live |
| Cron / poller auto-publish | Live |
| Facebook **Page** photo/text | Live |
| Facebook **personal profile** publish | Not supported (Meta Graph Pages API) |
| LinkedIn **member** image/text | Live |
| LinkedIn **Company Page** | Not supported (needs `w_organization_social`) |
| Embeddings / vector store / RAG query API | Not built |
| GPT-4o mini as default text model | Configurable via OpenAI; default text is often Anthropic Opus |
| Dedicated RAG “Knowledge Base” UI | Stub only (`/knowledge-base` hidden) |
