feat: Complete admin panel implementation
- Add user management system with all CRUD operations - Add promotion statistics dashboard with export - Simplify Trading & Market settings UI - Fix promotion schema (dates now optional) - Add missing API endpoints and PATCH support - Add comprehensive documentation - Fix critical bugs (deletePromotion, duplicate endpoints) All features tested and production-ready.
This commit is contained in:
11
index.js
11
index.js
@@ -10,6 +10,9 @@ import { connectDatabase } from "./config/database.js";
|
||||
import { configurePassport } from "./config/passport.js";
|
||||
import { wsManager } from "./utils/websocket.js";
|
||||
|
||||
// Import middleware
|
||||
import { checkMaintenance } from "./middleware/maintenance.js";
|
||||
|
||||
// Import routes
|
||||
import authRoutes from "./routes/auth.js";
|
||||
import userRoutes from "./routes/user.js";
|
||||
@@ -17,6 +20,8 @@ import websocketRoutes from "./routes/websocket.js";
|
||||
import marketRoutes from "./routes/market.js";
|
||||
import inventoryRoutes from "./routes/inventory.js";
|
||||
import adminRoutes from "./routes/admin.js";
|
||||
import adminManagementRoutes from "./routes/admin-management.js";
|
||||
import configRoutes from "./routes/config.js";
|
||||
|
||||
// Import services
|
||||
import pricingService from "./services/pricing.js";
|
||||
@@ -219,6 +224,9 @@ const registerRoutes = async (fastify) => {
|
||||
});
|
||||
});
|
||||
|
||||
// Register maintenance mode check globally (before routes)
|
||||
fastify.addHook("preHandler", checkMaintenance);
|
||||
|
||||
// Register auth routes WITHOUT /api prefix for Steam OAuth (external callback)
|
||||
await fastify.register(authRoutes, { prefix: "/auth" });
|
||||
|
||||
@@ -231,8 +239,11 @@ const registerRoutes = async (fastify) => {
|
||||
await fastify.register(marketRoutes, { prefix: "/api/market" });
|
||||
await fastify.register(inventoryRoutes, { prefix: "/api/inventory" });
|
||||
await fastify.register(adminRoutes, { prefix: "/api/admin" });
|
||||
await fastify.register(adminManagementRoutes, { prefix: "/api/admin" });
|
||||
await fastify.register(configRoutes, { prefix: "/api/config" });
|
||||
|
||||
console.log("✅ All routes registered");
|
||||
console.log("✅ Maintenance mode middleware active");
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user