NRE Labs Community

Improving Antidote-Web Developer Experience

I had a chance to work on improving the development experience for the antidote-web project. The main challenge thus far was that you really had to have the back-end Syringe API available in order to be able to see all of the features active in the web front-end, and with Syringe’s current design, that meant you also needed a working Kubernetes cluster. Not exactly ideal for basic web development.

The Syringe re-vamp efforts in mini-project 1 should help address this, but those efforts are likely still a long ways out. So, I implemented a stopgap to basically run Syringe in a mode that offers static, “fake” data that doesn’t depend on a full-blown Kubernetes cluster.

I also added a command “make hack” to the Makefile in antidote-web to use this and also spin up a few other containers so you can actually play with a “lesson” that has a few tabs including an SSH terminal. The idea is that you just run that command on your local copy of the antidote-web repo, and the makefile will spin up everything you need to see it in action.

Try it out and let me know what you think!

1 Like

Hi Matt!

I tested this out, and it worked perfectly. I first had to remove the antidote-web repo I already had, but I think that’s cuz I had some wonky workaround for getting the local version to work.

It’s super easy to use! Thanks.

If I run into other issues I’ll let you know.

Excellent, thanks for the feedback @natzberg

Hate to be a debbie downer, but now that I have antidote-web up and running, the install for syringe doesn’t work. I’ve tried using make install_bins_mac but there’s something with protobuf that’s throwing an error whatever I do.

Is there a better thread for this?

It sounds like you’re trying to compile syringe from source? The new docker compose setup for antidote-web includes a container that runs Syringe for you, so you shouldn’t have to do that. Can you clarify?

Oh, does it? My bad. The lesson wasn’t showing up. I’ll try rerunning antidote-web and removing syringe source.

[e] yes, i was compiling syringe from source because i thought I misread and needed it… turns out i just misunderstood :stuck_out_tongue:

No problem - and perhaps I should have been more clear in the docs. Up until now it was really tough to develop on Antidote-web without a working instance of Syringe to provide a working API to get data from. And at the moment, Syringe needs to have a Kubernetes cluster in order to work. So, transitively, in order to work on Antidote-web and really see everything in action, you had to set up the whole thing. Not ideal.

So, added a fake service to Syringe that we could use as a “sample API” that didn’t require Kubernetes. Meant to be very lightweight, and bypass nearly all of Syringe’s functionality, but provide a nice static data source via API. This can be run by starting the new binary syringed-mock.

Once that existed, I added introduce docker-compose setup to antidote-web that uses the precompiled Syringe docker image, and runs syringed-mock, along with a few other useful things, like a web server and utility image to show as content in the mock “lesson”.

Hope that makes sense.

Also, for anyone else who may have the same issue. I tweaked the docker command for the Makefile slightly since mine kept pulling from the cache and overwriting any changes I made. I decided to add --no-cache to the docker build command. Not sure if that was the exact way, but it’s been working so far :slight_smile:

Just in case, for launching syringed-mock, on can do:
docker run -p 8086:8086 antidotelabs/syringe /usr/bin/syringed-mock

Then one may connect to http://localhost:8086/exp/lesson for instance.


I’ve recorded a webcast that demoes somehow the use of synringed-mock for hacking on antidote-web :