feat(members): build member profile page [ISSUE-037] - #108
Open
CYNTHia-com wants to merge 2 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(members): implement full member profile page — Feature #37
Summary
Replaces the founding scaffold stub at app/(public)/members/[username]/page.tsx with a fully working member profile page, pulling real data from the database across all required sections.
What Changed
File modified: app/(public)/members/[username]/page.tsx
✅ Real Contributions List
Derives contributions from the user's published articles and forum posts — no seeded or hardcoded strings.
Both types are merged, sorted by most recent, each tagged with a badge (PUBLICATION or DISCUSSION) and a direct link.
✅ Forum Activity
Combines the user's forum threads and forum replies into one compact activity list.
Sorted by most recent, capped at 5 entries. Each item shows category badge, timestamp, thread title, and reply excerpt.
✅ Bookmarks
Displays total bookmark count in the sidebar via _count.bookmarks.
Shows the most recent 5 bookmarked articles with title, category, and link.
✅ Events
Registered events — from eventRegistrations relation.
Authored/Organized events — from events relation (EventAuthor).
Both shown side-by-side in a two-column grid.
✅ Social Links Sidebar
GitHub, Twitter, LinkedIn links rendered conditionally — only when a URL exists on the profile.
✅ 404 Handling
Calls notFound() immediately when no user matches the username param.
✅ Redis Cache
Profile data cached for 5 minutes via getCachedOrFetch.
Gracefully skips caching when Upstash env vars are absent (local dev).
Database Queries
All data fetched in a single Prisma query — no N+1 queries:
publications (PUBLISHED only, ordered by createdAt desc)
forumPosts (last 5)
forumReplies (last 5, with nested post info)
bookmarks (last 5, with nested publication info)
events (authored, ordered by date desc)
eventRegistrations (with nested event info)
_count { bookmarks } (total count)
Acceptance Criteria
Real contributions list — derived from publications + forumPosts
Bookmark count + most recent 5 bookmarks shown
Forum activity compact thread list (last 5, threads + replies combined)
Events: registered + authored
404 if username doesn't exist
Testing
pnpm run lint — ✅ 0 errors, 0 warnings
Profile renders correctly for existing usernames
/members/unknown-user correctly returns the 404 page
Related
Closes ISSUE-037
Spec: project-description.md — Feature #37
Schema: prisma/schema.prisma