DEV Community

Discussion on: Help figuring out the architecture of the application

Collapse
 
brandinchiu profile image
Brandin Chiu

What would be the easiest way to create such an API, host and deploy it?

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.

How can I upload an image "somewhere", fetch the barcode string from it and then discard it?

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.

Collapse
 
attkinsonjakob profile image
Jakob Attkinson

Thank you for your response.

Isn't OpenAPI doing something similar to strapi.io?

Collapse
 
brandinchiu profile image
Brandin Chiu

No. OpenApi is not software.

It's a design standard for documentation of how APIs work. However, it's evolved now to work backwards to generate code from that documentation.

Essentially, you describe what you want your api to do: method, input, response, type URL path, etc.

Once youre done describing all of the apis you need, you can feed them into any number of code generation tools that support openapi, and it will bootstrap your application for you in any number of supported languages.

You then fill out the rest.