WARNING: This project is a Work In Progress (WIP)
This project is currently under active development. Features may be incomplete, unstable, or subject to change. Use at your own risk.
The ultimate companion for your Plex Media Server.
Plex Management System transforms your Plex experience by combining powerful management tools, community features, and personalized insights into a single platform. It helps users configure their clients for optimal playback, manage media requests, report issues, and celebrate their viewing habits with "Plex Wrapped".
- Guided Onboarding for new users to the server
- Client Configuration Guides to ensure Direct Play and best quality
- Issue Reporting workflow to streamline support requests
- Media Request integration (via Overseerr)
- Discord Integration for community engagement and announcements (optional)
- Service Status monitoring for all connected platforms
- Total watch time breakdown (movies vs. shows)
- Top movies and shows with play counts and ratings
- Server-wide leaderboards to see how you rank
- Visualizations with animated charts and transitions
- AI-Powered Insights for personalized viewing summaries
- One-click sharing of wrapped stats
- Public share links for easy social media sharing
- Analytics tracking for shared content
- Responsive design that works on any device
- User management dashboard with role-based access control
- Service management - Monitor and configure Plex, Tautulli, Overseerr, Sonarr, Radarr
- Announcements system - Server-wide notifications with markdown support
- LLM usage tracking and cost monitoring
- Share analytics to see what's popular
- Audit logging for security and compliance
- Centralized configuration for all integrations
- Node.js 18+ (LTS recommended)
- npm or yarn
- PostgreSQL database (SQLite is no longer supported as of Prisma v7)
- Access to:
- A Plex server (with admin token)
- Tautulli instance (for viewing statistics)
- Overseerr (optional, for request stats)
- Sonarr/Radarr (optional, for media management features)
- OpenAI API key (optional, for AI insights)
- Clone the repository
git clone <repository-url>
cd plex-wrapped- Install dependencies
npm install- Set up environment variables
cp example.env .envEdit .env and configure:
DATABASE_URL- PostgreSQL connection string (e.g.,postgresql://user:password@localhost:5432/plex_manager)NEXT_PUBLIC_APP_URL- Your public application URL (e.g.,http://localhost:3000for dev,https://yourdomain.comfor production)NEXTAUTH_URL- Your application URL for NextAuth callbacks (should matchNEXT_PUBLIC_APP_URLin production)NEXTAUTH_SECRET- Generate with:openssl rand -base64 32PLEX_CLIENT_IDENTIFIER- Unique identifier for your app instance (any string, doesn't need to be a UUID)
- Initialize the database
npm run db:generate
npm run db:push- Start the development server
npm run dev-
Open your browser Navigate to http://localhost:3000
-
Complete the setup wizard On first launch, you'll be guided through configuring:
- Plex server connection (URL format:
https://example.com:32400) - Tautulli integration (URL format:
http://example.com:8181) - Overseerr integration (optional, URL format:
http://example.com:5055) - LLM provider (optional)
plex-wrapped/
├── app/ # Next.js App Router (pages, layouts, routes)
│ ├── (app)/ # Authenticated app layout group
│ ├── admin/ # Admin dashboard and management
│ ├── api/ # API routes (webhooks, external integrations)
│ ├── auth/ # Authentication pages
│ ├── onboarding/ # User onboarding flow
│ ├── setup/ # Initial setup wizard
│ └── wrapped/ # Wrapped viewer and sharing
├── actions/ # Server Actions (mutations, data operations)
├── components/ # React components
│ ├── admin/ # Admin-specific components
│ ├── generator/ # Wrapped generation UI
│ ├── onboarding/ # Onboarding components
│ ├── setup-wizard/ # Setup wizard steps
│ ├── ui/ # Shared UI primitives
│ └── wrapped/ # Wrapped display components
├── lib/ # Utilities, helpers, business logic
│ ├── connections/ # External API clients (Plex, Tautulli, Overseerr, etc.)
│ ├── security/ # Security utilities (rate limiting, CSRF, audit logging)
│ ├── validations/ # Zod schemas for all services
│ ├── wrapped/ # Wrapped generation and statistics
│ └── utils/ # Shared utilities
├── types/ # TypeScript type definitions
├── prisma/ # Database schema and migrations
└── e2e/ # Playwright end-to-end tests
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run start |
Start production server |
npm run lint |
Run ESLint |
npm test |
Run unit/integration tests |
npm run test:watch |
Run tests in watch mode |
npm run test:coverage |
Generate coverage report |
npm run test:e2e |
Run end-to-end tests (Playwright) |
npm run test:e2e:ui |
Run E2E tests in UI mode |
npm run db:generate |
Generate Prisma Client |
npm run db:push |
Push schema changes to database |
npm run db:migrate |
Run database migrations |
npm run db:studio |
Open Prisma Studio (database GUI) |
npm run db:seed |
Seed database with test data |
📖 For comprehensive development guidelines, see CLAUDE.md
The CLAUDE.md file contains detailed information about:
- Architecture patterns and component design
- Server Actions vs API routes
- Database patterns with Prisma
- Integration guides (Plex, Tautulli, Overseerr, Sonarr/Radarr)
- Security best practices
- Testing strategies
- Code style conventions
Architecture Principles
- Server Components by default - Use Client Components (
'use client') only when needed - Server Actions - Prefer Server Actions over API routes for mutations
- TanStack Query - Use for all client-side data fetching
- TypeScript strict mode - Maintain type safety with exhaustive checks
Code Style
- Tailwind CSS - Use utility classes over custom CSS
- Zod - Validate all user inputs and API responses
- Error boundaries - Implement proper error handling and loading states
- Component organization - Keep components focused and reusable (max ~200-300 lines)
- Avoid over-engineering - Implement exactly what's needed, no premature abstractions
Testing
- Jest - Unit and integration tests with comprehensive coverage
- Testing Library - Component testing utilities
- Playwright - E2E testing with authenticated sessions (use
data-testidselectors) - See E2E Testing Guide for authenticated session patterns
Logging
- Use the
createLoggerutility from@/lib/utils/logger - See Logging Guide for details on log levels, metadata, and best practices
# Generate Prisma Client after schema changes
npm run db:generate
# Push schema changes (development)
npm run db:push
# Create migration (production)
npm run db:migrate
# Open database GUI
npm run db:studioSee example.env for all available configuration options. Key variables:
- Database:
DATABASE_URL - Application URLs:
NEXT_PUBLIC_APP_URL(preferred, used for public URLs),NEXTAUTH_URL(required by NextAuth, should matchNEXT_PUBLIC_APP_URLin production) - Authentication:
NEXTAUTH_SECRET,PLEX_CLIENT_IDENTIFIER - Development:
DEV_*variables for setup wizard defaults- Use URL format:
DEV_PLEX_URL="https://localhost:32400"(includes protocol and port)
- Use URL format:
When deploying to production, ensure the following environment variables are set:
-
NEXT_PUBLIC_APP_URL- Your public-facing domain (e.g.,https://yourdomain.com)- Used for sharing links, OG images, and public URLs
- Must be accessible from the internet
-
NEXTAUTH_URL- Your application URL (should matchNEXT_PUBLIC_APP_URL)- Used by NextAuth for OAuth callbacks and session management
- Must match the domain where your app is accessible
-
NEXTAUTH_SECRET- A secure random string- Generate with:
openssl rand -base64 32 - Keep this secret and never commit it to version control
- Generate with:
-
DATABASE_URL- Your production PostgreSQL database connection string- Example:
postgresql://user:password@host:port/database - SQLite is no longer supported (Prisma v7 requirement)
- Example:
- No hardcoded localhost: The application will throw an error in production if neither
NEXT_PUBLIC_APP_URLnorNEXTAUTH_URLis set - HTTPS required: In production, always use HTTPS URLs for both environment variables
- Domain consistency: Both URL variables should point to the same domain to avoid authentication issues
The project includes a Dockerfile for containerized deployments. When deploying with Docker:
- Set environment variables in your deployment platform or
.envfile - Ensure
NEXT_PUBLIC_APP_URLandNEXTAUTH_URLare set to your production domain - The application will fail to start in production mode if these are not configured
| Category | Technology |
|---|---|
| Framework | Next.js 14+ (App Router) |
| Language | TypeScript (strict mode) |
| Database | Prisma v7 + PostgreSQL |
| Authentication | NextAuth.js (Plex PIN-based authentication) |
| Data Fetching | TanStack Query (React Query) |
| Styling | Tailwind CSS |
| Animations | Framer Motion |
| Validation | Zod |
| Testing | Jest + Testing Library + Playwright |
- User Authentication - Sign in with your Plex account using PIN-based authentication
- Onboarding - New users are guided through server configuration and features
- Data Collection - Fetch viewing statistics from Tautulli and Plex
- Dashboard - View server info, request media, and explore content
- Plex Wrapped - Generate shareable year-end summaries (optional)
The platform integrates with multiple services to provide a comprehensive Plex management experience:
- Plex Media Server - Primary media server integration (required)
- Tautulli - Watch history and statistics tracking (required for Wrapped features)
- Overseerr - Media request management and availability tracking
- Sonarr - TV series management and monitoring
- Radarr - Movie management and monitoring
- Discord - Bot integration for server announcements and community features
- OpenAI/LLM Providers - AI-powered insights for Wrapped summaries
All integrations are configured through the setup wizard or admin panel, with validation and connection testing built-in.
- PIN-based authentication via Plex
- Server access verification - Only users with access to your Plex server can sign in
- Secure token generation for sharing features
- Admin-only actions protected by role checks
- Input validation with Zod schemas on all user inputs and API responses
- SQL injection protection via Prisma parameterized queries
- XSS prevention - React escapes by default, no unsafe HTML rendering
- CSRF protection - Built into Next.js Server Actions
- Rate limiting - Protection for sensitive endpoints
- Audit logging - Tracking of admin actions and security events
See CLAUDE.md for detailed security best practices.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Inspired by Spotify Wrapped. Built for the Plex community.



