3.5 KiB
3.5 KiB
Glossary Feature Specification
Overview
A wiki-style glossary system for defining and explaining fandom-specific terms, slang, and concepts. Users can suggest entries, and moderators/admins approve them before publication.
Use Cases
- Jam Band Terms: "Bustout", "Tease", "Segue", "Type II Jam"
- Venue Nicknames: "The Gorge", "Red Rocks"
- Song Nicknames: Already handled by
PerformanceNickname, but glossary can define broader terms - Cultural References: "Couch Tour", "Lot Scene", "Heady"
Data Model
GlossaryEntry
class GlossaryEntry(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
term: str = Field(unique=True, index=True)
definition: str = Field(description="Main definition text")
example: Optional[str] = Field(default=None, description="Usage example")
category: str = Field(default="general", index=True) # general, venue, song, culture
status: str = Field(default="pending", index=True) # pending, approved, rejected
suggested_by: int = Field(foreign_key="user.id")
created_at: datetime = Field(default_factory=datetime.utcnow)
updated_at: datetime = Field(default_factory=datetime.utcnow)
user: "User" = Relationship()
GlossaryEdit (Revision History)
class GlossaryEdit(SQLModel, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
entry_id: int = Field(foreign_key="glossaryentry.id")
user_id: int = Field(foreign_key="user.id")
field_changed: str # definition, example, category
old_value: str
new_value: str
status: str = Field(default="pending") # pending, approved, rejected
created_at: datetime = Field(default_factory=datetime.utcnow)
entry: "GlossaryEntry" = Relationship()
user: "User" = Relationship()
API Endpoints
Public
GET /glossary/- List all approved entries (with search/filter)GET /glossary/{term}- Get a specific entry by term
Authenticated
POST /glossary/- Suggest a new entryPOST /glossary/{id}/edit- Suggest an edit to an existing entry
Moderator/Admin
GET /moderation/queue/glossary- List pending entriesPUT /moderation/glossary/{id}/{action}- Approve/Reject entryGET /moderation/queue/glossary-edits- List pending editsPUT /moderation/glossary-edits/{id}/{action}- Approve/Reject edit
Frontend Components
Public
/glossary- Glossary index page with search/glossary/[term]- Individual term page
Authenticated
- "Suggest Term" button on glossary index
- "Suggest Edit" button on term pages
Admin
/admin/glossary- Queue for pending entries and edits
Workflow
New Entry
- User submits a new term via form
- Entry created with
status=pending - Moderator reviews in
/admin/glossary - On approval,
status=approvedand entry is public
Edit Existing Entry
- User clicks "Suggest Edit" on a term page
GlossaryEditrecord created withstatus=pending- Moderator reviews edit
- On approval, the
GlossaryEntryis updated andGlossaryEdit.status=approved
Integration Points
- Search: Include glossary terms in global search
- Inline Tooltips: Hovering over a glossary term in comments/reviews shows a tooltip with the definition
- Auto-linking: Detect glossary terms in user-generated content and auto-link them
Future Enhancements
- Voting: Community voting on definitions
- Aliases: Multiple terms pointing to the same entry (e.g., "The Gorge" → "Gorge Amphitheatre")
- Cross-references: Link related terms