Arcadia Platform

website·Indexed 30 days ago

https://arcadia-panel.netlify.app/

A TypeScript-based full-stack platform designed for script language programming and operations. It features scheduled task orchestration (Cron), a comprehensive file system, CLI command design, and a control panel for environment configuration, dependency management, and process monitoring. Supports container-based deployment and provides an API for system configuration, task management, and real-time log retrieval.

Tokens
31.5K
Snippets
204
Records
275
Agent score
75%

What's inside Arcadia

  1. Overview of the Arcadia Platform

    Arcadia is a platform designed for script language programming and operations (DevOps). It is suitable for individuals and small-to-medium teams, providing features such as scheduled task execution, a comprehensive file system, and a low-level CLI command design. The platform is built using a TypeScript full-stack architecture with Vue and Vite on the frontend, and Node.js, Express, and Prisma ORM on the backend.
  2. Understand the Environment Variable Data Model

    The system manages environment variables using two database tables: envs and envsGroup.

    • envs table: Stores all individual variable values. This includes both 'simple' variables and the individual members of 'composite' (grouped) variables. If the group_id is 0, the record is treated as a simple variable.
    • envsGroup table: Stores the definitions for composite variables (groups).

    Relationship: The envs table links to the envsGroup table via the group_id field, which references the id of the envsGroup table.

    model envs {
      id          Int         @id @default(autoincrement())
      group_id    Int
      type        String
      tag_list    String      @default("")
      description String      @default("")
      remark      String      @default("")
      value       String      @default("")
      sort        Int         @default(0)
      enable      Int         @default(1)
      envs_group  envs_group? @relation(fields: [group_id], references: [id])
    
      @@index([type])
    }
    
    model envsGroup {
      id          Int    @id @default(autoincrement())
      type        String
      description String @default("")
      tag_list    String @default("")
      separator   String @default("")
      sort        Int    @default(0)
      enable      Int    @default(1)
      envs        envs[]
    
      @@index([type])
    }
  3. Access and initial login for the Control Panel

    The Control Panel is accessible by default at http://localhost:5678. If the host mapping port was changed during setup, use the corresponding port instead. The default initial credentials are:

    • Username: useradmin
    • Password: passwd

    Users are advised to change these authentication details immediately after the first login following the on-screen prompts.

  4. Retrieve message details via /message/detail

    Use the GET /message/detail endpoint to fetch detailed information about a specific message. The request requires a unique identifier (id) to locate the message.
    GET /message/detail?id={message_id}
  5. Manage global environment variables with arcadia envm

    The arcadia envm command allows developers to manage global environment variables declared using the export keyword in user configuration files (non-database). This configuration is used by the control panel's code execution functionality. If a variable value or remark contains spaces or special characters, it must be enclosed in quotes.
    arcadia envm <args> [...]
  6. Understand the OpenAPI token permission model

    OpenAPI tokens use a fine-grained resource:action permission model. Permissions are specified as a comma-separated string (e.g., cron:query,env:query,env:manage). When a request is made to an API route, the system validates if the token possesses the required permission key for that specific route.
  7. Manage OpenAPI access credentials using Tokens

    Use the Token management interface to create and manage OpenAPI access credentials. Each token can be independently assigned a set of fine-grained permissions, ensuring that the token can only access interfaces within its authorized scope.
  8. Configure Git repositories for script extensions

    Arcadia allows extending local scripts by cloning Git repositories into the /arcadia/repo directory. To apply changes after updating the configuration, run the command arcadia update repo.
    arcadia update repo
  9. Manage scheduled tasks in Arcadia

    Arcadia provides a dedicated frontend management page for scheduled tasks, divided into two categories:

    1. System Tasks: Automatically managed based on the sync.yaml configuration. These tasks are dynamically added or removed when running the arcadia update command.

      • Scheduling Rules: The platform attempts to extract scheduling rules from comments within the code files. If no valid rule is found or a syntax error occurs, a default rule (executing once per day) is generated. These can be modified manually via the control panel.
      • Execution: System tasks are executed using the command arcadia run xxx without additional options.
      • Persistence: Tasks are not duplicated, but in specific scenarios (such as environment migration or repository re-cloning), new scheduled tasks will overwrite existing ones.
    2. Personal Tasks: User-defined custom tasks managed via the control panel.

    # Update code synchronization configuration and refresh system tasks
    arcadia update
  10. Install tsx (TypeScript Execute)

    tsx is a fast TypeScript execution CLI driven by esbuild. It can be installed globally using various package managers.
    # Using npm
    npm install -g tsx
    
    # Using pnpm
    pnpm add -g tsx
    
    # Using yarn
    yarn global add tsx
    
    # Using bun
    bun add --global tsx
  11. Update Arcadia source code

    For minor version upgrades, you can update the source code directly using the arcadia upgrade command. If you encounter GitHub connectivity issues, you can switch the remote origin to a proxy mirror before running the upgrade.
    # Standard upgrade
    arcadia upgrade
    
    # If GitHub is unreachable, use a proxy mirror first:
    cd /arcadia/src
    git remote set-url origin https://ghfast.top/https://github.com/SuperManito/Arcadia.git
    cd /arcadia
    arcadia upgrade