Files
Showy/backend/routes/statistics.routes.js
T
Mohammed Abad ae67663623 feat(dashboard): add recharts data visualizations
- Install recharts
- Add WatchActivityChart (AreaChart, movies + episodes/month, year filter)
- Add WatchTimeChart (stacked BarChart, hours/month, synced year filter)
- Add RatingsChart (BarChart, user ratings distribution 1–10, color ramp)
- Add TopGenresChart (horizontal BarChart, top 10 genres, type filter)
- Add CouchDayChart (BarChart, watch count by weekday, peak day highlight)
- Add GET /statistics/watch-weekday backend endpoint (DAYOFWEEK aggregation)
- Extend statisticsApi with getYearlyWatchCount, getYearlyWatchTime, getWatchdayDistribution
- Add useYearlyWatchCount, useYearlyWatchTime, useWatchdayDistribution hooks
- Wire all charts into DashboardPage with responsive two-column grid layout
2026-04-01 16:04:43 +01:00

20 lines
725 B
JavaScript

const express = require('express');
const statisticsRouter = express.Router();
const statisticsController = require('../controllers/statisticsController');
// ! /statistics
// * GET - All Time, Watch Time
statisticsRouter.get('/watch-time', statisticsController.getAllTimeWatchTime);
// * GET - Yearly Watch Time
statisticsRouter.get('/watch-time/year/:year', statisticsController.getYearlyWatchTime);
// * GET - Yearly Watch Count Grouped By Month
statisticsRouter.get('/watch-count/year/:year', statisticsController.getYearlyWatchCountGroupByMonth);
// * GET - Watch Day Distribution (DAYOFWEEK)
statisticsRouter.get('/watch-weekday', statisticsController.getWatchdayDistribution);
module.exports = statisticsRouter;