platform-knowledge

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Platform Knowledge Skill

平台知识技能

Overview

概述

This skill provides comprehensive knowledge of the infrastructure platforms: GitHub Actions, Railway, Supabase, and Postgres. It covers architecture, configuration, troubleshooting, and best practices for each platform.
本技能提供GitHub Actions、Railway、Supabase和Postgres这些基础设施平台的全面知识,涵盖每个平台的架构、配置、故障排查及最佳实践。

Platform Overview

平台概览

GitHub Actions

GitHub Actions

  • Purpose: CI/CD automation
  • Key Features: Workflow automation, testing, deployment
  • Config Files:
    .github/workflows/*.yml
  • CLI:
    gh
  • 用途:CI/CD自动化
  • 核心特性:工作流自动化、测试、部署
  • 配置文件
    .github/workflows/*.yml
  • 命令行工具
    gh

Railway

Railway

  • Purpose: Application hosting and deployment
  • Key Features: Auto-deployments, instant rollbacks, environment management
  • Config Files:
    railway.toml
    ,
    nixpacks.toml
    ,
    Procfile
  • CLI:
    railway
  • 用途:应用托管与部署
  • 核心特性:自动部署、即时回滚、环境管理
  • 配置文件
    railway.toml
    ,
    nixpacks.toml
    ,
    Procfile
  • 命令行工具
    railway

Supabase

Supabase

  • Purpose: Backend-as-a-Service (Postgres, Auth, Storage, Realtime)
  • Key Features: Managed Postgres, authentication, file storage, realtime subscriptions
  • Config Files:
    supabase/config.toml
    , migrations
  • Access: MCP tools, Dashboard, CLI
  • 用途:后端即服务(包含Postgres、身份验证、存储、实时功能)
  • 核心特性:托管式Postgres、身份验证、文件存储、实时订阅
  • 配置文件
    supabase/config.toml
    、迁移文件
  • 访问方式:MCP工具、控制台、命令行工具

Postgres

Postgres

  • Purpose: Relational database
  • Key Features: ACID compliance, extensions, full-text search, JSON support
  • Config: Connection strings, postgresql.conf
  • Access: SQL queries via MCP or psql
  • 用途:关系型数据库
  • 核心特性:ACID合规、扩展功能、全文搜索、JSON支持
  • 配置项:连接字符串、postgresql.conf
  • 访问方式:通过MCP或psql执行SQL查询

Platform Interaction Map

平台交互图

┌──────────────┐     ┌──────────────┐
│   GitHub     │     │   Railway    │
│   Actions    │────▶│   (App)      │
│   (CI/CD)    │     │              │
└──────────────┘     └──────┬───────┘
                     ┌──────────────┐
                     │   Supabase   │
                     │   (Backend)  │
                     │              │
                     │ ┌──────────┐ │
                     │ │ Postgres │ │
                     │ └──────────┘ │
                     └──────────────┘
┌──────────────┐     ┌──────────────┐
│   GitHub     │     │   Railway    │
│   Actions    │────▶│   (App)      │
│   (CI/CD)    │     │              │
└──────────────┘     └──────┬───────┘
                     ┌──────────────┐
                     │   Supabase   │
                     │   (Backend)  │
                     │              │
                     │ ┌──────────┐ │
                     │ │ Postgres │ │
                     │ └──────────┘ │
                     └──────────────┘

Quick Reference

快速参考

Tool Access by Platform

各平台工具访问方式

PlatformMCP ToolsCLILogs
GitHub ActionsNo
gh
gh run view --log
RailwayNo
railway
railway logs
SupabaseYes
supabase
MCP
get_logs
PostgresYes (via Supabase)
psql
MCP
get_logs
平台MCP工具命令行工具日志
GitHub Actions
gh
gh run view --log
Railway
railway
railway logs
Supabase
supabase
MCP
get_logs
Postgres有(通过Supabase)
psql
MCP
get_logs

Common Operations

常见操作

TaskGitHubRailwaySupabase
DeployPush/workflowGit push /
railway up
Dashboard / CLI
Logs
gh run view --log
railway logs
MCP
get_logs
Status
gh run list
railway status
MCP
get_project
RollbackRe-run workflowDashboardRun migration down
SecretsRepository settingsEnvironment variablesProject settings
任务GitHub ActionsRailwaySupabase
部署推送/工作流Git推送 /
railway up
控制台 / 命令行工具
查看日志
gh run view --log
railway logs
MCP
get_logs
查看状态
gh run list
railway status
MCP
get_project
回滚重新运行工作流控制台执行回滚迁移
密钥管理仓库设置环境变量项目设置

Troubleshooting Decision Tree

故障排查决策树

Issue Reported
┌─────────────────────────────────────┐
│ Where does the issue manifest?      │
└─────────────────────────────────────┘
     ├─► Build/Deploy fails ──► GitHub Actions / Railway
     ├─► API errors ──► Supabase API / Edge Functions
     ├─► Auth issues ──► Supabase Auth
     ├─► Database errors ──► Postgres
     ├─► App crashes ──► Railway / Edge Functions
     └─► Performance ──► All platforms (profile each)
问题上报
┌─────────────────────────────────────┐
│ 问题出现在哪个环节?                  │
└─────────────────────────────────────┘
     ├─► 构建/部署失败 ──► GitHub Actions / Railway
     ├─► API错误 ──► Supabase API / 边缘函数
     ├─► 身份验证问题 ──► Supabase Auth
     ├─► 数据库错误 ──► Postgres
     ├─► 应用崩溃 ──► Railway / 边缘函数
     └─► 性能问题 ──► 所有平台(逐一分析)

Platform-Specific Guides

各平台详细指南

Detailed guides for each platform:
  • GitHub Actions - CI/CD workflows, secrets, debugging
  • Railway - Deployment, configuration, troubleshooting
  • Supabase - Auth, API, Realtime, Storage
  • Postgres - Queries, performance, administration
每个平台的详细指南:
  • GitHub Actions - CI/CD工作流、密钥、调试
  • Railway - 部署、配置、故障排查
  • Supabase - 身份验证、API、实时功能、存储
  • Postgres - 查询、性能优化、管理

Cross-Platform Issues

跨平台问题

Deployment Chain Failure

部署链故障

Symptom: Deploy succeeds but app broken
Check all stages:
  1. GitHub Actions - Build/test passed?
  2. Railway - Deploy successful?
  3. Supabase - Migrations applied?
  4. Environment - Variables set?
症状:部署成功但应用无法正常运行
检查所有环节
  1. GitHub Actions - 构建/测试是否通过?
  2. Railway - 部署是否成功?
  3. Supabase - 迁移是否已应用?
  4. 环境 - 变量是否已设置?

Environment Variable Issues

环境变量问题

Common causes:
  • Set in wrong environment
  • Typo in variable name
  • Not propagated after change
Verify across platforms:
bash
undefined
常见原因
  • 在错误环境中设置
  • 变量名称拼写错误
  • 修改后未同步
跨平台验证
bash
undefined

GitHub Actions - Check secrets

GitHub Actions - 检查密钥

(Can't view, only verify existence)

(无法查看,仅能验证是否存在)

Railway

Railway

railway variables
railway variables

Supabase - Check project settings

Supabase - 检查项目设置

Dashboard or MCP

控制台或MCP

undefined
undefined

Connection Issues Between Services

服务间连接问题

Railway → Supabase:
  • Check Supabase URL format
  • Verify API key (anon vs service_role)
  • Check connection pooling settings
  • Verify IP restrictions
GitHub Actions → Services:
  • Check secrets are accessible
  • Verify network egress allowed
  • Check for rate limiting
Railway → Supabase
  • 检查Supabase URL格式
  • 验证API密钥(anon vs service_role)
  • 检查连接池设置
  • 验证IP限制
GitHub Actions → 服务
  • 检查密钥是否可访问
  • 验证网络出口是否允许
  • 检查是否存在速率限制

Performance Troubleshooting Matrix

性能故障排查矩阵

SymptomGitHub ActionsRailwaySupabasePostgres
SlowCache missing, big depsCold start, resourcesEdge functionQuery optimization
TimeoutStep timeoutHealth checkAPI timeoutStatement timeout
MemoryOOM on buildContainer limitFunction limitwork_mem
CPUConcurrent jobsContainer limitN/AQuery complexity
症状GitHub ActionsRailwaySupabasePostgres
运行缓慢缓存缺失、依赖包过大冷启动、资源限制边缘函数查询优化
超时步骤超时健康检查API超时语句超时
内存问题构建时内存溢出容器资源限制函数资源限制work_mem配置
CPU问题并发作业容器资源限制查询复杂度

Configuration Files Reference

配置文件参考

GitHub Actions

GitHub Actions

yaml
undefined
yaml
undefined

.github/workflows/deploy.yml

.github/workflows/deploy.yml

name: Deploy on: [push] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # ... more steps
undefined
name: Deploy on: [push] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # ... 更多步骤
undefined

Railway

Railway

toml
undefined
toml
undefined

railway.toml

railway.toml

[build] builder = "nixpacks" buildCommand = "npm run build"
[deploy] startCommand = "npm start" healthcheckPath = "/health"
undefined
[build] builder = "nixpacks" buildCommand = "npm run build"
[deploy] startCommand = "npm start" healthcheckPath = "/health"
undefined

Supabase

Supabase

toml
undefined
toml
undefined

supabase/config.toml

supabase/config.toml

[api] port = 54321 schemas = ["public", "graphql_public"]
[db] port = 54322
undefined
[api] port = 54321 schemas = ["public", "graphql_public"]
[db] port = 54322
undefined

Postgres

Postgres

sql
-- Key settings
SHOW max_connections;
SHOW statement_timeout;
SHOW work_mem;
sql
-- 关键配置
SHOW max_connections;
SHOW statement_timeout;
SHOW work_mem;