# Admin Panel

The admin feature enables an Admin Panel that is reached by selecting "Admin Panel" from the user dropdown, when logged in as a user who has account_type set to admin. This will land you on the Admin Dashboard (features/admin/ui/pages/DashboardPage.vue), which is empty and waiting for you to customize.

# Enabling

This feature is enabled by default, and should remain enabled. Only users with account_type set to admin will be able to see any admin features, so this is safe to leave enabled, even if you don't intend to use any admin features.

# Admin Sidebar Menu

The Admin Sidebar Menu is different from the App Sidebar menu, and can be customized by editing config/ui.js -> adminSidebar. By default, it has two entries: one for the aforementioned Dashboard, and one for the User list. You can override this config entry in app/config/ui.js to remove, change, or add entries. To pick a new icon for the sidebar, find the name in FontAwesome for the new icon you want (opens new window) and prefix it with fa-. Nodewood comes with the free version FontAwesome installed, but can be upgraded to use paid versions.

# Dashboard

Which metrics are important and which are not is a very business-specific decision you will need to make. As a consequence, the initial Admin Dashboard takes a minimal approach, displaying user and MRR data, recent users, and provides a sample chart for reference.

By default, the dashboard will display demo data for reference, but this can be switch to live data by setting displayDashboardDemoData to false in config/admin.js.

For further customization, the Admin Dashboard Page lives at features/admin/ui/pages/DashboardPage.vue and the controller at features/admin/api/controllers/AdminDashboardController.js.

# Dashboard Rollup Script

The "Analytics" and "Last 30 Days" section of the Dashboard rely on data from the admin_dashboard_rollups table, which is generated by running the features/admin/cli/scripts/DashboardRollupScript. Information on running scripts can be found in the CLI/Scripts documentation.

On your production server, you'll want to run this script once daily, so consider setting up a cron job (opens new window) to run shortly after midnight to roll up the previous day's values.

# User List Page

The user list page lives at /app/admin/users, and displays a list of users currently signed up to you app. The fields that are displayed in this table are controlled by the config setting userListFields in config/admin.js. To add a new field to this list, ensure that your UserModel has the new field you desire loaded in it, then extend your config to app/config/admin.js and edit userListFields to include the new model's field.

For further customization, the User List Page lives at features/admin/ui/pages/UserListPage.vue and the controller at features/admin/api/controllers/AdminUsersController.js.

# Team List Page

If you have enabled the Teams feature, you will find the team list page at /app/admin/teams, which displays a list of teams currently signed up to your app. The fields that are displayed in this table are controlled by the config setting teamListFields in config/admin.js. To add a new field to this list, ensure that your TeamModel has the new field you desire loaded in it, then extend your config to app/config/admin.js and edit teamListFields to include the new model's field.

For further customization, the Team List Page lives at features/admin/ui/pages/TeamListPage.vue and the controller at features/admin/api/controllers/AdminTeamsController.js.