UniFi Organization Manager
Figma link: https://www.figma.com/design/TzTMQrLhOy2ryCQLP3GyRN/ORG-Manager?node-id=0-1&p=f&m=dev
š Documentation
For comprehensive documentation, see the llm-docs/ directory:
Prerequisites
- Node.js: v20.19.5 (see
.nvmrc)
- pnpm: v9.x
Development Workflow
IMPORTANT: This project is developed as a library that integrates into the UniFi Portal. Standalone development commands like pnpm dev-cloud-prd, pnpm dev-cloud-stg, and pnpm dev are DEPRECATED.
Setup and Run
1. In This Repository (Org Manager)
pnpm install
pnpm dev-lib
2. In UniFi Portal Repository
pnpm link /path/to/unifi.hw.org-mgr
pnpm dev-cloud
UniFi Portal's build config automatically detects the linked package and configures the build to resolve org-mgr's externals from Portal's node_modules.
Development Flow
Terminal 1 (Org Manager) Terminal 2 (UniFi Portal)
āā pnpm dev-lib (watch) āā pnpm dev-cloud
āā Auto-rebuild on changes āā>āā Triggers page reload
Note: Since org-mgr outputs a single bundled JS file, changes trigger a full page reload rather than true hot module replacement.
Unlinking
When done with local development:
pnpm unlink @ubnt/unifi-credential-server
pnpm install
Authentication Setup
The application requires SSO authentication when running in UniFi Portal.
-
Login to UniFi Portal:
-
Extract Cookie:
- Open DevTools ā Application ā Cookies
- Find
UBIC_AUTH (production) or STG_UBIC_AUTH (staging)
- Copy the cookie value
-
Add to Localhost:
- Navigate to UniFi Portal's localhost URL
- Open DevTools ā Application ā Cookies
- Add the cookie with the copied value
Multi-Organization Support
If your account has multiple organizations:
Note: The organization ID must exist in your account's organization list.
Remote Access Debugging
Display API Requests in Network Tab
Enter in browser console and refresh:
setSwTrafficLoggerTTL(1000 * 60 * 60 * 24);
View API Logs in Console
If network logging doesn't work, use console logging:
openIdentityHubLog(24);
API responses will print in the browser console.
Additional Information
Static HTML Development
For static HTML page development, see Static HTML README
Comprehensive Documentation
For detailed information about architecture, coding standards, troubleshooting, and more:
Available Scripts
pnpm dev-lib
pnpm build-lib
pnpm build
pnpm build-local
pnpm analyze
pnpm eslint --fix
pnpm prettier --write .
Technology Stack
- React: 18.3.1
- TypeScript: 5.6.2
- Node: v20.19.5 (see
.nvmrc)
- State Management: Redux + React Query
- Styling: Emotion CSS-in-JS
- Build: Webpack 5
For complete technology stack details, see Architecture Documentation