diff --git a/RESUME.md b/RESUME.md index bca10c9..0342183 100644 --- a/RESUME.md +++ b/RESUME.md @@ -1,9 +1,10 @@ # LAD Website — Session Resume Guide -**Last updated:** 2026-05-24 -**Repo:** `https://gitea.sigd.net/chaulmark/lad-website` -**Local clone:** `/home/chaulmark/websites/lad-website` -**Last commit:** `523e812` (TODO.md added) +**Last updated:** 2026-05-24 +**Repo:** `https://gitea.sigd.net/chaulmark/lad-website` +**Local clone:** `/home/chaulmark/websites/lad-website` +**Last commit:** `c9e042f` (Update/Article models, migration script, full rebrand) +**Dev URL:** `https://lad.sigd.net` → Caddy on 10.8.0.10 → 10.8.0.165:3000 --- @@ -13,7 +14,7 @@ |-------|-----------|-------| | Frontend | Next.js 16, React 19.2, Tailwind CSS v4 | `/frontend/` | | Backend | Express 5, TypeScript, MongoDB, Redis | `/backend/` | -| CMS (source) | Directus at `https://db.lad1908.org` | Read-only reference | +| CMS (source) | Directus at `https://db.lad1908.org` | Being replaced — data migrated | | Infra | Docker Compose + Nginx | `/docker-compose.yml` | | Git host | Gitea at `gitea.sigd.net` | user: chaulmark | @@ -28,7 +29,9 @@ | Brand color | `#13AE3A` (green) | | LAD logo | `https://db.lad1908.org/assets/5cdfa81d-ffc8-4cae-a178-5db3bfbaaeb8` | | Deaf Focus logo | `https://db.lad1908.org/assets/c15110fe-d25a-4863-8e9c-055bfad3c710` | -| Primary contact | request@deaffocus.org / (225) 319-5586 | +| General contact | info@lad1908.org | +| Deaf Focus interpreting | request@deaffocus.org / (225) 319-5586 / Fax (225) 308-4025 | +| Hours | Mon–Fri 9am–4pm | | Scraped content | `LAD_CONTENT.md` in repo root | --- @@ -36,126 +39,96 @@ ## What Has Been Done ### Rebrand (complete) -- All "Olathe Club of the Deaf" / "OCD" references replaced with LAD in: - - `frontend/src/app/layout.tsx` — metadata, OpenGraph, Twitter card, metadataBase - - `frontend/src/components/organisms/Navigation.tsx` — org name, logo, nav links - - `frontend/src/components/organisms/Footer.tsx` — org name, tagline, copyright - - `frontend/src/app/about/page.tsx` — full about page copy -- `frontend/src/app/globals.css` — brand color switched from blue (`#1a56db`) to LAD green (`#13AE3A`) throughout: primary vars, gradients, CTA section, button shadows, dark theme, badge shadows +- All "Olathe Club of the Deaf" / "OCD" references replaced with LAD throughout entire codebase +- Brand color switched from blue (`#1a56db`) to LAD green (`#13AE3A`) in `globals.css` +- Navigation, Footer, layout metadata all updated ### Package Upgrades (complete) -- **Frontend:** Next.js 15→16, React 18→19.2.6, eslint-config-next updated, axios added -- **Backend:** Express 4→5, Mongoose 8→9, bcrypt 5→6, helmet 7→8, Zod 3→4 -- **Breaking change fixed:** `frontend/src/app/api/uploads/[...path]/route.ts` — async params (Next.js 16 requirement) -- **Bug fixed:** `frontend/src/components/video/VideoPlayer.tsx` — broken absolute import path -- **Config fixed:** `frontend/next.config.js` — removed `experimental.serverActions`, added `db.lad1908.org` to remotePatterns, switched `images.domains` to `images.remotePatterns` +- Frontend: Next.js 15→16, React 18→19.2, axios added +- Backend: Express 4→5, Mongoose 8→9, bcrypt 5→6, helmet 7→8, Zod 3→4 +- Breaking changes fixed: async params, broken imports, next.config.js remotePatterns -### New Pages (complete) -These pages were added and did not exist in the OCD template: -- `frontend/src/app/updates/page.tsx` -- `frontend/src/app/minutes/page.tsx` -- `frontend/src/app/deaf-focus/page.tsx` - -### Content (complete — static) -All pages below have real LAD content hardcoded as static data. Content source: `LAD_CONTENT.md`. +### Pages (all complete) | Page | File | Status | |------|------|--------| | Home | `app/page.tsx` | ✅ Announcement banner, real events, LAD copy | | About | `app/about/page.tsx` | ✅ 2019–21 board, 10 affiliated orgs, history | -| Updates | `app/updates/page.tsx` | ✅ 13 real updates (2014–2022) | -| Events | `app/events/page.tsx` | ✅ 12 real events, 2 featured | -| Minutes | `app/minutes/page.tsx` | ✅ Public/members-only split, type badges | -| Deaf Focus | `app/deaf-focus/page.tsx` | ✅ All 6 articles + logo | -| Contact | `app/contact/page.tsx` | ⚠️ Still says "Olathe" — needs LAD info | -| Membership | `app/membership/page.tsx` | ⚠️ Still says "Olathe" — needs LAD info | -| Donate | `app/donate/page.tsx` | ⚠️ Still says "Olathe" — needs LAD info | +| Updates | `app/updates/page.tsx` | ✅ Static — needs wiring to backend API | +| Events | `app/events/page.tsx` | ✅ Static — needs wiring to backend API | +| Minutes | `app/minutes/page.tsx` | ✅ Static — needs wiring to backend API | +| Deaf Focus | `app/deaf-focus/page.tsx` | ✅ Static — needs wiring to backend API | +| Contact | `app/contact/page.tsx` | ✅ Real LAD contact info | +| Membership | `app/membership/page.tsx` | ✅ LAD copy, fees TBD (contact-us prompt) | +| Donate | `app/donate/page.tsx` | ✅ LAD nonprofit info | + +### Backend Models (all complete) + +| Model | File | Notes | +|-------|------|-------| +| Event | `models/Event.ts` | + directusId, photoUrl, photoCaption | +| Document | `models/Document.ts` | + directusId, directusAssetId, 3 new minute types | +| Member | `models/Member.ts` | Unchanged | +| Video | `models/Video.ts` | Unchanged | +| **Update** | `models/Update.ts` | NEW — news/update posts | +| **Article** | `models/Article.ts` | NEW — Deaf Focus articles | + +All models have full CRUD routes at `/api/{collection}`. + +### Data Migration (complete — local only) + +Migration script: `backend/scripts/migrate-directus.ts` +Run with: `npx tsx scripts/migrate-directus.ts` from `/backend/` + +**Local migration results:** +- 235 updates ✅ (photos are Directus URLs — 403 protected, used as fallback) +- 148 events ✅ (same photo situation) +- 201 public minutes PDFs downloaded to `uploads/documents/` ✅ +- 6 Deaf Focus articles ✅ +- **230 members-only PDFs** — skipped, need manual upload via admin panel +- Full manifest in `scripts/migration-report.json` (gitignored, regenerated on re-run) + +### Infrastructure (complete) +- `mongo-init/01-init.js` — creates `lad_db` user from `MONGO_USER`/`MONGO_PASSWORD` env vars +- `docker-compose.yml` — fully rebranded (lad_db, lad-mongo-data, lad-redis-data) +- `backend/.env.example` — template for all production env vars +- `backend/.gitignore` — excludes uploads/ contents, .env, migration-report.json --- ## What Still Needs To Be Done -### 1. Fix Remaining OCD-branded Pages (quick — ~30 min) +### 1. Wire Frontend to Backend API (next up) -Three pages still have "Olathe Club of the Deaf" content. Just rebrand and fill with LAD info: +Replace static arrays in 4 page files with Next.js Server Component `fetch()` calls: -**`app/contact/page.tsx`** -- Replace metadata title/description -- Add real contact info: - - LAD general: info@lad1908.org (or use Deaf Focus contact below if LAD doesn't have a separate one) - - Deaf Focus interpreting: request@deaffocus.org - - Phone: (225) 319-5586 - - Fax: (225) 308-4025 - - Hours: M–F 9am–4pm - - Mailing address (unknown — not in scraped content) -- The `ContactForm` component already exists at `components/molecules/ContactForm.tsx` +| Page | API endpoint | +|------|-------------| +| `app/updates/page.tsx` | `GET /api/updates?status=published` | +| `app/events/page.tsx` | `GET /api/events?status=published` | +| `app/minutes/page.tsx` | `GET /api/documents` (isPublic split) | +| `app/deaf-focus/page.tsx` | `GET /api/articles?status=published` | -**`app/membership/page.tsx`** -- Replace "Olathe" with LAD throughout -- LAD membership info (from scraped content): LAD is a nonprofit statewide org; membership gives voting rights, event access, advocacy support -- Membership fees/tiers unknown — not in scraped content; may need to ask client +Recommendation: use Next.js Server Components with `{ next: { revalidate: 3600 } }` for caching. -**`app/donate/page.tsx`** -- Replace "Olathe" with LAD throughout -- LAD is a 501(c) nonprofit — donations are tax-deductible -- No specific donation platform/link found in scraped content; may need to ask client +### 2. Production Deploy on 10.4.0.205 -### 2. Verify Build (critical — do this first in new session) +- Add LAD to `webhook-listener/server.py` `REPO_CONFIG` on 10.4.0.205 +- Create `backend/.env` from `.env.example` with real credentials +- Add Caddy entry on 10.4.0.205 for the real domain +- `docker compose up -d` +- `docker exec lad-backend npx tsx scripts/migrate-directus.ts` -The build has never been run since the upgrades. Do this before anything else: +### 3. Admin Panel -```bash -cd /home/chaulmark/websites/lad-website/frontend -npm run build -``` +- Verify JWT login at `/admin/login` +- Auth middleware: `backend/src/middleware/auth.ts` +- Test CRUD for all 6 collections +- Upload the 230 members-only PDFs via `/admin/documents` -Known potential issues: -- TypeScript errors in admin pages (they use `useParams()` hook which should be fine, but worth checking) -- Any remaining OCD strings that TypeScript or ESLint might catch -- The `lint` script was changed from `next lint` to `eslint .` — make sure ESLint config is correct +### 4. Minor Cleanup -### 3. Wire Dynamic Content (medium effort — decision required) - -Currently Updates, Events, Minutes, and Deaf Focus are static arrays in the page files. There are two options: - -**Option A: Pull from Directus API directly (simpler)** -- `https://db.lad1908.org/items/updates` — 69 items -- `https://db.lad1908.org/items/events` — 78 items -- `https://db.lad1908.org/items/minutes` — 101 items -- `https://db.lad1908.org/items/deaffocus` — 6 items -- Use `fetch()` in Next.js Server Components with `revalidate` for caching -- Pro: No backend setup needed, always live data -- Con: Dependent on client's Directus instance staying up - -**Option B: Import into local MongoDB backend (more control)** -- The backend already has models for Events, Documents (Minutes), Videos, Members -- Would need a one-time import script to seed MongoDB from Directus -- Admin panel can then manage content going forward -- Pro: Self-contained, admin panel works -- Con: More setup, data gets out of sync if client updates Directus - -**Recommendation:** Option A for now (Directus is already live and maintained by client), Option B later once the admin panel is configured. - -### 4. Admin Panel (medium effort) - -The admin panel exists at `/admin` with full CRUD for: -- Members (`/admin/members`) -- Documents (`/admin/documents`) — this maps to Minutes -- Videos (`/admin/videos`) — relevant for Deaf Focus -- Events (`/admin/events`) - -What needs doing: -- Verify admin login works (backend auth middleware is in `backend/src/middleware/auth.ts`) -- Set up initial admin credentials (JWT-based auth — check `backend/src/middleware/auth.ts`) -- Test document/event upload flows with LAD content -- The backend connects to MongoDB — needs a running MongoDB instance (handled by Docker Compose) - -### 5. Deploy to Production - -When ready, deploy to production server at `10.4.0.205`: -- The Gitea webhook + friday-bot pipeline is already wired for other sites -- LAD website is not yet added to `webhook-listener/server.py`'s `REPO_CONFIG` -- Will need: domain name, Caddy reverse proxy entry on 10.4.0.205, Docker Compose up +- Fix duplicate Mongoose index warnings in `Document` model (`documentType` and `isPublic` defined both inline and in `schema.index()`) --- @@ -164,56 +137,50 @@ When ready, deploy to production server at `10.4.0.205`: ``` lad-website/ ├── frontend/ -│ ├── src/ -│ │ ├── app/ -│ │ │ ├── layout.tsx ✅ LAD metadata -│ │ │ ├── page.tsx ✅ Homepage -│ │ │ ├── globals.css ✅ Green theme -│ │ │ ├── about/page.tsx ✅ Board + orgs -│ │ │ ├── updates/page.tsx ✅ 13 updates -│ │ │ ├── events/page.tsx ✅ 12 events -│ │ │ ├── minutes/page.tsx ✅ Public/members split -│ │ │ ├── deaf-focus/page.tsx ✅ 6 articles -│ │ │ ├── contact/page.tsx ⚠️ Needs LAD info -│ │ │ ├── membership/page.tsx ⚠️ Needs LAD info -│ │ │ ├── donate/page.tsx ⚠️ Needs LAD info -│ │ │ └── admin/ (full CRUD panel) -│ │ └── components/ -│ │ ├── organisms/Navigation.tsx ✅ Logo + nav -│ │ ├── organisms/Footer.tsx ✅ LAD footer -│ │ ├── molecules/Hero.tsx -│ │ ├── molecules/ContactForm.tsx -│ │ └── video/VideoPlayer.tsx ✅ Fixed import -│ ├── next.config.js ✅ remotePatterns updated -│ └── package.json ✅ Next.js 16, React 19.2 +│ └── src/app/ +│ ├── page.tsx ✅ Homepage +│ ├── about/page.tsx ✅ Board + orgs +│ ├── updates/page.tsx ⚡ Static → needs API wiring +│ ├── events/page.tsx ⚡ Static → needs API wiring +│ ├── minutes/page.tsx ⚡ Static → needs API wiring +│ ├── deaf-focus/page.tsx ⚡ Static → needs API wiring +│ ├── contact/page.tsx ✅ LAD contact info +│ ├── membership/page.tsx ✅ LAD copy +│ ├── donate/page.tsx ✅ LAD nonprofit +│ └── admin/ (full CRUD panel — needs auth verification) ├── backend/ │ ├── src/ -│ │ ├── models/ (Member, Event, Document, Video) -│ │ ├── controllers/ (full CRUD) -│ │ ├── routes/ (REST API) -│ │ └── middleware/auth.ts (JWT) -│ └── package.json ✅ Express 5, Mongoose 9 -├── LAD_CONTENT.md ✅ All scraped content -├── TODO.md ✅ Summary task list -└── RESUME.md ✅ This file +│ │ ├── models/ (Event, Document, Member, Video, Update, Article) +│ │ ├── controllers/ (full CRUD for all 6) +│ │ ├── routes/ (REST API) +│ │ └── middleware/auth.ts (JWT) +│ ├── scripts/ +│ │ └── migrate-directus.ts ✅ Directus→MongoDB migration +│ ├── uploads/ (gitkeep stubs — populated by migration) +│ ├── .env.example ✅ Production env template +│ └── .gitignore ✅ +├── mongo-init/01-init.js ✅ Creates lad_db user +├── docker-compose.yml ✅ lad_db, lad-mongo-data +├── LAD_CONTENT.md (all scraped content) +└── RESUME.md (this file) ``` --- ## Environment / Shell Notes -- **EDQUOT issue:** The shell has had recurring disk quota problems from Chrome cache in previous sessions. If bash commands fail silently (exit code 1 with no output), disk quota is likely the cause. -- **Workaround used:** Route all command output to files (`cmd > ~/output.txt 2>&1`) then read the file. This bypasses the broken stdout pipe. -- **Root cause:** `~/old-hermes.tar.bz2` was a 1.3GB archive that was truncated to free space. If quota hits again, check `~/.npm/_cacache`, `~/.cache/tracker3`, and `~/.config/chrome-cdp-profile` for large files. -- **Gitea token:** `fe17b49600550ff548627e133155ed29b2dcec77` (embedded in remote URL) +- **EDQUOT issue:** Shell has had recurring disk quota problems from Chrome cache. If bash commands fail silently (exit code 1, no output), check `~/.npm/_cacache`, `~/.cache/tracker3`, `~/.config/chrome-cdp-profile` +- **Dev server:** `cd ~/websites/lad-website/frontend && npm run dev -- --hostname 0.0.0.0` +- **MongoDB (local dev):** `sudo mongod --dbpath /var/lib/mongodb --logpath /var/log/mongodb/mongod.log --fork` +- **Always run build first:** `cd frontend && npm run build` before making changes +- **Gitea token:** embedded in remote URL --- ## How to Resume -1. Open a fresh terminal (clears the EDQUOT shell state) -2. `cd ~/websites/lad-website` -3. `git log --oneline -5` — confirm you're at `523e812` or later -4. `cd frontend && npm run build` — verify build passes -5. Fix contact/membership/donate pages (see section above) -6. Decide on Directus vs MongoDB for dynamic content +1. `cd ~/websites/lad-website` +2. `git log --oneline -3` — confirm at `c9e042f` or later +3. `cd frontend && npm run build` — verify build passes +4. Start dev server: `npm run dev -- --hostname 0.0.0.0` +5. Next task: wire the 4 static pages to the backend API (see section above)