bull-board icon indicating copy to clipboard operation
bull-board copied to clipboard

AdonisJS Support

Open kevin1193 opened this issue 2 years ago • 10 comments

Does the newest version have adonisjs support?

kevin1193 avatar Jun 02 '22 07:06 kevin1193

Hi @kevin1193 , I've reviewed several times Adonis, and I didn't found a "clear" path to add support. But, I'm not familiar with Adonis and probably I've missed something out.

Let me know If you willing to collaborate on writing an adapter for Adonis

felixmosh avatar Jun 02 '22 08:06 felixmosh

Hello @felixmosh . Yeah I'm very willing to collab in regards to Adonisjs adapter for this. I need to use this in one of my projects. I will now fork this the main repo and do a run through with it. Please help with tips where do you think should I start.

kevin1193 avatar Jun 02 '22 08:06 kevin1193

I'm available at Discord, felixmosh#0178 ping me if you need IM.

felixmosh avatar Jun 02 '22 08:06 felixmosh

Alright cool will do.

kevin1193 avatar Jun 02 '22 08:06 kevin1193

I added you as friend. I cant send dm unless you accept. Looking forward to talk to you.

kevin1193 avatar Jun 02 '22 08:06 kevin1193

I'm there.

felixmosh avatar Jun 02 '22 08:06 felixmosh

This is an implementation using the 2.x.x deprecated bull-board package. https://github.com/Rocketseat/adonis-bull/tree/alpha

This adds @bull-board to an adonis application that uses adonis-bull https://github.com/brkn/adonis-bull-demo-app/pull/1

I think together the information contained in both repositories should be enough to pull together an official package.

evoactivity avatar Jul 08 '22 13:07 evoactivity

@evoactivity thank you for sharing it. From this line https://github.com/Rocketseat/adonis-bull/blob/d5397350d328f8d14e08feb9da5247c981848f97/src/BullManager.ts#L127, looks like it runs bull-board as a separate server.

If you are familiar with Adonis I'll be more than happy to collab with on an adapter for it.

felixmosh avatar Jul 08 '22 13:07 felixmosh

looks like it runs bull-board as a separate server.

It does. I'm not sure if that is possible with the current version though. At least not without creating an express server and then using the express adapter. But since we have a whole adonis server that seems redundant.

I'm still new to adonis so right now I'm not sure what would be needed or what the right approach would be. Once I've finished my current project I should have more understanding and be able to take a stab at writing an adapter.

Is my understanding of a server adapter correct? That basically we want to build and install routes for the server sourced from api/routes.ts. Eg such that we could do something like

Route.group(() => {
  adonisAdapter.getRouter()
}).prefix('queues')

edit:

Just discovered these discussions https://github.com/felixmosh/bull-board/issues/405 https://github.com/felixmosh/bull-board/issues/212

Which suggest an adonis adapter might not be straight forward.

evoactivity avatar Jul 08 '22 16:07 evoactivity

Basically, Adonis adapter can return any thing (for example, in FastifyAdapter, we are returning a Fastify Plugin, In ExpressAdapter we are returning a router), it should "talk" with Adonis, setup several things, like:

  1. Serving stating files
  2. Rendering ejs (in one of the threads brkn mentioned that Adonis doesn't supports ejs, we for example can make a "middleware" route in the Adapter that will generate the ejs, and pass it to Adonis)
  3. Register bull-board api routes

The basic idea of the architecture is based on Builder design pattern, createBullBoard gets queue list & framework adapter, and calls the adapter's interface in-order to "build" (setup) the host.

Again, I'm not expecting you to solve the whole thing, but, I'm clueless (& don't use) Adonis, so I don't know where to start. But I do know requirements in order to build an XAdapter, I'm available here or in discord.

felixmosh avatar Jul 08 '22 17:07 felixmosh

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 06 '22 17:10 stale[bot]