Skip to main content

API Constants

API_VERSION

Current API version number.
string
Value: "v1"

API_BASE_URL

Base URL for API endpoints.
string
Value: process.env.NEXT_PUBLIC_API_URL || "https://api.example.com"

API_TIMEOUT

Default timeout for API requests in milliseconds.
number
Value: 30000 (30 seconds)

HTTP_STATUS

HTTP status code constants.
object

Example


Authentication Constants

AUTH_TOKEN_KEY

LocalStorage key for authentication token.
string
Value: "auth_token"

REFRESH_TOKEN_KEY

LocalStorage key for refresh token.
string
Value: "refresh_token"

TOKEN_EXPIRY_KEY

LocalStorage key for token expiry timestamp.
string
Value: "token_expiry"

SESSION_TIMEOUT

Session timeout duration in milliseconds.
number
Value: 3600000 (1 hour)

REFRESH_THRESHOLD

Time before expiry to refresh token (milliseconds).
number
Value: 300000 (5 minutes)

Route Constants

ROUTES

Application route paths.
object

Example


UI Constants

BREAKPOINTS

Responsive design breakpoints in pixels.
object

THEME_COLORS

Application color palette.
object

Z_INDEX

Z-index layering constants.
object

Example


Validation Constants

VALIDATION_RULES

Common validation rules and limits.
object

REGEX_PATTERNS

Common regular expression patterns.
object

Example


Pagination Constants

DEFAULT_PAGE_SIZE

Default number of items per page.
number
Value: 20

MAX_PAGE_SIZE

Maximum allowed items per page.
number
Value: 100

PAGE_SIZE_OPTIONS

Available page size options for user selection.
number[]
Value: [10, 20, 50, 100]

File Upload Constants

MAX_FILE_SIZE

Maximum file upload size in bytes.
number
Value: 5242880 (5 MB)

ALLOWED_FILE_TYPES

Allowed file MIME types for upload.
object

Example


Date & Time Constants

DATE_FORMATS

Common date format strings.
object

TIME_ZONES

Common time zone identifiers.
object

Error Messages

ERROR_MESSAGES

Standardized error messages.
object

Example