diff --git a/RESUME.md b/RESUME.md index 0342183..406b6ff 100644 --- a/RESUME.md +++ b/RESUME.md @@ -1,9 +1,9 @@ # LAD Website — Session Resume Guide -**Last updated:** 2026-05-24 +**Last updated:** 2026-05-25 **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) +**Last commit:** `82e17d3` (Fix PDF download links — route through Next.js /api/uploads proxy) **Dev URL:** `https://lad.sigd.net` → Caddy on 10.8.0.10 → 10.8.0.165:3000 --- @@ -39,14 +39,13 @@ ## What Has Been Done ### Rebrand (complete) -- 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` +- All "Olathe Club of the Deaf" / "OCD" references replaced with LAD throughout +- Brand color switched from blue 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, 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 ### Pages (all complete) @@ -54,10 +53,10 @@ |------|------|--------| | 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` | ✅ 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 | +| Updates | `app/updates/page.tsx` | ✅ Wired to `GET /api/updates?status=published` | +| Events | `app/events/page.tsx` | ✅ Wired to `GET /api/events?status=published` | +| Minutes | `app/minutes/page.tsx` | ✅ Wired to `GET /api/documents`, PDF proxy links | +| Deaf Focus | `app/deaf-focus/page.tsx` | ✅ Wired to `GET /api/articles?status=published` | | 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 | @@ -68,10 +67,10 @@ |-------|------|-------| | Event | `models/Event.ts` | + directusId, photoUrl, photoCaption | | Document | `models/Document.ts` | + directusId, directusAssetId, 3 new minute types | -| Member | `models/Member.ts` | Unchanged | +| Member | `models/Member.ts` | Duplicate index warning fixed | | Video | `models/Video.ts` | Unchanged | -| **Update** | `models/Update.ts` | NEW — news/update posts | -| **Article** | `models/Article.ts` | NEW — Deaf Focus articles | +| Update | `models/Update.ts` | News/update posts | +| Article | `models/Article.ts` | Deaf Focus articles | All models have full CRUD routes at `/api/{collection}`. @@ -81,55 +80,45 @@ 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) +- 233 updates ✅ +- 148 events ✅ - 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) + +### Frontend API Wiring (complete) +- All 4 dynamic pages fetch from Express backend via async Server Components +- 1-hour revalidation cache (`{ next: { revalidate: 3600 } }`) +- Graceful empty-state fallback if backend is unreachable +- PDF downloads use Next.js proxy route `/api/uploads/[...path]` — reads from `../backend/uploads/` on filesystem, works through Caddy without exposing backend port +- `frontend/.env.local` (gitignored): `BACKEND_URL=http://localhost:4000` +- `frontend/.env.example`: documents env vars for production ### 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) +- `mongo-init/01-init.js` — creates `lad_db` user from env vars +- `docker-compose.yml` — fully rebranded - `backend/.env.example` — template for all production env vars -- `backend/.gitignore` — excludes uploads/ contents, .env, migration-report.json +- `backend/src/index.ts` — serves `/uploads` as static files --- ## What Still Needs To Be Done -### 1. Wire Frontend to Backend API (next up) +### 1. Production Deploy on 10.4.0.205 -Replace static arrays in 4 page files with Next.js Server Component `fetch()` calls: - -| 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` | - -Recommendation: use Next.js Server Components with `{ next: { revalidate: 3600 } }` for caching. - -### 2. Production Deploy on 10.4.0.205 - -- 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 +- Create `backend/.env` on server from `.env.example` with real credentials +- Add Caddy entry on 10.4.0.205 for `lad1908.org` - `docker compose up -d` -- `docker exec lad-backend npx tsx scripts/migrate-directus.ts` +- Run migration: `docker exec lad-backend npx tsx scripts/migrate-directus.ts` +- Set `NEXT_PUBLIC_BACKEND_URL` in `frontend/.env` to public-facing backend URL -### 3. Admin Panel +### 2. Admin Panel - 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` -### 4. Minor Cleanup - -- Fix duplicate Mongoose index warnings in `Document` model (`documentType` and `isPublic` defined both inline and in `schema.index()`) - --- ## File Structure Reference @@ -140,13 +129,14 @@ lad-website/ │ └── 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 +│ ├── updates/page.tsx ✅ API wired +│ ├── events/page.tsx ✅ API wired +│ ├── minutes/page.tsx ✅ API wired + PDF proxy +│ ├── deaf-focus/page.tsx ✅ API wired │ ├── contact/page.tsx ✅ LAD contact info │ ├── membership/page.tsx ✅ LAD copy │ ├── donate/page.tsx ✅ LAD nonprofit +│ ├── api/uploads/[...path] ✅ PDF proxy (reads ../backend/uploads/) │ └── admin/ (full CRUD panel — needs auth verification) ├── backend/ │ ├── src/ @@ -156,7 +146,7 @@ lad-website/ │ │ └── middleware/auth.ts (JWT) │ ├── scripts/ │ │ └── migrate-directus.ts ✅ Directus→MongoDB migration -│ ├── uploads/ (gitkeep stubs — populated by migration) +│ ├── uploads/ (populated by migration — gitignored contents) │ ├── .env.example ✅ Production env template │ └── .gitignore ✅ ├── mongo-init/01-init.js ✅ Creates lad_db user @@ -171,8 +161,8 @@ lad-website/ - **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` +- **Backend dev:** `cd ~/websites/lad-website/backend && npm run dev` - **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 --- @@ -180,7 +170,6 @@ lad-website/ ## How to Resume 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) +2. `git log --oneline -3` — confirm at `82e17d3` or later +3. Verify MongoDB is running: `curl -s http://localhost:4000/health` (start backend if needed) +4. Next task: production deploy on 10.4.0.205, then admin panel verification