Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Priyanshu471/ad-management/llms.txt

Use this file to discover all available pages before exploring further.

Ad Management System implements a three-role RBAC (Role-Based Access Control) model. Every user account carries a single immutable role field — admin, advertiser, or creator — set at registration. The role controls which dashboard route the user is redirected to after login and which sidebar navigation items are rendered. Each portal’s layout is independently protected by an AuthGuard component so that unauthenticated visitors are always bounced back to the login page at /.

Role Comparison

Admin

Route: /adminFull platform management access. Admins oversee all user accounts, configure system settings, monitor platform finances, and have visibility into all active campaigns across every advertiser.

Advertiser

Route: /advertiserCampaign-focused access. Advertisers create and manage their own ad campaigns, review performance analytics, and organise creative assets in the Media Library.

Content Creator

Route: /creatorCreator-focused access. Creators browse available campaigns to participate in, manage their public profile, view their analytics, and access the Media Library.
Each role renders a distinct set of sidebar menu items drawn from lib/menu.ts.

Advertiser Menu

Menu ItemDescription
DashboardOverview of campaign performance and activity
CreateLaunch a new ad campaign
CampaignsList and manage existing campaigns
AnalyticsDetailed performance metrics
Media LibraryUpload and organise creative assets

Creator Menu

Menu ItemDescription
DashboardPersonal overview and activity summary
ProfileManage public creator profile
CampaignsBrowse and join available campaigns
AnalyticsView engagement and performance data
Media LibraryAccess campaign media assets

Admin Menu

Menu ItemDescription
DashboardPlatform-wide overview and key metrics
UsersView and manage all registered accounts
ManageCampaign and content moderation tools
System SettingsPlatform configuration and preferences
FinancesRevenue, billing, and financial reporting

Route Guard Pattern

Every protected portal wraps its content in an AuthGuard check inside the portal’s layout.tsx. The guard reads isLoggedIn from the useUser() Zustand store. If the user is not authenticated, it returns the <AuthGuard /> component. The AuthGuard component then renders a fallback screen displaying the attempted route and a Log In link, while its useEffect fires router.push("/") to redirect the visitor to the login page:
app/admin/layout.tsx
const { isLoggedIn } = useUser();
if (!isLoggedIn) return <AuthGuard />;
The same pattern is applied in app/advertiser/layout.tsx and app/creator/layout.tsx, ensuring that no portal page is reachable without a valid in-memory session — regardless of whether the user navigates directly via the URL bar.
To test all three dashboards locally, register three separate accounts — one for each role — during initial setup. Use distinct email addresses (e.g. admin@test.com, advertiser@test.com, creator@test.com) so you can switch between them quickly without re-registering.

Build docs developers (and LLMs) love