I posted a while ago a short article expressing my desire to do some open-source projects.
While I've been using the time to publish some stuff on my GH page, now I believe I'm finally ready to start working on my idea.
If only I knew where to start...
I want to create an application where the user uploads a code bar from a soft-drink bottle, the code is translated to a string, the image discarded and based on the string some queries on the DB.
This is the short version of it. The front-end can be anything, but I will probably go for Gatsby or Gridsome.
For the back-end, I just need some easy API where I can create some CRUD entities, do some queries (POST / GET) and throw a json back.
Here are my questions:
What would be the easiest way to create such an API, host and deploy it? I was thinking of a Graphql API on NodeJs. (mostly because it looks like something fun to learn). But I have no experience creating a full API back-end.
How can I upload an image "somewhere", fetch the barcode string from it and then discard it? (I have no use to save it)
Any advice on how to plan all these and get started would be greatly appreciated.
The absolute easiest way to put together a quick CRUD MVP would be to use the OpenAPI spec to generate a backend stub (github.com/OpenAPITools/openapi-ge...).
You can use OpenAPI to generate the application structure of your backend in dozens of supported languages and frameworks. Then you just need to fill the stubbed files and methods with functionality.
When you "upload" an image through the HTML form, it typically creates a temporary file on the filesystem of the server backing the form. That file is then made available to your application to do something with. By default, the image is usually discarded, if you don't explicitly move or copy it from the temporary directory (/tmp, for example on Linux servers), then the server will naturally clean it out as needed periodically.