A complete streaming TV application with live channels, TV guide, movies, and series. Built with Next.js 16, React 19, TypeScript, and Prisma.
- Live-TV: Stream live TV channels with HLS video player
- TV-Guide: Browse current TV programs across all channels
- Account Management: View remaining time, available coins, and redeem packages
- Package System:
- 24 hours for 1 coin
- 7 days for 3 coins
- 30 days for 5 coins
- Movies & Series: Access to on-demand content (when enabled by admin)
- 30-Minute Warning: Notification before pass expiration
- Mobile-Responsive: Optimized for both desktop and mobile devices
- User Management: View all users with online status
- Coin Management: Add or remove coins from user accounts
- Access Control: Enable/disable Movies and Series access per user
- User Monitoring: Track last online time and pass expiration
- Framework: Next.js 16.1.6 (App Router with Turbopack)
- Frontend: React 19.2.3, TypeScript 5
- Styling: Tailwind CSS 4
- Database: SQLite with Prisma 6.19.2
- Authentication: JWT with bcryptjs
- Video Player: HLS.js for streaming
- Icons: lucide-react
- Date Formatting: date-fns
- Node.js 20+
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd sport- Install dependencies:
npm install- Set up environment variables:
Create a
.envfile in the root directory:
DATABASE_URL="file:./dev.db"
JWT_SECRET="your-secure-secret-key-here"- Initialize the database:
npx prisma migrate dev --name init- (Optional) Seed the database with sample data:
# Create an admin user
npx prisma studio
# Then manually create users, channels, programs, movies, and seriesStart the development server:
npm run devOpen http://localhost:3000 in your browser.
Build the application:
npm run buildStart the production server:
npm startsport/
├── app/ # Next.js App Router pages
│ ├── api/ # API routes
│ │ ├── auth/ # Authentication endpoints
│ │ ├── admin/ # Admin endpoints
│ │ ├── channels/ # Channel endpoints
│ │ ├── epg/ # EPG/Program endpoints
│ │ ├── movies/ # Movies endpoints
│ │ ├── series/ # Series endpoints
│ │ └── users/ # User endpoints
│ ├── account/ # Account page
│ ├── live-tv/ # Live TV page
│ ├── login/ # Login page
│ ├── movies/ # Movies page
│ ├── register/ # Register page
│ ├── series/ # Series page
│ ├── settings/ # Admin settings
│ │ └── users/ # User management
│ └── tv-guide/ # TV Guide page
├── components/ # React components
│ ├── Navigation.tsx # Main navigation
│ ├── ProtectedRoute.tsx # Auth wrapper
│ └── VideoPlayer.tsx # HLS video player
├── contexts/ # React contexts
│ └── AuthContext.tsx # Authentication context
├── lib/ # Utility libraries
│ ├── auth.ts # JWT & bcrypt utilities
│ ├── coins.ts # Coin package logic
│ ├── middleware.ts # API middleware
│ └── prisma.ts # Prisma client
├── prisma/ # Database
│ ├── schema.prisma # Database schema
│ └── migrations/ # Database migrations
└── public/ # Static assets
POST /api/auth/register- Register new userPOST /api/auth/login- Login userPOST /api/auth/logout- Logout userGET /api/auth/me- Get current user
GET /api/channels/list- Get all channelsGET /api/epg/current?channelId={id}- Get current program for channel
GET /api/movies/list- Get all movies (requires movies enabled)GET /api/series/list- Get all series (requires series enabled)
GET /api/users/transactions- Get user transaction historyPOST /api/users/redeem- Redeem package with coinsPOST /api/users/password- Change password
GET /api/admin/users- Get all users (admin only)POST /api/admin/users- Manage users (admin only)- Actions:
add_coins,remove_coins,toggle_movies,toggle_series,delete
- Actions:
- User: User accounts with authentication and subscription info
- Session: Active user sessions with JWT tokens
- Transaction: Coin transaction history
- Channel: TV channels with stream URLs
- Program: TV program schedule (EPG data)
- Movie: On-demand movies
- Series: TV series
- Episode: Individual series episodes
- JWT-based authentication with secure token storage
- Password hashing with bcryptjs (10 rounds)
- Protected API routes with middleware
- Admin-only routes with role checking
- Environment variables for secrets
- CodeQL security scanning with zero vulnerabilities
The application is fully responsive with:
- Icon-based navigation on mobile (no labels)
- Collapsible channel list on Live-TV page
- Touch-optimized UI elements
- Responsive grid layouts for movies/series
- Mobile-first design approach
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
[Add your license here]
For issues and questions, please open an issue on GitHub.