This guide walks you through everything needed to run the Ad Management System on your local machine. By the end you will have a fully working Next.js dev server connected to MongoDB, and you will be able to register accounts for all three roles — Admin, Advertiser, and Creator — and explore their respective dashboards.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.
Prerequisites
Before you begin, make sure the following are available on your machine:
- Node.js 18 or higher — the project targets Next.js 14, which requires Node 18+. Run
node -vto check your version. - npm — bundled with Node.js. Run
npm -vto verify. - MongoDB — either a free MongoDB Atlas cluster (recommended) or a locally running MongoDB instance. You will need a connection URI in the next steps.
Clone the Repository and Install Dependencies
Clone the repository from GitHub and install all npm dependencies:The install step pulls in Next.js 14, Mongoose, Zustand, ApexCharts, EdgeStore, Sonner, Zod, shadcn/ui, and all other dependencies listed in
package.json.Configure Environment Variables
The application requires a Replace
.env.local file at the project root for database connectivity. Create the file and populate it with the following variable:.env.local
<username> and <password> with your MongoDB Atlas credentials, or swap the URI for your local MongoDB connection string (e.g. mongodb://localhost:27017/ad-management). This variable is read by lib/mongodb.js to open the Mongoose connection.Start the Development Server
Run the Next.js development server:Next.js will compile the application and start listening on port 3000. You should see output similar to:
Open the App and Register an Account
Open http://localhost:3000 in your browser. You will land on the login page.Navigate to http://localhost:3000/register to create your first account. The registration form asks for your name, email, password, and role — choose one of:
admin— access the Admin panel (user management, system settings, finances)advertiser— access the Advertiser dashboard (campaigns, analytics, media)creator— access the Creator dashboard (profile, campaigns, analytics, earnings)
Available Routes
Once the server is running, the following routes are available:| Route | Description |
|---|---|
/ | Login page — entry point for all users |
/register | Registration page with role selection (admin, advertiser, creator) |
/advertiser | Advertiser dashboard: overview, create campaign, campaigns list, analytics, media library |
/creator | Creator dashboard: overview, profile, campaigns, analytics, media library |
/admin | Admin panel: dashboard, users, manage, system settings, finances |
/advertiser, /creator, and /admin are role-guarded. Attempting to access a portal without the matching role will redirect you back to the login page.
Zustand stores are held entirely in JavaScript memory and are not persisted to
localStorage or cookies. This means all authentication state — including the logged-in user’s name, email, and role — resets when the page is fully reloaded. After a hard refresh you will need to log in again via the / login page. This is expected behavior in the current implementation; see the Architecture page for details on adding persistent session handling.