Community & Forum
Relevant source files
The following files were used as context for generating this wiki page:
The Community & Forum system in SoulSeer serves as a central hub for spiritual seekers and readers to connect, share insights, and engage in public discourse. It integrates an on-platform forum with external social links (Discord and Facebook) to foster a "soul tribe" atmosphere while maintaining professional standards through robust moderation tools.
Sources: client/src/pages/community/CommunityHubPage.tsx:1-50, README.md:10-15, client/src/pages/AboutPage.tsx:25-30
Forum Architecture and Data Flow
The forum follows a standard client-server pattern. The React frontend interacts with the Express backend via REST API endpoints to manage posts, comments, and moderation flags.
Frontend Components
The CommunityHubPage serves as the primary interface, utilizing specialized sub-components like PostCard to manage individual post lifecycles.
The frontend uses apiService to fetch paginated posts and useAuth to determine user permissions for posting or deleting content.
Sources: client/src/pages/community/CommunityHubPage.tsx:115-180, client/src/pages/community/CommunityHubPage.tsx:216-240
Backend Routing and Logic
The server implements routes in server/src/routes/forum.ts using Drizzle ORM to interface with PostgreSQL.
Content Organization
Content is organized into specific categories to ensure relevant discussions are easily discoverable.
Categories
| Category | Description | Permissions |
|---|---|---|
| General | General spiritual discussions. | All authenticated users |
| Readings | Discussions regarding psychic consultations. | All authenticated users |
| Spiritual Growth | Personal development and spiritual journeys. | All authenticated users |
| Ask a Reader | Questions directed at professional readers. | All authenticated users |
| Announcements | Official platform updates. | Admin Only |
Sources: client/src/pages/community/CommunityHubPage.tsx:18-25, server/src/routes/forum.ts:68-75
Data Models
The system relies on several core interfaces defined in the shared types and database schema.
Post and Comment Structure
| Field | Type | Description |
|---|---|---|
id | number | Unique identifier. |
authorId | number | References the users table. |
category | ForumCategory | Enum of valid categories. |
title | string | Post title (max 255 chars). |
content | string | Body text (max 10,000 chars). |
isPinned | boolean | If the post is at the top of the feed. |
isLocked | boolean | If true, new comments are disabled. |
Sources: client/src/types/index.ts:98-125, shared/src/validators.ts:100-110
Moderation and Safety
SoulSeer implements a two-tier moderation strategy: user-initiated flagging and admin-level management.
Flagging System
Users can flag both posts and comments for review. Flags are stored in the forumFlags table and increment a flagCount on the target entity to alert administrators.
Sources: server/src/routes/forum.ts:105-135, client/src/pages/community/CommunityHubPage.tsx:90-100
Admin Controls
Administrators manage the forum through the AdminDashboard, which provides a "Moderation" tab for:
- Post Locking: Preventing further interaction on specific threads.
- Hard Deletion: Removing posts or comments from the database.
- Flag Resolution: Clearing the moderation queue once reviewed.
API Endpoints Summary
| Method | Endpoint | Access | Purpose |
|---|---|---|---|
| GET | /api/forum/posts | Public | List paginated posts with filters. |
| GET | /api/forum/posts/:id | Public | Get single post and its comments. |
| POST | /api/forum/posts | Auth | Create a new forum post. |
| POST | /api/forum/posts/:id/comments | Auth | Add a comment to a post. |
| POST | /api/forum/flags | Auth | Flag a post/comment for review. |
| DELETE | /api/forum/posts/:id | Admin | Permanently delete a post. |
Sources: server/src/routes/forum.ts:12-160, README.md:110-120
The Community & Forum module is a critical component for user retention and engagement, providing a structured environment for the "soul tribe" to interact outside of paid consultations. Its design balances open communication with the necessity of moderation to maintain a judgment-free environment.
Sources: client/src/pages/AboutPage.tsx:28-32, client/src/pages/community/CommunityHubPage.tsx:250-265