linkdash icon indicating copy to clipboard operation
linkdash copied to clipboard

Support CRUD?

Open JaneJeon opened this issue 4 years ago • 2 comments

Hi! First of all, this project looks really nice (I've been trying for a year to basically do the same thing that this project solves using a bunch of trello boards, to little success).

Now, I know that config.js is just an async function that takes no input and returns an object asynchronously, and my first thought was that I could maybe get this to support adding/editing/removing stuff across multiple devices using mongodb as a backend.

However, I can't do this currently because:

  1. There's no interface nor API for adding/removing/editing links
  2. The config function doesn't have any parameters, so there is no way of knowing who is calling the API, meaning that if you have any instance public, everyone sees the same thing and have the same permissions

As a backend girl, I'd love to help add support for a proper backend but it cannot be done without first addressing the above two issues.

I'd love to hear your thoughts on this.

JaneJeon avatar Apr 09 '20 15:04 JaneJeon

Hello! Thank you for the first comment ^_^. I was just working on a templated http example which can be found here:

https://github.com/igimanaloto/linkdash/tree/master/examples/templated-http-response

The example shows how to use the buildTemplate helper. (outputs an html string). You may import it from linkdash, i.e. import { buildTemplate } from 'linkdash'.

Essentially, you'd treat linkdash as a simple renderer, with the rest of your backend logic offloaded to your node server / serverless function (just like what the example above does). I would imagine that you'd use http headers to capture an identity (JWT/role etc) and reacting based on that. So if for example, you had dev, admin, marketing and sales boards, you would have to call buildTemplate accordingly.

Let me know if that helps!

macouella avatar Apr 09 '20 16:04 macouella

OK, cool, if you can manage to somewhat flesh out that example then I'd be more than happy to build the backend for you!

JaneJeon avatar Apr 09 '20 21:04 JaneJeon