Integrates community post functionality (CRUD, likes, replies) and updates media outlet management with new icons and API endpoints for community posts. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9a264234-c5d7-4dcc-adf3-a954b149b30d Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/9a264234-c5d7-4dcc-adf3-a954b149b30d/QTw0kIA
73 lines
3.9 KiB
Markdown
73 lines
3.9 KiB
Markdown
# Overview
|
|
|
|
SAPIENS is a comprehensive media platform that aggregates news and content from various media outlets organized into three categories: People, Topics, and Companies. The platform features a sophisticated auction system for media outlet management rights, prediction markets tied to articles, and a multi-tier admin system. Users can browse media outlets, read articles, participate in prediction markets, and bid on management rights through an eBay-style auction system.
|
|
|
|
# User Preferences
|
|
|
|
Preferred communication style: Simple, everyday language.
|
|
|
|
# System Architecture
|
|
|
|
## Frontend Architecture
|
|
- **Framework**: React with TypeScript using Vite for build tooling
|
|
- **Styling**: Tailwind CSS with shadcn/ui component library for consistent design
|
|
- **Routing**: Wouter for client-side routing
|
|
- **State Management**: TanStack Query for server state and data fetching
|
|
- **Authentication**: Integrated with Replit Auth system
|
|
|
|
## Backend Architecture
|
|
- **Framework**: Express.js with TypeScript
|
|
- **Database**: PostgreSQL with Drizzle ORM for type-safe database operations
|
|
- **Authentication**: Replit-based OAuth with session management
|
|
- **API Design**: RESTful API with structured error handling
|
|
|
|
## Database Design
|
|
The system uses a PostgreSQL database with the following core entities:
|
|
- **Users**: Supports role-based access (user, admin, superadmin)
|
|
- **Media Outlets**: Categorized entities (people, topics, companies) with slugs and metadata
|
|
- **Articles**: Content with rich text, images, and association to media outlets
|
|
- **Prediction Markets**: Betting markets linked to articles with yes/no pricing
|
|
- **Auctions**: eBay-style bidding system for media outlet management rights
|
|
- **Bids**: Individual auction bids with quality scoring
|
|
- **Comments**: User-generated content on articles
|
|
- **Community Posts**: DC Inside-style forum posts for each media outlet with views, likes, and replies
|
|
- **Community Replies**: Threaded replies to community posts
|
|
|
|
## Authentication & Authorization
|
|
- **Multi-tier Access**: Three user roles with escalating permissions
|
|
- **Session Management**: PostgreSQL-backed sessions with configurable TTL
|
|
- **Route Protection**: Middleware-based authentication checks for protected routes
|
|
|
|
## Key Features
|
|
- **Category-based Navigation**: Tabbed interface for People, Topics, Companies
|
|
- **Dual View Modes**: Grid and list views for article browsing
|
|
- **Auction System**: Real-time bidding with quality score integration
|
|
- **Prediction Markets**: Integration with external prediction market APIs
|
|
- **Admin Dashboards**: Role-specific management interfaces with article CRUD operations
|
|
- **Content Management**: Rich article creation, editing, and deletion with media outlet administration
|
|
- **DC Inside-style Community**: Forum-style discussion boards for each media outlet with posts, replies, likes, and sorting options
|
|
- **Community Features**: Post creation, threaded replies, view counts, like system, and multiple sort options (latest, views, likes, replies)
|
|
|
|
# External Dependencies
|
|
|
|
## Database & Infrastructure
|
|
- **Neon Database**: Serverless PostgreSQL hosting
|
|
- **Drizzle ORM**: Type-safe database queries and migrations
|
|
- **Replit Auth**: OAuth authentication provider
|
|
|
|
## UI & Styling
|
|
- **shadcn/ui**: Pre-built accessible UI components
|
|
- **Radix UI**: Primitive components for complex interactions
|
|
- **Tailwind CSS**: Utility-first CSS framework
|
|
- **Lucide Icons**: Icon library for consistent iconography
|
|
|
|
## Development Tools
|
|
- **Vite**: Fast build tool with HMR for development
|
|
- **TypeScript**: Type safety across the full stack
|
|
- **TanStack Query**: Server state management and caching
|
|
- **React Hook Form**: Form handling with validation
|
|
|
|
## Third-party Integrations
|
|
- **Kalshi API**: External prediction market data (referenced in user requirements)
|
|
- **Image Services**: Unsplash for placeholder images and media content
|
|
- **Session Storage**: connect-pg-simple for PostgreSQL session management |