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.

The System Settings panel at /admin/settings is the planned interface for managing platform-wide configuration on the Ad Management System. In its current state the route renders a placeholder. All active system configuration is handled through environment variables and the next.config.mjs file directly.

Route

/admin/settings

Current Implementation

The page component currently renders a single placeholder element:
const Settings = () => {
  return <div>Settings</div>;
};
export default Settings;
The Settings UI is planned for a future iteration.

Environment Variables

The platform uses a custom session approach via the useUser Zustand store and a MongoDB-backed API — it does not use NextAuth.js. The only confirmed environment variable referenced in the source code is:
VariableRequiredDescription
MONGO_URIYesMongoDB connection string used by lib/mongodb.js to connect via Mongoose
Set this variable in .env.local for local development:
MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/ad-management
In production, set MONGO_URI as a secret in your deployment platform (e.g. Vercel, Railway, or Render) rather than committing it to source control.

API CORS Configuration

The next.config.mjs file configures CORS response headers for all API routes under /api/:path*. This allows API routes to be called cross-origin during development and from external clients:
// next.config.mjs
const nextConfig = {
  async headers() {
    return [
      {
        source: "/api/:path*",
        headers: [
          { key: "Access-Control-Allow-Credentials", value: "true" },
          { key: "Access-Control-Allow-Origin", value: "*" },
          {
            key: "Access-Control-Allow-Methods",
            value: "GET,DELETE,PATCH,POST,PUT",
          },
          {
            key: "Access-Control-Allow-Headers",
            value:
              "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version",
          },
        ],
      },
    ];
  },
};

export default nextConfig;
The Access-Control-Allow-Origin header is currently set to "*", which permits any origin to call your API routes. Before deploying to production, replace the wildcard with your actual application origin (e.g. https://admanagement.example.com) to prevent unauthorized cross-origin access.
The Settings page (/admin/settings) currently renders a placeholder. Platform configuration is managed via MONGO_URI in your environment and through next.config.mjs until the settings UI is built out.

Build docs developers (and LLMs) love