Saving state in a react-native - reactjs

I´m building a react native app for my own use(for android), and I don´t get how to save the state of my app, since the idea is to save some text data in the phone.
I want to save some orders, which are going to be around 400-700 a year(i´m quite sure this wont increase), so I don´t think I really need like a server with a database.
I saw AsyncStorage but it looks like it´s intended for something else, like login tokens and stuff.
Would a text file(csv for example) do the job? Or how would you do it? Thanks

RxDB - A realtime Database for JavaScript Applications.
WatermelonDB - 🍉 Next-gen database for powerful React and React Native apps that scales to 10,000s of records and remains fast.
realm - An alternative mobile database to SQLite & key-value stores.
react-native-storage - This is a local storage wrapper for both react-native(AsyncStorage) and browser(localStorage). ES6/babel is needed.
react-native-sqlite-storage - SQLite3 bindings for React Native (Android & iOS)
react-native-simple-store - A minimalistic wrapper around React Native's AsyncStorage.
react-native-store - A simple database base on react-native AsyncStorage.
react-native-easy-app - This is a local storage wrapper for both react-native(AsyncStorage).
Check awesome-react-native. This is list of libraries that can help solve much of your problems

If you don't want to use a server ,You can use firebase realtime database or firebase firestore.

you can use redux-persist if using redux doesn't matter for you!

Related

Correct way of using react with electronjs

I have external api hosted in the cloud and I would like to write desktop app for management. Last version of electronjs I worked with was version 8 and over that time a lot of changed especially from security perspective. The concept of preload was introduced and I would like to know is it fine to write renderer as react app with redux toolkit and make api calls that way or should I use preload script to get data on the server side.
I would like to know what is a proper way of writing such app.
Yes, it is totally fine to use react and redux toolkit in your renderer.
To quickly get started, you could use something like electron react boilerplate or one of the several other boilerplates available online.
I don't understand why you would want to use preload to fetch from the server.
You can treat the renderer as just another browser instance and make requests to the server directly from your react app using fetch or xhr.
Preload is generally used to run code before the renderer has loaded. I generally use it as a bypass to turning on nodejsintegrations for my electron apps, but you can read more about it in the official docs

migrating existing legacy laravel application in react frontend

We have an existing legacy laravel application and like to convert it into a react application for this kind of application we want to migrate but can't do in a big bang way. what is Ideally needed? make a react application and put laravel application in an iframe and then migrate one by one section? thinking of using httpclient and parse dom.
do we have a better way?
Well, firstly you need to actually analyze the scope of work that needs to happen.
Ideally, you migrate component of your Laravel app step by step to React app.

How would I go into setting up a firebase project safely?

I have an app idea which I want to create a working product of. I do have a working demo with React Native and I'm using Firebase for storing documents and images. Creating documents and uploading images to Firebase Storage is all done in the app, but this is just for demo purposes. In reality you would of course want to use an API for storing all that data. At least, I thought so. All I see on the internet is people using Firebase directly in their app. Is this the correct way of doing it? I always learned you should use a backend, for example a REST API for safely handling data.
Is it safe and secure to 'just' use React Native? I want to handle payments in my app, so I really want it to be done securely.
So what's an example of a stack I could use?
Currently using React Native and Firebase. But for safety I'd imagine something like
React Native - frontend
Node Express Server - backend
Firebase - database
I hope someone can give me a little push in the right direction.

from django to django rest framework : e-commerce with react

i have completed an e-commerce project with pure django and want to transform it to Django Rest Framework with React,
i just want to know if the use of Sessions to create a cart would still be the same or is there something else or a different aproach to keep cart functionality,
i have been looking at some github projects to see how it can be done ,and just got me confused, if someone can clear that out for me, much much apreciated,
thank you,
I understood that it is possible to set cookies or a local storage with react and receive the info directly to the Django backend from there, so there is no need using sessions (it still totally possible but apparently not preferred)

Best way to store data in a local Data Base in an application built using Angularjs and Electron

I am building an app using angularjs which is then ported to multiple platform using electron. The app needs a DB to store large set of data so which storage option is better. i want to use sqlite but will it work or correctly build in electron
You can store data in indexeddb. It is fast and completely html5 technologies.
Although indexeddb may be tough to understand for some users, so you can use any idb library which makes things easy for you.
Check out example of storing data using indexeddb library jsstore in electron - https://github.com/ujjwalguptaofficial/JsStore/tree/master/examples/electron
Yes you can use Sqlite with electron. Check out this answer which has further links and details.
https://stackoverflow.com/a/41230765/324143

Resources