couchbaselabs / couchbaselabs/sync_gateway_admin_ui

wizard for building sync functions

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
admin-ui FEATURE: Sync config building icebox
Dominant language
JavaScript
Stars
15
Forks
2
PR merge metrics
No merged PRs in 30d

Description

The goal wouldn't be to make it so you can write your whole sync function with the wizard, just that if you click through it a few times, the output it gives will teach you best practices.

Eventually you might stop using it, but it helps with the learning curve.

And example workflow would be:
- Wizard inspects some documents and notices a few fields top-level fields that have strings at the top level of the document. It gives you highlighted examples and asks which of those to treat as a "type" field.
- Then it can ask which of the others should be used to define channels.
- It also asks if there's anything on the document that should be used for requireUser() or access() calls, etc, for that document.

Again the goal is not to give you complete coverage (you are still expected to write code). Instead the goal is to start you off with something workable that you can customize. eg:

``` javascript
function(doc, oldDoc) {
if (doc.type) {
if (doc.type !== oldDoc.type) {throw({forbidden:"can't change type"})}
if (doc.type == "task") {
// generated code for mapping tasks to channels
}
if (doc.type == "profile") {
// generated code for mapping profiles to channels, access control, etc
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.