Set up Fastify + TypeScript + Drizzle ORM backend with: - Database schema (7 tables: users, categories, questions, knowledge_cards, user_progress, skill_tree, user_chapter_progress) - JWT auth middleware + admin token auth - Route structure for auth, quiz, progress, gamification, payment, and admin - Service stubs for Phase 1b implementation - Zod-validated env config, custom error classes
15 lines
312 B
TypeScript
15 lines
312 B
TypeScript
import { FastifyInstance } from 'fastify';
|
|
|
|
export async function adminStatsRoutes(app: FastifyInstance): Promise<void> {
|
|
app.get('/', async () => ({
|
|
success: true,
|
|
data: {
|
|
totalUsers: 0,
|
|
activeUsersToday: 0,
|
|
totalQuestions: 0,
|
|
totalAnswers: 0,
|
|
},
|
|
error: null,
|
|
}));
|
|
}
|