Initiated the obsidian vault
This commit is contained in:
1 parent
3c4958df50
commit
1058274a6a
13 files changed
+262
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
.trash
|
||||||
|
.obsidian
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Architecture
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Showy is a media tracking application with three main layers:
|
||||||
|
|
||||||
|
- **[[Backend]]** — Node.js + Express REST API with Sequelize ORM and MySQL
|
||||||
|
- **[[Frontend]]** — React 18 + TypeScript SPA (Vite, TanStack Query, Zustand, shadcn/ui)
|
||||||
|
- **[[Electron]]** — Desktop wrapper using Electron
|
||||||
|
|
||||||
|
## Key Flows
|
||||||
|
|
||||||
|
- Library data is fetched on app load into a Zustand store (`useLibraryStore`)
|
||||||
|
- Pages use TanStack Query hooks for server state (seasons, episodes, statistics)
|
||||||
|
- Dashboard charts consume statistics endpoints and library store data
|
||||||
|
- Maintenance/cleanup operations use dedicated backend endpoints
|
||||||
|
|
||||||
|
## Important Files
|
||||||
|
|
||||||
|
- `backend/server.js` — Express app entry point
|
||||||
|
- `react_frontend/src/App.tsx` — React app entry + router
|
||||||
|
- `react_frontend/src/stores/useLibraryStore.ts` — Global library state
|
||||||
|
- `electron/main.js` — Electron main process
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Backend
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Node.js + Express REST API with Sequelize ORM and MySQL database.
|
||||||
|
|
||||||
|
## Key Endpoints
|
||||||
|
|
||||||
|
- `GET/PUT /settings` — App settings
|
||||||
|
- `GET/DELETE /maintenance/orphan-files` — Orphan file scan/cleanup
|
||||||
|
- `GET/DELETE /maintenance/orphan-media-records` — Orphan DB record scan/cleanup
|
||||||
|
- `GET /statistics/watch-weekday` — Watchday distribution (filtered to EXACT accuracy)
|
||||||
|
- CRUD endpoints for entries, seasons, episodes, collections, people
|
||||||
|
|
||||||
|
## Important Files
|
||||||
|
|
||||||
|
- `server.js` — Express app setup
|
||||||
|
- `config/database.js` — Sequelize/MySQL connection
|
||||||
|
- `config/relations.js` — Model associations
|
||||||
|
- `controllers/` — Route handlers
|
||||||
|
- `services/` — Business logic
|
||||||
|
- `models/` — Sequelize models
|
||||||
|
|
||||||
|
## Known Issues
|
||||||
|
|
||||||
|
- Maintenance service `deleteOrphanFiles` uses synchronous `fs.existsSync` in a loop
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## Milestone 001
|
||||||
|
|
||||||
|
### Backend
|
||||||
|
- Added accuracy filter (`WHERE accuracy = 'EXACT'`) to [[Statistics]] watchday distribution queries
|
||||||
|
|
||||||
|
### Frontend
|
||||||
|
- Replaced Calendar popover with native date input in [[EntrySeenDialog]] and [[EpisodeSeenEditDialog]]
|
||||||
|
- Merged date + accuracy into a single row in both seen dialogs
|
||||||
|
- [[LibraryGrowthChart]]: uses `createdAt` only, includes all entries (watchlist + library)
|
||||||
|
- [[SeasonPage]] and [[EpisodePage]]: added `max-w-4xl` width constraint
|
||||||
|
- Breadcrumbs now show "Title / Season x / Episode x" instead of generic labels — see [[Navigation]]
|
||||||
|
- Fixed EpisodePage using `seasonId` (DB id) instead of `season.season_number`
|
||||||
|
- Added cleanup section to [[Settings Page]] for orphan files/media records
|
||||||
|
- Created `api/maintenance.ts` API client
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Database
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
MySQL database named "Showzy", managed by Sequelize ORM. Schema sync uses `{ alter: doUpdate }` where `doUpdate = false` by default.
|
||||||
|
|
||||||
|
## Key Models
|
||||||
|
|
||||||
|
- `Entry` — Movies and TV series
|
||||||
|
- `Season` — TV seasons (belongs to Entry)
|
||||||
|
- `Episode` — TV episodes (belongs to Season)
|
||||||
|
- `EntrySeen` — Movie watch records (has `accuracy` field: EXACT, ESTIMATED, UNKNOWN)
|
||||||
|
- `EpisodeSeen` — Episode watch records (has `accuracy` field: EXACT, ESTIMATED, UNKNOWN)
|
||||||
|
- `Media` — Image file references (posters, logos, backdrops, stills)
|
||||||
|
- `Collection`, `Genre`, `Network`, `People`, `Credit`, `Franchise`
|
||||||
|
|
||||||
|
## Important Files
|
||||||
|
|
||||||
|
- `backend/config/database.js` — Connection config
|
||||||
|
- `backend/config/relations.js` — Model associations
|
||||||
|
- `backend/models/` — All Sequelize model definitions
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Deployment
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Docker-based deployment using `docker-compose.yml` at project root.
|
||||||
|
|
||||||
|
## Important Files
|
||||||
|
|
||||||
|
- `docker-compose.yml` — Compose orchestration
|
||||||
|
- `backend/Dockerfile` — Backend container
|
||||||
|
- `frontend/Dockerfile` — Angular frontend container (legacy)
|
||||||
|
- `frontend/nginx.conf` — Nginx config for frontend serving
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Electron
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Desktop wrapper using Electron. Entry point: `electron/main.js`.
|
||||||
|
|
||||||
|
## Important Files
|
||||||
|
|
||||||
|
- `electron/main.js` — Main process
|
||||||
|
- `electron/preload.js` — Preload script
|
||||||
|
- `electron/package.json` — Electron dependencies
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Environment Variables
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Configuration is managed via `backend/settings.json` (see `settings.json.example`).
|
||||||
|
|
||||||
|
## Key Settings
|
||||||
|
|
||||||
|
- `tmdbApiKey` — TMDB API key for metadata fetching
|
||||||
|
- `backPort` — Backend server port
|
||||||
|
- Database connection configured in `backend/config/database.js`
|
||||||
|
|
||||||
|
## Important Files
|
||||||
|
|
||||||
|
- `backend/settings.json.example` — Template
|
||||||
|
- `backend/config/database.js` — DB connection config
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Frontend
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
React 18 + TypeScript SPA built with Vite. Uses shadcn/ui for components, TanStack Query for server state, Zustand for client state, and Recharts for charts.
|
||||||
|
|
||||||
|
## Key Patterns
|
||||||
|
|
||||||
|
- **State Management**: `useLibraryStore` (Zustand) holds all entries; TanStack Query for server data
|
||||||
|
- **Forms**: react-hook-form + zod for validation
|
||||||
|
- **Routing**: React Router v6 with nested routes
|
||||||
|
- **Styling**: Tailwind CSS + shadcn/ui components
|
||||||
|
|
||||||
|
## Important Pages
|
||||||
|
|
||||||
|
- **Dashboard** — [[Statistics]] charts (CouchDayChart, LibraryGrowthChart)
|
||||||
|
- **Entry Details** — Entry info, seasons list, watch history
|
||||||
|
- **[[SeasonPage]]** — Season episodes with watch progress
|
||||||
|
- **[[EpisodePage]]** — Episode details with prev/next navigation
|
||||||
|
- **[[Settings Page]]** — App config + maintenance cleanup
|
||||||
|
|
||||||
|
## Navigation
|
||||||
|
|
||||||
|
See [[Navigation]] for breadcrumb patterns.
|
||||||
|
|
||||||
|
## API Clients
|
||||||
|
|
||||||
|
Located in `react_frontend/src/api/`:
|
||||||
|
- `settings.ts` — Settings CRUD
|
||||||
|
- `maintenance.ts` — Orphan file/record scan and cleanup
|
||||||
|
- `seasons.ts` — Season and episode data
|
||||||
|
- `entries.ts` — Entry CRUD
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Showy Documentation Vault
|
||||||
|
|
||||||
|
Welcome to the Showy project documentation. Use the links below to navigate.
|
||||||
|
|
||||||
|
## Core Documentation
|
||||||
|
|
||||||
|
- [[Architecture]]
|
||||||
|
- [[Frontend]]
|
||||||
|
- [[Backend]]
|
||||||
|
- [[Electron]]
|
||||||
|
- [[Database]]
|
||||||
|
- [[Deployment]]
|
||||||
|
- [[Env]]
|
||||||
|
- [[Changelog]]
|
||||||
|
|
||||||
|
## Quick Links
|
||||||
|
|
||||||
|
- [[Settings Page]] — App settings and maintenance cleanup
|
||||||
|
- [[Statistics]] — Dashboard charts and data queries
|
||||||
|
- [[Navigation]] — Breadcrumb and page navigation patterns
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# Navigation
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Breadcrumb-style navigation for detail pages. Pages use linked text segments separated by `/`.
|
||||||
|
|
||||||
|
## Patterns
|
||||||
|
|
||||||
|
### SeasonPage
|
||||||
|
`Title / Season x`
|
||||||
|
- "Title" links to `/entry/:entryId`
|
||||||
|
- "Season x" is the current page (non-linked, bold)
|
||||||
|
- Entry title fetched from `useLibraryStore`
|
||||||
|
|
||||||
|
### EpisodePage
|
||||||
|
`Title / Season x / Episode x`
|
||||||
|
- "Title" links to `/entry/:entryId`
|
||||||
|
- "Season x" links to `/entry/:entryId/season/:seasonId`
|
||||||
|
- "Episode x" is the current page (non-linked, bold)
|
||||||
|
- Uses `useSeason()` hook to get `season_number` (not the DB `seasonId`)
|
||||||
|
- Entry title fetched from `useLibraryStore`
|
||||||
|
|
||||||
|
## Width Constraints
|
||||||
|
|
||||||
|
Detail pages (EntryDetailsPage, [[SeasonPage]], [[EpisodePage]]) use `mx-auto max-w-4xl` for consistent max width.
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Settings Page
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
App configuration and maintenance tools at `/settings`.
|
||||||
|
|
||||||
|
## Sections
|
||||||
|
|
||||||
|
### General Settings
|
||||||
|
- **TMDB API Key** — Required for media metadata lookups
|
||||||
|
- **Backend Port** — Port the backend server runs on
|
||||||
|
|
||||||
|
### Cleanup
|
||||||
|
Added in Milestone 001. Uses [[Backend]] maintenance endpoints.
|
||||||
|
|
||||||
|
#### Orphan Files
|
||||||
|
- **Scan** (`GET /maintenance/orphan-files`) — Dry run, returns counts of orphan files by type
|
||||||
|
- **Delete** (`DELETE /maintenance/orphan-files`) — Removes orphan files from disk
|
||||||
|
|
||||||
|
#### Orphan Media Records
|
||||||
|
- **Scan** (`GET /maintenance/orphan-media-records`) — Dry run, returns counts of DB records with no file
|
||||||
|
- **Delete** (`DELETE /maintenance/orphan-media-records`) — Removes orphan records from database
|
||||||
|
|
||||||
|
### Response Format
|
||||||
|
Both endpoints return: `{ posters: number, logos: number, backdrops: number, stills: number }`
|
||||||
|
|
||||||
|
## Important Files
|
||||||
|
|
||||||
|
- `react_frontend/src/pages/SettingsPage.tsx`
|
||||||
|
- `react_frontend/src/api/maintenance.ts`
|
||||||
|
- `backend/controllers/maintenanceController.js`
|
||||||
|
- `backend/services/maintenanceService.js`
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Statistics
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Dashboard charts powered by [[Backend]] statistics endpoints and the library store.
|
||||||
|
|
||||||
|
## Charts
|
||||||
|
|
||||||
|
### CouchDayChart
|
||||||
|
- Shows watch distribution by day of week (bar chart)
|
||||||
|
- Endpoint: `GET /statistics/watch-weekday`
|
||||||
|
- **Only counts records with `accuracy = 'EXACT'`** (Milestone 001)
|
||||||
|
- Queries both `EpisodeSeen` and `EntrySeen` tables
|
||||||
|
|
||||||
|
### LibraryGrowthChart
|
||||||
|
- Shows cumulative library growth over time (area chart)
|
||||||
|
- Data source: Library store entries (client-side computation)
|
||||||
|
- Uses `createdAt` field as the entry date (Milestone 001)
|
||||||
|
- Includes all entries (library + watchlist)
|
||||||
|
- Supports year filter with "All" option
|
||||||
|
|
||||||
|
## Important Files
|
||||||
|
|
||||||
|
- `react_frontend/src/components/dashboard/CouchDayChart.tsx`
|
||||||
|
- `react_frontend/src/components/dashboard/LibraryGrowthChart.tsx`
|
||||||
|
- `backend/controllers/statisticsController.js` — `getWatchdayDistribution` method
|
||||||
Reference in new issue
Block a user