Select Admin Documentation
website·Indexed 32 days ago
https://dev.selectfromuser.comA tool for quickly building admin pages based on databases and APIs using YAML configurations. It supports connections to MySQL, PostgreSQL, Redis, MongoDB, DynamoDB, and BigQuery, and provides features for user property management, custom layouts, API security, and self-hosted CLI installation.
What's inside Select Admin
- Select is a tool used to build admin, back-office, and management pages using SQL queries and API inputs. It eliminates the need for manual frontend development, API creation, and deployment for internal tools. Key capabilities include sharing SQL results as pages, providing no-code Excel downloads, creating safe UI wrappers for update queries, and building dashboards or reports without installation.
Overview of Select Admin Design Philosophy
Select Admin reduces the cost of developing and maintaining administrative tools by replacing traditional coding (server frameworks, ORM, UI templates) with a specification-based configuration. Key design principles include:
- Built-in core admin components configured via specs.
- Separation of concerns (e.g., by menu or page).
- Direct data manipulation using raw SQL, APIs, or JavaScript without abstraction layers.
- Built-in management for connections, authentication, and drivers.
- Universal UI components (tables, input forms) that are easily replicable, integrable, or splittable.
- High readability and maintainability by defining the admin structure as a spec rather than code.
Overview of Select Admin Audit Logs
Select Admin records and allows the retrieval of logs related to user access, account changes, and permission grants.
Access Logs: Records successful logins and failed login attempts, including instances where the device has changed.
Role access: User accessRole access denied: User access denied
Permission Logs: These can be enabled under
Settings > Securityby activating the 'Reason for Granting Permission' feature. Common event codes include:Role create: New user invitation (permission added)Role update: User permission changeRole delete: User permission deletiongroup grant: User permission group addedgroup revoke: User permission group deletedServiceRole update: Admin page service permission changeproperty update: UserProperty change
Download Logs: Enabled under
Settings > Securityby activating the 'Reason for Download' feature.Activity download: User activity log downloadAudit download: Audit log download
Overview of JavaScript Data Transformation Lifecycle
JavaScript transformation functions allow developers to implement validation logic or convert common codes before data is displayed or modified in the admin. The execution flow follows this sequence:
- Request Transformation:
requestFn$\rightarrow$requestSubmitFn$\rightarrow$requestParamFn - Server Execution: Query/API is executed on the server.
- Response Transformation:
responseFn$\rightarrow$responseRowFn$\rightarrow$responseErrorFn - Display: The final result is displayed to the user.
- Request Transformation:
Understand Menus and Pages in Select
Select distinguishes between two primary concepts: Menus and Pages. Menus define the navigation structure, supporting top-level and sub-menu hierarchies through grouping. Pages are composed of blocks and are linked to menus via a sharedpath.Understand User Properties in Select Admin
User Properties allow for specialized handling of users within Select Admin. They can be used to restrict data access (e.g., viewing only data belonging to a specific department), require specific codes when adding data, or filter data to show only a user's own store information. Administrator accounts can have these properties manually configured underSettings > Account.Connect a database or resource to Select
To connect a database (such as MySQL, PostgreSQL, or Redis) to the Select service for building admin pages, navigate to the Admin page and follow these steps:
- Go to the 'Resources' (리소스) menu at the top of the Admin page.
- Click the '+ Add' (+ 추가) button in the connected data section.
- Enter the required connection information.
Note: For security reasons, connection information cannot be viewed or modified once it has been added.
Use HTML within Markdown blocks
Markdown blocks support the use of HTML tags for advanced styling or layout requirements. You can use standard HTML elements and CSS classes within thecontentfield.- type: markdown content: | <p class="text-slate-600 font-bold text-2xl">Receipt Store List Page</p> <ul class="text-slate-400 font-bold text-xs"> <li>Past data can be viewed on the <a href='#'>Transaction History</a> page.</li> </ul>Implement mandatory and optional search conditions in SQL
Select uses Bind Parameters/Prepared Statements by default for security. Depending on whether a search parameter is required or optional, use the following patterns:
- Mandatory: The query will return no results if the parameter is empty.
- Optional (MySQL): Use
CASE-WHENor a logicalORwithLENGTH()to ignore the condition when the parameter is empty. - Optional (PostgreSQL): Use
LENGTH(:param) = 0to ignore the condition when the parameter is empty.
-- Mandatory SELECT * FROM users WHERE name = :name -- Optional (MySQL) SELECT * FROM users WHERE status = 'active' AND (!LENGTH(:name) OR name = :name) -- Optional (PostgreSQL) SELECT * FROM users WHERE status = 'active' AND (LENGTH(:name) = 0 OR name = :name)Configure user properties via UI
User properties (key-value pairs) can be assigned to specific users through the administrative interface. These properties can then be used as variables in SQL query blocks or API blocks to restrict or filter information based on the user's identity (e.g., for B2B client portals or partner centers). To configure: Navigate to Settings > Account > Account List and click on the email address of the target user to define the property keys and values.Perform API modifications and deletions using HTTP POST
To perform modifications or deletions via API, use thehttpblock type withmethod: POST. When configured this way, the system operates in a 'Confirm before execution' mode to prevent accidental data changes.menus: - path: test/http-post name: HTTP-POST pages: - path: test/http-post blocks: - type: http name: POST Sample axios: method: POST url: https://httpbin.org/anything?query=1 data: 'customer_id': customer-{{id}} 'v': "{{API_VERSION}}" params: - key: id label: 'Customer ID' format: 'number' - key: API_VERSION valueFromEnv: trueImplement customer search with parameters
To find a specific customer using a field like email, use theparamsproperty. This allows the UI to pass user input into the SQL query or HTTP request. For partial matches in SQL, use a combination ofLENGTHandLIKEwith theCONTACTfunction to handle empty inputs and wildcards.# SQL Example for partial email search sql: > SELECT * FROM users WHERE (LENGTH(:email) = 0 OR email LIKE CONTACT('%', :email, '%')) params: - key: email # HTTP Example for email search axios: method: GET url: https://api.example.com/v1/users?email={{email}}&limit=10 rowsPath: rows params: - key: email