harper-best-practices
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHarper Best Practices
Harper 最佳实践
Guidelines for building scalable, secure, and performant applications on Harper. These practices cover everything from initial schema design to advanced deployment strategies.
本指南介绍如何在Harper上构建可扩展、安全且高性能的应用,涵盖从初始模式设计到高级部署策略的所有内容。
When to Apply
适用场景
Reference these guidelines when:
- Defining or modifying database schemas
- Implementing or extending REST/WebSocket APIs
- Handling authentication and session management
- Working with custom resources and extensions
- Optimizing data storage and retrieval (Blobs, Vector Indexing)
- Deploying applications to Harper Fabric
在以下场景中可参考本指南:
- 定义或修改数据库模式
- 实现或扩展REST/WebSocket API
- 处理身份验证和会话管理
- 使用自定义资源和扩展功能
- 优化数据存储与检索(Blobs、向量索引)
- 将应用部署到Harper Fabric
Rule Categories by Priority
按优先级划分的规则类别
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Schema & Data Design | HIGH | |
| 2 | API & Communication | HIGH | |
| 3 | Logic & Extension | MEDIUM | |
| 4 | Infrastructure & Ops | MEDIUM | |
| 优先级 | 类别 | 影响程度 | 前缀 |
|---|---|---|---|
| 1 | 模式与数据设计 | 高 | |
| 2 | API与通信 | 高 | |
| 3 | 逻辑与扩展 | 中 | |
| 4 | 基础设施与运维 | 中 | |
Quick Reference
快速参考
1. Schema & Data Design (HIGH)
1. 模式与数据设计(高优先级)
- - Define tables using GraphQL schemas and directives
adding-tables-with-schemas - - Link tables using the
defining-relationshipsdirective@relationship - - Efficient similarity search with vector indexes
vector-indexing - - Store and retrieve large data (Blobs)
using-blob-datatype - - Manage binary data like images or MP3s
handling-binary-data
- - 使用GraphQL模式和指令定义表
adding-tables-with-schemas - - 使用
defining-relationships指令关联表@relationship - - 借助向量索引实现高效相似性搜索
vector-indexing - - 存储和检索大型数据(Blobs)
using-blob-datatype - - 管理图片或MP3等二进制数据
handling-binary-data
2. API & Communication (HIGH)
2. API与通信(高优先级)
- - Leverage automatically generated CRUD endpoints
automatic-apis - - Filters, sorting, and pagination in REST requests
querying-rest-apis - - WebSockets and Pub/Sub for live data updates
real-time-apps - - Secure apps with session-based identity verification
checking-authentication
- - 利用自动生成的CRUD端点
automatic-apis - - REST请求中的过滤、排序和分页
querying-rest-apis - - 使用WebSocket和Pub/Sub实现实时数据更新
real-time-apps - - 基于会话的身份验证保障应用安全
checking-authentication
3. Logic & Extension (MEDIUM)
3. 逻辑与扩展(中优先级)
- - Define custom REST endpoints using JS/TS
custom-resources - - Add custom logic to generated table resources
extending-tables - - Advanced filtering and sorting in code
programmatic-table-requests - - Use TypeScript without build tools
typescript-type-stripping - - Implement and define caching for performance
caching
- - 使用JS/TS定义自定义REST端点
custom-resources - - 为生成的表资源添加自定义逻辑
extending-tables - - 代码中的高级过滤与排序
programmatic-table-requests - - 无需构建工具即可使用TypeScript
typescript-type-stripping - - 实现并定义缓存以提升性能
caching
4. Infrastructure & Ops (MEDIUM)
4. 基础设施与运维(中优先级)
- - Scale globally with Harper Fabric
deploying-to-harper-fabric - - Ways to serve web content from Harper
serving-web-content
- - 借助Harper Fabric实现全球扩展
deploying-to-harper-fabric - - 从Harper提供Web内容的方法
serving-web-content
How to Use
使用方法
Read individual rule files for detailed explanations and code examples:
rules/adding-tables-with-schemas.md
rules/automatic-apis.md阅读单个规则文件以获取详细说明和代码示例:
rules/adding-tables-with-schemas.md
rules/automatic-apis.mdFull Compiled Document
完整编译文档
For the complete guide with all rules expanded:
AGENTS.md如需查看包含所有扩展规则的完整指南,请参阅:
AGENTS.md