Ad Management System implements a three-role RBAC (Role-Based Access Control) model. Every user account carries a single immutableDocumentation 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.
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.Sidebar Navigation Per Role
Each role renders a distinct set of sidebar menu items drawn fromlib/menu.ts.
Advertiser Menu
| Menu Item | Description |
|---|---|
| Dashboard | Overview of campaign performance and activity |
| Create | Launch a new ad campaign |
| Campaigns | List and manage existing campaigns |
| Analytics | Detailed performance metrics |
| Media Library | Upload and organise creative assets |
Creator Menu
| Menu Item | Description |
|---|---|
| Dashboard | Personal overview and activity summary |
| Profile | Manage public creator profile |
| Campaigns | Browse and join available campaigns |
| Analytics | View engagement and performance data |
| Media Library | Access campaign media assets |
Admin Menu
| Menu Item | Description |
|---|---|
| Dashboard | Platform-wide overview and key metrics |
| Users | View and manage all registered accounts |
| Manage | Campaign and content moderation tools |
| System Settings | Platform configuration and preferences |
| Finances | Revenue, billing, and financial reporting |
Route Guard Pattern
Every protected portal wraps its content in anAuthGuard 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
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.