Greenstand / treetracker-admin-client

The Admin Panel is the part of the Treetracker project for verifying, processing and managing data collected by the Treetracker app
GNU Affero General Public License v3.0
33 stars 193 forks source link

Additional info for stakeholder #1079

Open sebastiangaertner opened 1 year ago

sebastiangaertner commented 1 year ago

Currently web map displays are achieved through the webmap.config file which only applies for the admin panel. We have to make the decision where the additional info on a stakeholder is stored. (ie. About us, Vision, Logo URL, Hero image URL, etc)

  1. in the stakeholder table
    • obviously fast querying and simple structure
    • not much flexibility
  2. in an extra config table
    • benefits of many different parameters possible
    • maps and custom views could be created (treating stakeholders like an object rather which means even a custom map view could be a stakeholder
    • slower queries and more complex structure (seems to not be an argument since most will be served by the API)

We would need additional UX to be able to cater for that. Each stakeholder object should be able to be customizable.

Screenshot 2023-04-19 at 09 49 53

dadiorchen commented 1 year ago

@sebastiangaertner I think we should use extra tables rather than big stakholder table, and regular columns rather than object/json.

The reason is:

  1. Object/json is convenient for short term hack and temporary usage, but harmful for long-term and growth business in the future. It is too easy to change the definition and easy to cause chaos in the future.
  2. The performance shouldn't be the problem, we don't need to do trade-off because of performance, let's build a reasonable and strong business model.
  3. Dedicated/focused table aligns with our new domain principle: separate schema, tables for separate domain/business.

So in my mind, we can add extra config for different purpose, like the webmap, we can create a table includes:

  1. stakeholder_id
  2. hero_photo_url
  3. initial_position_lat_lon

And in the stakeholder table, we can define general/basic info for it, email, photo...

And the android config could be similar to the webmap config.

For the admin panel, I think we should have a separate page for those dedicated map/mobile config.

I think this is reasonable and extendable, for example, as we discussed, we bring in a new type of map: campaign, it isn't a stakeholder, but we can still need a similar config for this map of campaign, then we can choose the compaign on the map setting page, and do the same thing for a compaign.

If you need my support I can help design these table and relationship.