DEV Community

Discussion on: Does every backend need to be an API?

Collapse
 
jameswagnerjr profile image
James Wagner Jr

Something like this really doesn't need an external data storage. Personally, I'd be trying to make it as local as possible & take advantage of local storage options. IndexDB, SQLite, Chrome.storage, the filesystem API, etc. This sounds like something that could probably be stored in a flat file format pretty easily.

Collapse
 
mendoza profile image
David Mendoza (He/Him)

I think the same, give a try with pure react and localstorage, or even sqlite as he says, that should give you enough for this kind of project.

Collapse
 
jasterix profile image
Jasterix • Edited

Thanks for the feedback! To start, I want to build this as a fullstack single page app. Would this still apply? I updated the post to reference this

Collapse
 
jameswagnerjr profile image
James Wagner Jr

Depends on how sensitive you think your users would be to the data potentially seemingly randomly disappearing (Should be a rare occurrence, but more likely then not). If they are sensitive to it, then I would set up an extremely basic REST API to handle it. If they're not, IndexDB is a decent solution. IndexDB functions a lot like localStorage. They both can be cleared if the browser decides it needs that storage for something else. It can also be cleared by the user. The user wouldn't necessarily know that clearing it also clears your app's data.

I'm pretty sure there are libraries for IndexDB to interact with the major frameworks' state management libraries (Storing the stuff inside the state manager in IndexDB).

Thread Thread
 
jasterix profile image
Jasterix

Thank you! i'll check out IndexDB