Skip to main content

Admin Module Overview

The Admin Module is a comprehensive administrative interface that can be added to any FSS package. It provides complete control over users, sessions, and system oversight.

Features

Dashboard

The admin dashboard provides real-time metrics and analytics:

interface DashboardMetrics {
totalUsers: number;
activeUsers: number;
newUsersToday: number;
revenueToday: number;
systemHealth: 'healthy' | 'warning' | 'critical';
}

Dashboard Features:

  • Real-time metrics and analytics
  • Recent activity overview
  • Quick access to common actions
  • System health indicators

User Management

Complete user management capabilities:

interface UserManagementFeatures {
pagination: boolean;
search: boolean;
filtering: boolean;
bulkActions: boolean;
export: boolean;
}

Capabilities:

  • View all users with pagination
  • Search by email, username, or name
  • Filter by role (admin/user) and status
  • Edit user details (role, status, email)
  • Disable or delete users
  • Resend verification emails
  • Disable MFA for users

Session Management

Monitor and control user sessions:

interface SessionFeatures {
viewActiveSessions: boolean;
sessionStatistics: boolean;
revokeIndividual: boolean;
revokeAll: boolean;
forceLogout: boolean;
}

Features:

  • View all active sessions for a user
  • Get session statistics
  • Revoke individual sessions
  • Force logout from all devices

Admin Access Flow

Quick Start

Installation

Add the admin module to your backend:

# Install admin module dependencies
cd projects/fss/backend
npm install @nestjs/swagger @nestjs/serve-static

Module Registration

// app.module.ts
import { AdminModule } from './modules/admin/admin.module';

@Module({
imports: [
// ... other modules
AdminModule,
],
})
export class AppModule {}

API Endpoints

User Management

EndpointMethodDescription
/admin/usersGETList users with filters
/admin/users/:idGETGet user details
/admin/users/:idPUTUpdate user
/admin/users/:idDELETEDelete user

Session Management

EndpointMethodDescription
/admin/users/:userId/sessionsGETList user sessions
/admin/sessionsGETList all active sessions

Next Steps