Skip to content

aliceliveprojects/WildLoggingDBParent

Repository files navigation

WildLogging

WildLogging is a web application which we built to show how the JAM Stack works (Javascript, API, Markup). It's a pretty simple responsive app which lets anyone log wildlife sightings in their neighbourhood.

You can find the SPWA (Single Page Web Application) deployed on GitHub Pages, here

The WildLogging App depends on an API, which fronts a database. You can find the API UI here.

Here's where you can find the source code:

  • for the web application: here
  • for the API: here

Here's how we developed the project:

We originally built the project to show the wonder of Platforms-as-a-Service: We used a fantastic service called Restlet, which gave us an online database and UI tools to easily make the RESTFul API to wrap it. Alas Restlet was swallowed by a larger organisation and the service was discontinued. It really helped us though: we could produce a data API in just a few minutes.

About this project

Now the project has moved on: we removed the dependency on Restlet, by creating a new API and our own Postgres DB.

For history's sake, you can see the original project here. You can see the re-worked project here

Now we'll show you how the RESTful API definition (using the Open API Specification (which used to be Swagger)) we built in Restlet Studio can be used to generate a skeleton server, and a database back-end, without too much more effort.

The result is much more useful, because we can add functionality which transforms the data, rather than just looking it up. Doing more processing on the server means that we reduce the communications traffic, and the processing done on the client.

Try this too

Follow along: it's a good way to experience all the tools and processes, while having something which is easy to test. We're assuming you have a GitHub account already.

How do I do it?

We've got a number of scripts to go through, in order:

  • Re-implementing the API - this shows you how we created a Postgres DB behind the same RESTful API - so we ddn't have to change the client.
  • First Party Authentication - this shows you how we added authentication to the sensitive parts of the API, which delete data. We show you how to use the authentication service, Auth0
  • Third-Party Authentication - this shows how we added authentication for SPWAs which are not on the same domain as the one serving the API. It's how we create useful SPWAs on GitHub pages. All the infrastructure we use is free-tier. As soon as there is a requirement to be on the same domain, then we have to start paying. This is the work-around, to let us prototype and illustrate Apps, APIs and DBs.

Repository Cheatsheet

SPWA REST API
No Admin Implementation Unauthenticated REST API
Admin Implemented Unauthenticated REST API
Third Party Authentication Implemented Authenticated REST API

About

A documentation repo for the WildLoggingDB service

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors