Registering an account creates a new user document in MongoDB and immediately signs you in. During registration you choose one of three roles —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.
admin, advertiser, or creator — which determines which dashboard you are routed to and which features you can access for the entire lifetime of that account.
Registration Form Fields
The registration form collects four pieces of information:| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Your display name shown across the platform |
email | string | Yes | Must be unique — duplicate emails are rejected |
password | string | Yes | Your account password |
role | string | Yes | admin, advertiser, or creator |
How to Register
Open the registration page
Navigate to
http://localhost:3000/register (see REGISTER_ROUTE = "/register").Select your role
Choose a role from the dropdown:
- Admin — full platform management access
- Advertiser — campaign creation and analytics
- Content Creator — campaign browsing and profile management
Submit the form
Click Sign In. The app calls
useUser().register(), which POSTs your details to /api/register.API Request
The registration form triggers the following fetch call insideuseUser.register():
hooks/useUser.tsx
Successful Response
On successful account creation the API returns HTTP 200 with the new user object:Error Responses
| Status | Cause | Message |
|---|---|---|
400 | Email already registered | Email is already in use |
500 | Database or server error | Internal server error |
400 is returned, try signing in with the existing account instead, or use a different email address.