Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Bonfire
Bonfire
@bonfire@indieweb.social  ·  activity timestamp 2 years ago

@triptych yeah that just gets you a skeleton, then you’ll probably need at least:

- DB schema(s): https://doc.bonfirenetworks.org/database.html
- Backend logic modules (contexts)
- Integration with the composer (smart input)
- Publish activities to feeds
- “Activity previews” to display your custom activity and/or object types in feeds
- Custom UIs using https://surface-ui.org https://www.phoenixframework.org https://daisyui.com https://tailwindcss.com
- LiveHandlers as the glue between your backend logic and UI

1/2

  • Copy link
  • Flag this post
  • Block
Bonfire
Bonfire
@bonfire@indieweb.social replied  ·  activity timestamp 2 years ago

@triptych Example activity preview: https://github.com/bonfire-networks/bonfire_ui_social/blob/main/lib/components/activity/object/intent/intent_task_live.ex

  • Copy link
  • Flag this comment
  • Block
Bonfire
Bonfire
@bonfire@indieweb.social replied  ·  activity timestamp 2 years ago

“LiveHandlers” are simply a way to put a bunch of event handlers (handle_event, but also handle_params, etc) in a single module where they can be reused by multiple LiveViews and LiveComponents.

Examples: https://github.com/bonfire-networks/bonfire_ui_social/tree/main/lib/live_handlers

@triptych

  • Copy link
  • Flag this comment
  • Block
Bonfire
Bonfire
@bonfire@indieweb.social replied  ·  activity timestamp 2 years ago

@triptych

- Incoming & outgoing federation (i.e. translation between ActivityStreams schema and your internal schema, the rest is handled out of the box)
- Integrate Boundaries

We don’t have guides written yet for many of these, but happy to point you to the relevant code (both the places to integrate with, and example implementations), some of which is documented.

2/2

  • Copy link
  • Flag this comment
  • Block
Bonfire
Bonfire
@bonfire@indieweb.social replied  ·  activity timestamp 2 years ago

To implement federation, all you need is to declare in your context what Activity and/or Object types you want to handle, eg for posts:
```
def federation_module,
do: [
"Note",
{"Create", "Note"},
{"Create", "Article"}
]
```

and implement these two functions:
- for outgoing: `ap_publish_activity(subject_struct, verb, object_struct)`
- for incoming: `ap_receive_activity(subject_struct, activity_json, object_json)`

@triptych

  • Copy link
  • Flag this comment
  • Block
Bonfire
Bonfire
@bonfire@indieweb.social replied  ·  activity timestamp 2 years ago

@triptych

A lot of choices about how to implement things depend of your data schemas, and how closely you want/can integrate with existing functionality. Eg. you could reuse PostContent if your data has a title/name, summary, and body. This is what we do for the WIP pages extensions: which means not much code needs to be rewritten
1/2

  • Copy link
  • Flag this comment
  • Block
Bonfire
Bonfire
@bonfire@indieweb.social replied  ·  activity timestamp 2 years ago

2/2

- Schema: https://github.com/bonfire-networks/bonfire_pages/blob/main/lib/pages/page.ex
- Context: https://github.com/bonfire-networks/bonfire_pages/blob/main/lib/pages/pages.ex
- Create a page “act” (which along with “epics” is an optional way to define pipes that pass data between different extensions and modules in a particular order): https://github.com/bonfire-networks/bonfire_pages/blob/main/lib/pages/page.create.ex
- “Epic” definition (which reuses many “acts” from other extensions) https://github.com/bonfire-networks/bonfire_spark/blob/main/lib/runtime_config.ex#L120

@triptych

  • Copy link
  • Flag this comment
  • Block
Bonfire
Bonfire
@bonfire@indieweb.social replied  ·  activity timestamp 2 years ago

Example integration with the composer:
- form inputs: https://github.com/bonfire-networks/bonfire_pages/blob/main/lib/web/components/smart_inputs/create_page_live.ex & https://github.com/bonfire-networks/bonfire_pages/blob/main/lib/web/components/smart_inputs/create_page_live.sface
- include it in config: https://github.com/bonfire-networks/bonfire-app/blob/main/flavours/classic/config/bonfire_ui.exs#L118

@triptych

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.7 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct