feat: add /api/dashboard endpoint with hero match, stats, streak, nudges

Returns next tippable match (hero), user rank/points from leaderboard,
consecutive-tip streak, and up to 3 contextual nudges in one request.
Mounts at /api/dashboard; adds getDashboard() + DashboardData type to
the frontend API client.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ronny
2026-04-11 19:01:01 +02:00
parent cb095126ef
commit b10f0f6ad4
3 changed files with 146 additions and 0 deletions
+2
View File
@@ -14,6 +14,7 @@ import leaderboardRouter from './routes/leaderboard';
import adminRouter from './routes/admin';
import profileRouter from './routes/profile';
import devRouter from './routes/dev';
import dashboardRouter from './routes/dashboard';
const app = express();
const PORT = parseInt(process.env.PORT ?? '3001');
@@ -126,6 +127,7 @@ app.use('/api/tips', tipsRouter);
app.use('/api/leaderboard', leaderboardRouter);
app.use('/api/admin', adminRouter);
app.use('/api/profile', profileRouter);
app.use('/api/dashboard', dashboardRouter);
if (process.env.NODE_ENV === 'development') {
app.use('/api/dev', devRouter);
}