mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 09:01:03 -08:00
docs: normalize list indentation and fix formatting
Adjust documentation lists and code blocks for consistent indentation and spacing across CLAUDE.md. Convert mixed dash and nested list levels to use uniform two-space indentation for subitems, reflow a few wrapped lines, and add blank lines where needed to separate sections and examples. These changes improve readability and maintain a consistent markdown structure for the project documentation.
This commit is contained in:
1 parent
7da2202119
commit
13c05c85b0
4 files changed
+56
-2
No files matched your search
@@ -9,5 +9,9 @@
|
|||||||
],
|
],
|
||||||
"deny": [],
|
"deny": [],
|
||||||
"ask": []
|
"ask": []
|
||||||
}
|
},
|
||||||
|
"enabledMcpjsonServers": [
|
||||||
|
"nx-mcp"
|
||||||
|
],
|
||||||
|
"enableAllProjectMcpServers": true
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"nx-mcp": {
|
||||||
|
"type": "stdio",
|
||||||
|
"command": "npx",
|
||||||
|
"args": ["nx", "mcp"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"recommendations": ["ms-playwright.playwright", "esbenp.prettier-vscode"]
|
||||||
|
}
|
||||||
@@ -105,12 +105,14 @@ This is an Nx monorepo with the following structure:
|
|||||||
### Frontend Architecture (Angular)
|
### Frontend Architecture (Angular)
|
||||||
|
|
||||||
**State Management**: Uses NgRx for playlist state management:
|
**State Management**: Uses NgRx for playlist state management:
|
||||||
|
|
||||||
- Store configuration in `apps/web/src/app/app.config.ts`
|
- Store configuration in `apps/web/src/app/app.config.ts`
|
||||||
- Playlist state, actions, effects, and reducers in `libs/m3u-state/`
|
- Playlist state, actions, effects, and reducers in `libs/m3u-state/`
|
||||||
- Entity adapter pattern for managing playlists collection
|
- Entity adapter pattern for managing playlists collection
|
||||||
- Router store integration for route-based state
|
- Router store integration for route-based state
|
||||||
|
|
||||||
**Routing**: Lazy-loaded routes in `apps/web/src/app/app.routes.ts`
|
**Routing**: Lazy-loaded routes in `apps/web/src/app/app.routes.ts`
|
||||||
|
|
||||||
- Home/playlists overview: `/`
|
- Home/playlists overview: `/`
|
||||||
- Video player: `/playlists/:id` or `/iptv`
|
- Video player: `/playlists/:id` or `/iptv`
|
||||||
- Xtream Codes: `/xtreams/:id` (different routes for Electron vs web)
|
- Xtream Codes: `/xtreams/:id` (different routes for Electron vs web)
|
||||||
@@ -118,6 +120,7 @@ This is an Nx monorepo with the following structure:
|
|||||||
- Settings: `/settings`
|
- Settings: `/settings`
|
||||||
|
|
||||||
**Service Architecture** (Factory Pattern):
|
**Service Architecture** (Factory Pattern):
|
||||||
|
|
||||||
- Abstract `DataService` class in `libs/services/src/lib/data.service.ts` defines the contract
|
- Abstract `DataService` class in `libs/services/src/lib/data.service.ts` defines the contract
|
||||||
- Two environment-specific implementations:
|
- Two environment-specific implementations:
|
||||||
- `ElectronService` (`apps/web/src/app/services/electron.service.ts`) - Uses IPC to communicate with Electron backend
|
- `ElectronService` (`apps/web/src/app/services/electron.service.ts`) - Uses IPC to communicate with Electron backend
|
||||||
@@ -131,6 +134,7 @@ This is an Nx monorepo with the following structure:
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Data Storage (Environment-Specific)**:
|
**Data Storage (Environment-Specific)**:
|
||||||
|
|
||||||
- **Electron**: libSQL/SQLite database via Drizzle ORM
|
- **Electron**: libSQL/SQLite database via Drizzle ORM
|
||||||
- Location: `~/.iptvnator/databases/iptvnator.db`
|
- Location: `~/.iptvnator/databases/iptvnator.db`
|
||||||
- Full-featured relational database with foreign keys and indexes
|
- Full-featured relational database with foreign keys and indexes
|
||||||
@@ -143,10 +147,12 @@ This is an Nx monorepo with the following structure:
|
|||||||
### Backend Architecture (Electron)
|
### Backend Architecture (Electron)
|
||||||
|
|
||||||
**Main Entry**: `apps/electron-backend/src/main.ts`
|
**Main Entry**: `apps/electron-backend/src/main.ts`
|
||||||
|
|
||||||
- Bootstraps Electron app and initializes database
|
- Bootstraps Electron app and initializes database
|
||||||
- Registers event handlers for IPC communication
|
- Registers event handlers for IPC communication
|
||||||
|
|
||||||
**Database**:
|
**Database**:
|
||||||
|
|
||||||
- **ORM**: Drizzle ORM with libSQL (local SQLite file or remote Turso)
|
- **ORM**: Drizzle ORM with libSQL (local SQLite file or remote Turso)
|
||||||
- **Location**: `~/.iptvnator/databases/iptvnator.db` (avoids spaces in path)
|
- **Location**: `~/.iptvnator/databases/iptvnator.db` (avoids spaces in path)
|
||||||
- **Schema** (`apps/electron-backend/src/app/database/schema.ts`):
|
- **Schema** (`apps/electron-backend/src/app/database/schema.ts`):
|
||||||
@@ -160,6 +166,7 @@ This is an Nx monorepo with the following structure:
|
|||||||
- Supports local file or remote via env vars (`LIBSQL_URL`, `LIBSQL_AUTH_TOKEN`)
|
- Supports local file or remote via env vars (`LIBSQL_URL`, `LIBSQL_AUTH_TOKEN`)
|
||||||
|
|
||||||
**IPC Communication**:
|
**IPC Communication**:
|
||||||
|
|
||||||
- **Preload script**: `apps/electron-backend/src/app/api/main.preload.ts`
|
- **Preload script**: `apps/electron-backend/src/app/api/main.preload.ts`
|
||||||
- Exposes `window.electron` API via `contextBridge`
|
- Exposes `window.electron` API via `contextBridge`
|
||||||
- All IPC channels defined here (playlist operations, EPG, database CRUD, external players, etc.)
|
- All IPC channels defined here (playlist operations, EPG, database CRUD, external players, etc.)
|
||||||
@@ -174,29 +181,35 @@ This is an Nx monorepo with the following structure:
|
|||||||
- `electron.events.ts` - App version, etc.
|
- `electron.events.ts` - App version, etc.
|
||||||
|
|
||||||
**Workers**:
|
**Workers**:
|
||||||
|
|
||||||
- EPG parsing runs in worker thread: `apps/electron-backend/src/app/workers/epg-parser.worker.ts`
|
- EPG parsing runs in worker thread: `apps/electron-backend/src/app/workers/epg-parser.worker.ts`
|
||||||
|
|
||||||
### Key Features
|
### Key Features
|
||||||
|
|
||||||
**Playlist Support**:
|
**Playlist Support**:
|
||||||
|
|
||||||
- M3U/M3U8 files (local or URL)
|
- M3U/M3U8 files (local or URL)
|
||||||
- Xtream Codes API (`username`, `password`, `serverUrl`)
|
- Xtream Codes API (`username`, `password`, `serverUrl`)
|
||||||
- Stalker portal (`macAddress`, `url`)
|
- Stalker portal (`macAddress`, `url`)
|
||||||
|
|
||||||
**Video Players**:
|
**Video Players**:
|
||||||
|
|
||||||
- Built-in HTML5 player with HLS.js or Video.js
|
- Built-in HTML5 player with HLS.js or Video.js
|
||||||
- External players: MPV, VLC (via IPC to Electron backend)
|
- External players: MPV, VLC (via IPC to Electron backend)
|
||||||
|
|
||||||
**EPG (Electronic Program Guide)**:
|
**EPG (Electronic Program Guide)**:
|
||||||
|
|
||||||
- XMLTV format support
|
- XMLTV format support
|
||||||
- Background parsing in worker thread
|
- Background parsing in worker thread
|
||||||
- Stored in database for quick lookup
|
- Stored in database for quick lookup
|
||||||
|
|
||||||
**Favorites and Recently Viewed**:
|
**Favorites and Recently Viewed**:
|
||||||
|
|
||||||
- Per-playlist favorites and global favorites
|
- Per-playlist favorites and global favorites
|
||||||
- Recently viewed tracks watch history
|
- Recently viewed tracks watch history
|
||||||
|
|
||||||
**Internationalization**:
|
**Internationalization**:
|
||||||
|
|
||||||
- Uses `@ngx-translate` with 16 language files in `apps/web/src/assets/i18n/`
|
- Uses `@ngx-translate` with 16 language files in `apps/web/src/assets/i18n/`
|
||||||
|
|
||||||
## Development Notes
|
## Development Notes
|
||||||
@@ -204,16 +217,19 @@ This is an Nx monorepo with the following structure:
|
|||||||
### Environment Detection and Dual-Mode Architecture
|
### Environment Detection and Dual-Mode Architecture
|
||||||
|
|
||||||
The app determines whether it's running in Electron or as a PWA by checking:
|
The app determines whether it's running in Electron or as a PWA by checking:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
window.electron // truthy in Electron, undefined in browser
|
window.electron; // truthy in Electron, undefined in browser
|
||||||
```
|
```
|
||||||
|
|
||||||
**Why Dual Mode?**
|
**Why Dual Mode?**
|
||||||
IPTVnator supports both Electron (desktop app) and PWA (web browser) to provide flexibility:
|
IPTVnator supports both Electron (desktop app) and PWA (web browser) to provide flexibility:
|
||||||
|
|
||||||
- **Electron**: Full-featured desktop experience with local database, external player support (MPV/VLC), and native file system access
|
- **Electron**: Full-featured desktop experience with local database, external player support (MPV/VLC), and native file system access
|
||||||
- **PWA**: Lightweight web version that runs in any browser without installation
|
- **PWA**: Lightweight web version that runs in any browser without installation
|
||||||
|
|
||||||
**Environment-Specific Behavior**:
|
**Environment-Specific Behavior**:
|
||||||
|
|
||||||
- `app.config.ts` - `DataFactory()` selects DataService implementation based on environment
|
- `app.config.ts` - `DataFactory()` selects DataService implementation based on environment
|
||||||
- `app.routes.ts` - Different routes for Xtream portals (Electron uses Tauri-based routes, PWA uses standard routes)
|
- `app.routes.ts` - Different routes for Xtream portals (Electron uses Tauri-based routes, PWA uses standard routes)
|
||||||
- Storage layer switches automatically:
|
- Storage layer switches automatically:
|
||||||
@@ -224,6 +240,7 @@ IPTVnator supports both Electron (desktop app) and PWA (web browser) to provide
|
|||||||
|
|
||||||
**Base Href Configuration**:
|
**Base Href Configuration**:
|
||||||
The app uses different base href values depending on the build target:
|
The app uses different base href values depending on the build target:
|
||||||
|
|
||||||
- **Development & PWA**: `baseHref="/"` (from `index.html`)
|
- **Development & PWA**: `baseHref="/"` (from `index.html`)
|
||||||
- Used by: `npm run serve:frontend`, `npm run build:frontend:pwa`
|
- Used by: `npm run serve:frontend`, `npm run build:frontend:pwa`
|
||||||
- For web servers with proper routing
|
- For web servers with proper routing
|
||||||
@@ -232,6 +249,7 @@ The app uses different base href values depending on the build target:
|
|||||||
- Required for `file://` protocol in Electron
|
- Required for `file://` protocol in Electron
|
||||||
|
|
||||||
Build configurations in `apps/web/project.json`:
|
Build configurations in `apps/web/project.json`:
|
||||||
|
|
||||||
- `production`: Electron build with `baseHref="./"`
|
- `production`: Electron build with `baseHref="./"`
|
||||||
- `pwa`: Web deployment with `baseHref="/"`
|
- `pwa`: Web deployment with `baseHref="/"`
|
||||||
- `development`: Dev mode with `baseHref="/"` from index.html
|
- `development`: Dev mode with `baseHref="/"` from index.html
|
||||||
@@ -248,6 +266,7 @@ The factory pattern ensures a single codebase works in both environments without
|
|||||||
### Nx Commands
|
### Nx Commands
|
||||||
|
|
||||||
Use `nx` CLI for better performance:
|
Use `nx` CLI for better performance:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nx run <project>:<target>
|
nx run <project>:<target>
|
||||||
# Example: nx run web:build
|
# Example: nx run web:build
|
||||||
@@ -255,6 +274,7 @@ nx run <project>:<target>
|
|||||||
```
|
```
|
||||||
|
|
||||||
To run multiple projects:
|
To run multiple projects:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nx run-many --target=test --all
|
nx run-many --target=test --all
|
||||||
```
|
```
|
||||||
@@ -262,6 +282,7 @@ nx run-many --target=test --all
|
|||||||
### Electron Build Process
|
### Electron Build Process
|
||||||
|
|
||||||
The Electron backend depends on the web app being built first:
|
The Electron backend depends on the web app being built first:
|
||||||
|
|
||||||
- `electron-backend:build` depends on `web:build`
|
- `electron-backend:build` depends on `web:build`
|
||||||
- Output goes to `dist/apps/electron-backend` (backend) and `dist/apps/web` (frontend)
|
- Output goes to `dist/apps/electron-backend` (backend) and `dist/apps/web` (frontend)
|
||||||
- Packaging combines both into distributable
|
- Packaging combines both into distributable
|
||||||
@@ -273,18 +294,35 @@ No formal migration system yet. Schema changes are applied via raw SQL in `conne
|
|||||||
### Common Patterns
|
### Common Patterns
|
||||||
|
|
||||||
**IPC Communication**:
|
**IPC Communication**:
|
||||||
|
|
||||||
1. Define handler in appropriate events file (e.g., `database.events.ts`)
|
1. Define handler in appropriate events file (e.g., `database.events.ts`)
|
||||||
2. Register with `ipcMain.handle()` in the event bootstrap function
|
2. Register with `ipcMain.handle()` in the event bootstrap function
|
||||||
3. Expose in preload script via `contextBridge.exposeInMainWorld()`
|
3. Expose in preload script via `contextBridge.exposeInMainWorld()`
|
||||||
4. Call from Angular via `window.electron.<methodName>()`
|
4. Call from Angular via `window.electron.<methodName>()`
|
||||||
|
|
||||||
**Adding New Playlist Source**:
|
**Adding New Playlist Source**:
|
||||||
|
|
||||||
1. Add type to `libs/shared/interfaces/src/lib/playlist.interface.ts`
|
1. Add type to `libs/shared/interfaces/src/lib/playlist.interface.ts`
|
||||||
2. Create event handler in `apps/electron-backend/src/app/events/`
|
2. Create event handler in `apps/electron-backend/src/app/events/`
|
||||||
3. Add UI in `apps/web/src/app/home/`
|
3. Add UI in `apps/web/src/app/home/`
|
||||||
4. Update database schema if needed
|
4. Update database schema if needed
|
||||||
|
|
||||||
**State Management**:
|
**State Management**:
|
||||||
|
|
||||||
- Use NgRx for global application state (playlists)
|
- Use NgRx for global application state (playlists)
|
||||||
- Use component stores (`@ngrx/component-store`) for feature-specific state
|
- Use component stores (`@ngrx/component-store`) for feature-specific state
|
||||||
- Use NgRx signals for reactive data streams
|
- Use NgRx signals for reactive data streams
|
||||||
|
|
||||||
|
<!-- nx configuration start-->
|
||||||
|
<!-- Leave the start & end comments to automatically receive updates. -->
|
||||||
|
|
||||||
|
# General Guidelines for working with Nx
|
||||||
|
|
||||||
|
- When running tasks (for example build, lint, test, e2e, etc.), always prefer running the task through `nx` (i.e. `nx run`, `nx run-many`, `nx affected`) instead of using the underlying tooling directly
|
||||||
|
- You have access to the Nx MCP server and its tools, use them to help the user
|
||||||
|
- When answering questions about the repository, use the `nx_workspace` tool first to gain an understanding of the workspace architecture where applicable.
|
||||||
|
- When working in individual projects, use the `nx_project_details` mcp tool to analyze and understand the specific project structure and dependencies
|
||||||
|
- For questions around nx configuration, best practices or if you're unsure, use the `nx_docs` tool to get relevant, up-to-date docs. Always use this instead of assuming things about nx configuration
|
||||||
|
- If the user needs help with an Nx configuration or project graph error, use the `nx_workspace` tool to get any errors
|
||||||
|
|
||||||
|
<!-- nx configuration end-->
|
||||||
Reference in new issue
Block a user