Admin Panel Setup — Aquilia Documentation
Comprehensive guide and documentation for Admin Panel Setup in the Aquilia framework. View API reference, examples, and implementation patterns.
import from 'lucide-react' Admin Panel Setup aquilia.admin • Enterprise Operational Control Center Aquilia comes with a built-in admin dashboard (AquilAdmin) that provides real-time control, live monitoring, and configuration analysis. This system is compiled ahead-of-time, uses sandboxed Jinja templates, and secures operations with Argon2id hashing and built-in rate-limiting guards. Operational Modules ORM & Migrations Browse and edit model data, run, verify, or rollback database migrations in real time, and inspect queries using the typed SQL planner. System & Docker Monitor CPU, memory, disk usage, python runtime statistics, and interact directly with Docker containers and Kubernetes Pods. Security & Audit Manage superuser and staff roles, inspect secure audit trails, provision custom API keys, and enforce progressive account lockout rules. Automated Setup The quickest way to configure the admin dashboard is by executing the automated CLI setup command. It scans your environment, configures sessions, database pools, and template registries automatically. 1. Imports & Integrations Check The CLI injects the necessary classes ( AdminIntegration , SessionPolicy, etc.) and sets up security modules in workspace.py. 2. Sessions Configuration Enables secure cookie transport protocols, custom timeouts, and absolute token rotations for admin session persistence. 3. Schema Initialization Generates the required database tables automatically for users, groups, permissions, audit trails, and active sessions. 4. Superuser Creation Prompts you interactively to create your initial superuser credentials. Staff accounts can be added later. CLI Command Reference The aq admin CLI toolchain provides diagnostics, security administration, user account management, and operational commands. aq admin setup Automatically configures workspace.py with default dependencies, runs database table checks/migrations, and configures the initial superuser. Flags & Options -y, --non-interactive Bypasses confirmation queries and proceeds with default updates. --database-url TEXT Connection URL override written directly to the database integration builder. aq admin check Runs pre-flight validation on admin dashboard dependencies. Confirms integrations, cookie policies, database migrations, asset directories, and container configurations. Flags & Options --fix Attempts to dynamically uncomment disabled session lines inside workspace.py. --json Outputs test results as structured JSON metadata, suitable for CI pipelines. aq admin createsuperuser Creates a superuser (role: superadmin) inside the database. Superusers possess full administrative rights over modules, custom permissions, settings, and user groups. Flags & Options --username TEXT Operator login username (minimum 2 characters, unique). --email TEXT Operations email address (unique, validated format). --password TEXT Secure credential string. Prompted interactively if omitted. Enforces standard complexity. --first-name TEXT Optional first name metadata. --last-name TEXT Optional last name metadata. aq admin createstaff Creates a staff user (role: staff). Staff operators have access to the dashboard but cannot manage system permissions, view audit logs, or edit other administrator users. Flags & Options --username TEXT Staff operator login username. --email TEXT Staff operations email address. --password TEXT Secure password. Prompted interactively if omitted. --first-name TEXT Optional first name metadata. --last-name TEXT Optional last name metadata. aq admin listusers Queries the aq_admin_users table to list registered accounts. Shows ID, username, email, active status, user role, and join date. Flags & Options --active-only Filters out accounts that have been deactivated. --json Serializes user objects into a raw JSON list. --database-url TEXT Connection string override. aq admin changepassword Securely updates the login password for the specified user after checking standard complexity policies. Flags & Options USERNAME Target account username. --password TEXT New password. Prompted and masked if omitted. --database-url TEXT Connection string override. aq admin status Outputs the dashboard registration state. Inspects models registered via autodiscover(), showing their class representations and list fields. aq admin audit Queries administrative audit records. Returns chronological logs showing execution timestamps, activity types (logins, data modifications), target models, and operator usernames. Flags & Options --limit INTEGER Maximum entries to return (default is 50). --action TEXT Action filter (e.g. login, create, update, delete, settings_change). --user TEXT Username filter. Password Policy Enforcement All user passwords created via CLI or the admin controller are validated against strict strength checks. A password will be rejected unless it satisfies all of the following rules: Casing & Length Must be at least 8 characters and contain both uppercase and lowercase characters. Digits & Special Symbols Must contain at least one numerical digit and at least one special symbol (e.g., !@#$%^&*()). Workspace Configuration To configure the admin integration manually, register the AdminIntegration class in your root workspace.py: Fluent Integrations API The aquilia.integrations.admin package provides builder interfaces to dynamically configure system panels. AdminModules Toggles administrative modules. Supports both standard dataclass overrides and method-based fluent configurations. Fluent Methods .enable_all() Activates absolutely all modules. .disable_all() Deactivates all optional modules. .enable_orm() / .disable_orm() Toggles database entry browsers. .enable_migrations() / .disable_migrations() Toggles visual migration controllers. .enable_monitoring() / .disable_monitoring() Toggles resource monitor pages. .enable_containers() / .disable_containers() Toggles the Docker panel. .enable_pods() / .disable_pods() Toggles the Kubernetes monitoring dashboard. .enable_tasks() / .disable_tasks() Toggles background cron schedulers. .enable_audit() / .disable_audit() Toggles the administrative action timeline. .enable_api_keys() / .disable_api_keys() Toggles developer API key creation. .with_(**overrides: bool) Returns a copy with overridden key states. AdminSecurity Manages brute-force protection, lockout increments, password security thresholds, and security headers. Fluent Methods .strict_password_policy() Restricts passwords to a minimum length of 12 and requires special symbols, numbers, and case mixes. .relaxed_password_policy() Lowers password minimum length requirement to 8 characters and disables symbols complexity tests. .csrf_enabled_set(enabled: bool) Configures session validation tokens. .no_csrf() Disables active Cross-Site Request Forgery tokens. .no_rate_limit() Disables brute force lockout parameters. .no_security_headers() Disables frame embedding block headers. AdminAudit Controls audit log preservation limits and details what categories of actions are archived. Fluent Methods .enable() / .disable() Toggles audit logs collection. .set_max_entries(n: int) Limits the audit log database count (FIFO eviction kicks in when exceeded, minimum value is 100). .log_logins_set(enabled: bool) Toggles archiving user login attempts. .log_views_set(enabled: bool) Toggles logging admin browser panel loads. .log_searches_set(enabled: bool) Toggles archiving query search details. .exclude_actions(*actions: str) Excludes specific actions (e.g. view, search) from being archived. AdminMonitoring Configures system performance metrics collection parameters. Fluent Methods .enable() / .disable() Toggles resource metric charts page. .all_metrics() Includes cpu, memory, disk, network, process, python, system, and health checks. .metrics_set(*names: str) Selects a subset of system metrics to track. .refresh_interval_set(seconds: int) Sets the interval to query system utilization metrics (minimum value is 5 seconds). AdminSidebar Allows show/hide configuration of menu groups inside the admin dashboard side navigation panel. Fluent Methods .show_all() / .hide_all() Toggles visibility for all navigation categories. .show_overview() / .hide_overview() Toggles the main landing page menu. .show_data() / .hide_data() Toggles the ORM and database section. .show_system() / .hide_system() Toggles the performance charts section. .show_infrastructure() / .hide_infrastructure() Toggles Docker and Pods modules. .show_security() / .hide_security() Toggles accounts and permissions items. .show_devtools() / .hide_devtools() Toggles the settings and query analyzer categories. AdminContainers Controls Docker daemon communication parameters and restricts allowed container operations. Fluent Methods .docker_socket(path: str) Sets connection path to local daemon (e.g. /var/run/docker.sock). .read_only() Restricts interaction. Disables starting, stopping, building, pruning, exec shells, or deleting containers. AdminPods Governs Kubernetes operational modes, restricting pod deletions, context updates, and shell execution capabilities. Fluent Methods .all_namespaces() Instructs the client to fetch details across all active Kubernetes namespaces. .read_only() Disables container scaling, deployments, context switches, apply commands, and pod termination. Common Pitfalls ! Dashboard Assets Fail to Load Ensure that StaticFilesIntegration is registered in your workspace.py. Without static files, the browser cannot download CSS and JS bundles. ! CSRF Validation Errors on Login If running locally without HTTPS, make sure cookie_secure=False is set inside your TransportPolicy. Otherwise, cookies will not be sent back to local endpoints. ! Docker or Pods Panels Grayed Out These panels are disabled if docker or kubectl CLI binaries are missing from your system PATH. Ensure Docker is running and Kubeconfig context is set. )
Go to Homepage