This commit is contained in:
Mayel de Borniol 2024-02-08 10:52:32 +00:00
parent 374b3248ef
commit 9f86721e46
13 changed files with 405 additions and 8 deletions

View file

@ -24,7 +24,7 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
**Bonfire environment (please complete the following information):**
- Running with Docker? (see WITH_DOCKER env variable): [e.g. none, easy, full]
- Running with Docker? (see WITH_DOCKER env variable): [e.g. none, partial, easy, full]
- Running env: [e.g: dev, prod with mix, prod with OTP release, prod with docker image]
- Running version (check on your instance's homepage): [e.g: 0.1.1-beta.42-with-JS]
- Running flavour: [e.g: classic, cooperation]

View file

@ -16,7 +16,9 @@ This project is in the beta stage - you're welcome to try out it out (specifical
This repo includes configurations to run two main [flavours of Bonfire](https://bonfirenetworks.org/use-bonfire/) you can choose from:
* [Classic](https://github.com/bonfire-networks/bonfire-app/tree/main/flavours/classic) for basic social networking (beta)
* [Community](https://github.com/bonfire-networks/bonfire-app/tree/main/flavours/community) with groups and topics functionality (alpha)
* [Cooperation](https://github.com/bonfire-networks/bonfire-app/tree/main/flavours/cooperation) with a bunch more extensions and features (pre-alpha)
* [Open Science](https://github.com/bonfire-networks/bonfire-app/tree/main/flavours/open-science) building the next generation of open science platforms. (pre-alpha)
* [Coordination](https://github.com/bonfire-networks/bonfire-app/tree/main/flavours/coordination) for organising work and collaborating around projects and tasks (pre-alpha)
* [Cooperation](https://github.com/bonfire-networks/bonfire-app/tree/main/flavours/cooperation) for cooperative production, distribution, and exchange of economic resources (pre-alpha)
<!-- As well as app flavours being built by others, including:
* [Haha Academy](https://github.com/bonfire-networks/bonfire-app/tree/main/flavours/haha) by haha.academy

View file

@ -10,14 +10,12 @@ This app is a flavour of [Bonfire](https://bonfirenetworks.org/) and bundles the
- [Bonfire.Federate.ActivityPub](https://github.com/bonfire-networks/bonfire_federate_activitypub) - federates activities with ActivityPub to participate in the fediverse
- [Bonfire.Tag](https://github.com/bonfire-ecosystem/bonfire_tag) - @ mentions, hashtags, and tagging using topics/categories from Bonfire.Classify
- [Bonfire.Classify](https://github.com/bonfire-ecosystem/bonfire_classify) - categories & classifications in taxonomies
- [Bonfire.Geolocate](https://github.com/bonfire-ecosystem/bonfire_geolocate) - places
- [Bonfire.Quantify](https://github.com/bonfire-ecosystem/bonfire_quantify) - units & measures
- [Bonfire.ValueFlows](https://github.com/bonfire-ecosystem/bonfire_valueflows) - economic activities with ValueFlows
- [Bonfire.ValueFlows.Observe](https://github.com/bonfire-ecosystem/bonfire_valueflows_observe) - observation of economic resources
- [Bonfire.API.GraphQL](https://github.com/bonfire-ecosystem/bonfire_api_graphql) - a GraphQL client API
- [Bonfire.UI.ValueFlows](https://github.com/bonfire-networks/bonfire_ui_valueflows) - reusable frontend components for economic activities
- [Bonfire.UI.Coordination](https://github.com/bonfire-networks/bonfire_ui_valueflows) - basic coordination UI for projects and communities
- [Bonfire.Kanban](https://github.com/bonfire-networks/bonfire_breadpub) - coordination tools with drag-and-drop card UI
- [Bonfire.Geolocate](https://github.com/bonfire-ecosystem/bonfire_geolocate) - places
- [Bonfire.Quantify](https://github.com/bonfire-ecosystem/bonfire_quantify) - units & measures
- [Bonfire.ValueFlows.Observe](https://github.com/bonfire-ecosystem/bonfire_valueflows_observe) - observation of economic resources
- [Bonfire.Breadpub](https://github.com/bonfire-networks/bonfire_breadpub) - needs & offers for mutual aid

View file

@ -19,4 +19,4 @@ absinthe_client = "https://github.com/bonfire-networks/absinthe_client#master"
towel = "https://github.com/CyrusOfEden/towel"
## Flavour:UPCYCLE
bonfire_upcycle = "https://gitlab.com/bonfire-networks/bonfire_upcycle#main"
# bonfire_upcycle = "https://gitlab.com/bonfire-networks/bonfire_upcycle#main"

View file

@ -0,0 +1,22 @@
# Bonfire Coordination
This app is a flavour of [Bonfire](https://bonfirenetworks.org/) and bundles the following extensions:
- [Bonfire.Common](https://github.com/bonfire-networks/bonfire_common) - common utils
- [Bonfire.Me](https://github.com/bonfire-networks/bonfire_me) - accounts, user profiles...
- [Bonfire.Social](https://github.com/bonfire-networks/bonfire_social) - feeds, activities, posts, boosting, flagging, etc...
- [Bonfire.UI.Social](https://github.com/bonfire-ecosystem/bonfire_ui_social) - interface for basic social activities
- [Bonfire.Boundaries](https://github.com/bonfire-networks/bonfire_boundaries) - define circles and associated privacy or permissions
- [Bonfire.Federate.ActivityPub](https://github.com/bonfire-networks/bonfire_federate_activitypub) - federates activities with ActivityPub to participate in the fediverse
- [Bonfire.Tag](https://github.com/bonfire-ecosystem/bonfire_tag) - @ mentions, hashtags, and tagging using topics/categories from Bonfire.Classify
- [Bonfire.Classify](https://github.com/bonfire-ecosystem/bonfire_classify) - categories & classifications in taxonomies
- [Bonfire.ValueFlows](https://github.com/bonfire-ecosystem/bonfire_valueflows) - economic activities with ValueFlows
- [Bonfire.API.GraphQL](https://github.com/bonfire-ecosystem/bonfire_api_graphql) - a GraphQL client API
- [Bonfire.UI.ValueFlows](https://github.com/bonfire-networks/bonfire_ui_valueflows) - reusable frontend components for economic activities
- [Bonfire.UI.Coordination](https://github.com/bonfire-networks/bonfire_ui_coordinatio) - basic coordination UI for projects and communities
- [Bonfire.UI.Kanban](https://github.com/bonfire-networks/bonfire_ui_kanban) - coordination tools with drag-and-drop card based UI
## More information
See the [main docs](../../README.md).

View file

@ -0,0 +1,22 @@
## Flavour:COOPERATION
bonfire_api_graphql = "https://github.com/bonfire-networks/bonfire_api_graphql#main"
bonfire_ui_topics = "https://github.com/bonfire-networks/bonfire_ui_topics#main"
bonfire_ui_groups = "https://github.com/bonfire-networks/bonfire_ui_groups#main"
# bonfire_pages = "https://github.com/bonfire-networks/bonfire_pages#main"
bonfire_classify = "https://github.com/bonfire-networks/bonfire_classify#main"
# bonfire_quantify = "https://github.com/bonfire-networks/bonfire_quantify#main"
# bonfire_geolocate = "https://github.com/bonfire-networks/bonfire_geolocate#main"
bonfire_valueflows = "https://github.com/bonfire-networks/bonfire_valueflows#main"
bonfire_ui_valueflows = "https://github.com/bonfire-networks/bonfire_ui_valueflows#main"
bonfire_ui_kanban = "https://github.com/bonfire-networks/bonfire_ui_kanban#main"
bonfire_ui_coordination = "https://github.com/bonfire-networks/bonfire_ui_coordination#main"
# bonfire_breadpub = "https://github.com/bonfire-networks/bonfire_breadpub#main"
# bonfire_ui_reflow = "https://github.com/bonfire-networks/bonfire_ui_reflow#main"
# bonfire_recyclapp = "https://github.com/bonfire-networks/bonfire_recyclapp#main"
# bonfire_taxonomy_seeder = "https://github.com/bonfire-networks/bonfire_taxonomy_seeder#main"
# bonfire_valueflows_observe = "https://github.com/bonfire-networks/bonfire_valueflows_observe#main"
absinthe_client = "https://github.com/bonfire-networks/absinthe_client#master"
towel = "https://github.com/CyrusOfEden/towel"
## Flavour:UPCYCLE
# bonfire_upcycle = "https://gitlab.com/bonfire-networks/bonfire_upcycle#main"

View file

@ -0,0 +1,3 @@
# API
absinthe = "~> 1.7.6"

View file

@ -0,0 +1,11 @@
#!/bin/sh
# Add any extensions/deps with a package.json in their /assets directory here
# NOTE: any LV Hooks should also be added to ./deps_hooks.js
# TODO: make this more configurable? ie. autogenerate from active extensions with JS assets
DEPS='iconify_ex bonfire_ui_common bonfire_editor_quill bonfire_editor_ck bonfire_geolocate bonfire_ui_kanban'
#
chmod +x ./js-deps-get.sh
./js-deps-get.sh "$DEPS" $@

View file

@ -0,0 +1,36 @@
let ExtensionHooks = {};
// NOTE: any extensions included here need to also be added to ./deps.js.sh
// NOTE: during development you may want to change 'deps' in the path to 'forks', but remember to change it back before committing!
// TODO: make this more configurable? ie. don't import disabled extensions
// import { ChangeLocaleHooks } from "./../../../deps/bonfire_ui_common/assets/js/change_locale"
// import { InputSelectHooks } from "./../../../deps/bonfire_ui_common/assets/js/input_select"
// import { NotificationsHooks } from "./../../../deps/bonfire_ui_common/assets/js/notifications"
// import { CarouselHooks } from "./../../../deps/bonfire_ui_common/assets/js/carousel"
// import { ResponsiveTabsHooks } from "./../../../deps/bonfire_ui_common/assets/js/responsive_tabs"
// import { ThemeHooks } from "./../../../deps/bonfire_ui_common/assets/js/theme"
import { CopyHooks } from "./../../../deps/bonfire_ui_common/assets/js/copy"
import { TooltipHooks } from "./../../../deps/bonfire_ui_common/assets/js/tooltip"
// import { PopupHooks } from "./../../../deps/bonfire_ui_common/assets/js/popup"
// import { FeedHooks } from "./../../../deps/bonfire_ui_common/assets/js/feed"
// import { InfiniteScrollHooks } from "./../../../deps/bonfire_ui_common/assets/js/infinite_scroll"
// import { ImageHooks } from "./../../../deps/bonfire_ui_common/assets/js/image"
// import { EmojiHooks } from "./../../../deps/bonfire_ui_common/assets/js/emoji"
// import { EditorCkHooks } from "./../../../deps/bonfire_editor_ck/assets/js/extension"
// import { EditorQuillHooks } from "./../../../deps/bonfire_editor_quill/assets/js/extension"
// import { ComposerHooks } from "./../../../deps/bonfire_ui_common/assets/js/composer"
import { GeolocateHooks } from "./../../../deps/bonfire_geolocate/assets/js/extension"
import { KanbanHooks } from "./../../../deps/bonfire_ui_kanban/assets/js/extension"
import { EncryptHooks } from "./../../../deps/bonfire_encrypt/assets/js/extension"
// import LiveSelect from "./../../../deps/live_select/assets/js/live_select"
import LiveSelect from "./../../../deps/live_select/priv/static/live_select.min.js"
Object.assign(ExtensionHooks, CopyHooks, TooltipHooks, LiveSelect, GeolocateHooks, KanbanHooks, EncryptHooks) // EditorCkHooks, EditorQuillHooks
export { ExtensionHooks }

View file

@ -0,0 +1,92 @@
import Config
# config :bonfire_api_graphql,
# modularity: :disabled
# Please note that most of these are defaults meant to be overridden by instance admins in Settings rather than edited here
config :bonfire, :ui,
theme: [
# instance_name: "Bonfire",
instance_theme: "bonfire",
instance_theme_light: "light",
instance_icon: "/images/bonfire-icon.png",
instance_image: "/images/bonfires.png",
instance_description: "This is a Bonfire (cooperation flavour) instance for testing purposes",
instance_welcome: [
title: "👋 Welcome",
description:
"Bonfire is a federated social networking toolkit to customise and host your own online space and control your experience at the most granular level.
More details at https://bonfirenetworks.org",
links: [
"About Bonfire": "https://bonfirenetworks.org/",
"About ValueFlows": "https://valueflo.ws/",
Forum: "https://socialhub.activitypub.rocks/g/bonfire/activity/posts",
"Community Chat": "https://matrix.to/#/%23bonfire-networks:matrix.org",
Contribute: "https://bonfirenetworks.org/contribute/"
]
]
],
# end theme
hide_app_switcher: false,
feed_object_extension_preloads_disabled: false,
profile: [
# TODO: make dynamic based on active extensions
sections: [
# inventory: Bonfire.UI.Reflow.ProfileInventoryLive,
],
navigation: [
# inventory: "inventory",
],
widgets: []
],
# smart_input_activities: [
# category: "Create a topic",
# label: "New label",
# task: "Add a task",
# offer: "Publish an offer",
# need: "Publish a need",
# # transfer_resource: "Transfer a resource",
# # produce_resource: "Add a resource",
# # intent: "Indicate an itent",
# economic_event: "Record an economic event",
# process: "Define a process"
# ],
# smart_input_components: [ # NOTE: replaced by the SmartInputModule behaviour
# task: Bonfire.UI.Coordination.CreateTaskLive,
# upcycle_intent: Bonfire.Upcycle.Web.CreateIntentLive,
# upcycle_resource: Bonfire.Upcycle.Web.CreateResourceLive,
# upcycle_transfer: Bonfire.Upcycle.Web.CreateTransferLive,
# economic_event: Bonfire.UI.ValueFlows.SelectEconomicEventLive,
# process: Bonfire.UI.ValueFlows.CreateProcessLive,
# offer: Bonfire.UI.ValueFlows.CreateIntentLive,
# need: Bonfire.UI.ValueFlows.CreateIntentLive
# ],
resource: [
navigation: [
timeline: "timeline",
material_passport: "material passport"
],
widgets: [
# Bonfire.UI.Social.SubscribeWidgetLive,
Bonfire.UI.ValueFlows.LocationWidgetLive,
Bonfire.UI.Social.HashtagsWidgetLive
]
]
# process: [
# navigation: [
# events: "Economic events",
# intents: "Intents",
# # material_passport: "material passport",
# ],
# sections: [
# events: Bonfire.UI.ValueFlows.EconomicEventsLive,
# intents: Bonfire.UI.ValueFlows.IntentsLive,
# ],
# widgets: [
# # Bonfire.UI.Social.SubscribeWidgetLive,
# # Bonfire.UI.ValueFlows.LocationWidgetLive,
# # Bonfire.UI.Social.HashtagsWidgetLive,
# ],
# ]

View file

@ -0,0 +1,4 @@
[
import_deps: [:ecto_sql],
inputs: ["*.exs"]
]

View file

@ -0,0 +1,200 @@
import Bonfire.Me.Fake
import Bonfire.Social.Fake
System.put_env("INVITE_ONLY", "false")
System.put_env("SEARCH_INDEXING_DISABLED", "true")
fake_user!(
%{
preferred_username: System.get_env("SEEDS_USER", "root"),
name: System.get_env("SEEDS_USER", "Seed User")
},
%{confirm_email: true}
)
# create some users
users = for _ <- 1..5, do: fake_user!()
random_user = fn -> Faker.Util.pick(users) end
# start some communities
# communities = for _ <- 1..2, do: fake_community!(random_user.())
# subcommunities = for _ <- 1..2, do: fake_community!(random_user.(), Faker.Util.pick(communities))
# maybe_random_community = fn -> maybe_one_of(communities ++ subcommunities) end
# create fake collections
# collections = for _ <- 1..4, do: fake_collection!(random_user.(), maybe_random_community.())
# subcollections = for _ <- 1..2, do: fake_collection!(random_user.(), Faker.Util.pick(collections))
# maybe_random_collection = fn -> maybe_one_of(collections ++ subcollections) end
# start fake threads
# for _ <- 1..3 do
# user = random_user.()
# thread = fake_thread!(user, maybe_random_community.())
# comment = fake_comment!(user, thread)
# # reply to it
# reply = fake_comment!(random_user.(), thread, %{in_reply_to_id: comment.id})
# subreply = fake_comment!(random_user.(), thread, %{in_reply_to_id: reply.id})
# subreply2 = fake_comment!(random_user.(), thread, %{in_reply_to_id: subreply.id})
# end
#
## more fake threads
# for _ <- 1..2 do
# user = random_user.()
# thread = fake_thread!(user, maybe_random_collection.())
# comment = fake_comment!(user, thread)
# end
for _ <- 1..10 do
thread = fake_post!(random_user.())
comment = fake_comment!(random_user.(), thread)
comment = fake_comment!(random_user.(), comment)
end
# post some links/resources
# for _ <- 1..2, do: fake_resource!(random_user.(), maybe_random_community.())
# for _ <- 1..2, do: fake_resource!(random_user.(), maybe_random_collection.())
# define some tags/categories
if(Bonfire.Common.Extend.extension_enabled?(Bonfire.Classify.Simulate)) do
for _ <- 1..2 do
category = Bonfire.Classify.Simulate.fake_category!(random_user.())
_subcategory = Bonfire.Classify.Simulate.fake_category!(random_user.(), category)
end
end
# define some geolocations
if(Bonfire.Common.Extend.extension_enabled?(Bonfire.Geolocate.Simulate)) do
for _ <- 1..2,
do: Bonfire.Geolocate.Simulate.fake_geolocation!(random_user.())
for _ <- 1..2,
do: Bonfire.Geolocate.Simulate.fake_geolocation!(random_user.())
end
# define some units
if(Bonfire.Common.Extend.extension_enabled?(Bonfire.Quantify.Simulate)) do
for _ <- 1..2 do
_unit1 = Bonfire.Quantify.Simulate.fake_unit!(random_user.())
_unit2 = Bonfire.Quantify.Simulate.fake_unit!(random_user.())
end
end
# conduct some fake economic activities
if(Bonfire.Common.Extend.extension_enabled?(ValueFlows.Simulate)) do
for _ <- 1..2 do
user = random_user.()
action_id = ValueFlows.Simulate.action_id()
# some lonesome intents and proposals
_intent = ValueFlows.Simulate.fake_intent!(user, %{action_id: action_id})
_proposal = ValueFlows.Simulate.fake_proposal!(user)
end
for _ <- 1..2 do
user = random_user.()
_process_spec = ValueFlows.Simulate.fake_process_specification!(user)
res_spec = ValueFlows.Simulate.fake_resource_specification!(user)
# some proposed intents
action_id = ValueFlows.Simulate.action_id()
intent =
ValueFlows.Simulate.fake_intent!(user, %{
resource_conforms_to: res_spec,
action_id: action_id
})
proposal = ValueFlows.Simulate.fake_proposal!(user)
ValueFlows.Simulate.fake_proposed_to!(random_user.(), proposal)
ValueFlows.Simulate.fake_proposed_intent!(proposal, intent)
# define some geolocations
if(Bonfire.Common.Extend.extension_enabled?(Bonfire.Geolocate.Simulate)) do
places = for _ <- 1..2, do: Bonfire.Geolocate.Simulate.fake_geolocation!(random_user.())
random_place = fn -> Faker.Util.pick(places) end
for _ <- 1..2 do
# define some intents with geolocation
_intent =
ValueFlows.Simulate.fake_intent!(
random_user.(),
%{at_location: random_place.(), action_id: action_id}
)
# define some proposals with geolocation
_proposal =
ValueFlows.Simulate.fake_proposal!(user, %{eligible_location: random_place.()})
# both with geo
intent =
ValueFlows.Simulate.fake_intent!(
random_user.(),
%{at_location: random_place.(), action_id: action_id}
)
proposal = ValueFlows.Simulate.fake_proposal!(user, %{eligible_location: random_place.()})
ValueFlows.Simulate.fake_proposed_intent!(proposal, intent)
# some economic events
user = random_user.()
resource_inventoried_as =
ValueFlows.Simulate.fake_economic_resource!(user, %{current_location: random_place.()})
to_resource_inventoried_as =
ValueFlows.Simulate.fake_economic_resource!(random_user.(), %{
current_location: random_place.()
})
ValueFlows.Simulate.fake_economic_event!(
user,
%{
to_resource_inventoried_as: to_resource_inventoried_as.id,
resource_inventoried_as: resource_inventoried_as.id,
action: Faker.Util.pick(["transfer", "move"]),
at_location: random_place.()
}
)
end
end
if(Bonfire.Common.Extend.extension_enabled?(Bonfire.Quantify.Simulate)) do
unit1 = Bonfire.Quantify.Simulate.fake_unit!(random_user.())
unit2 = Bonfire.Quantify.Simulate.fake_unit!(random_user.())
for _ <- 1..2 do
action_id = ValueFlows.Simulate.action_id()
# define some intents with measurements
intent =
ValueFlows.Simulate.fake_intent!(
random_user.(),
%{action_id: action_id},
Faker.Util.pick([unit1, unit2])
)
proposal = ValueFlows.Simulate.fake_proposal!(user)
ValueFlows.Simulate.fake_proposed_intent!(proposal, intent)
# some economic events
user = random_user.()
unit = Faker.Util.pick([unit1, unit2])
resource_inventoried_as = ValueFlows.Simulate.fake_economic_resource!(user, %{}, unit)
to_resource_inventoried_as =
ValueFlows.Simulate.fake_economic_resource!(random_user.(), %{}, unit)
ValueFlows.Simulate.fake_economic_event!(
user,
%{
to_resource_inventoried_as: to_resource_inventoried_as.id,
resource_inventoried_as: resource_inventoried_as.id,
action: Faker.Util.pick(["transfer", "move"])
},
unit
)
end
end
end
end

View file

@ -0,0 +1,7 @@
defmodule Bonfire.Repo.Seeds.ObserveClassifications do
use Bonfire.Seeder
envs([:dev, :prod, :test])
def up(repo), do: ValueFlows.Observe.Seeds.up(repo)
end