A Webapp created from Shiny framework written in R that allows for the user to view/add/delete markers on a map.

Background

This was a side project where I wanted to futher explore the shiny framework after I went through these tutorials.

The App:

This is a webapp with different admin access to view/create/delete different markers on to a map. Here, I used an example of bike sharing companies in Singapore where a user would click to create a marker on the map of which specific company bike as the marker.

alt text

Front End

Map Layer

I used the leaflet package to create the main map layer with some customized javascript to enable the creation and deletion of markers. The package also came with lots of bells and whistles which I only enabled a few of the features such as search.

alt text Main mapping screen with the top right corner allowing for filtered views

An easy way to enable map searching in from the leaflet package An easy way to enable map searching in from the leaflet package

alt text Added some custom javascript to enable a delete button on each marker

Login-Screen

I used a hacky way to create a login screen to allow accounts with different levels of access (view vs create vs delete permission).

I added some custom code to re-popup the login screen if the account details didn’t match. This is definitely not the cleanest way to create permissioning rights, but as a quick hacky solution it was enough.

Here I created a use case to view/add/delete the three different bike sharing bikes in singapore on the map.

alt text

Backend - SQLITE

I used an sqlite database to save all the marker data. The admin user accounts were hardcoded into the app’s logic. Ideally I would also put user accounts in the database as well, especially for security reasons, but during the time of development I just wanted a proof of concept.

alt text

Conclusion

I wanted to test out a very quick way to productionize a GUI web app and realized it was a very quick way to do it using Shiny. Although the problem occurs when you consider scale & security issues.