artin820dev / calculator

0 stars 0 forks source link

save user history and load it at start #1

Open hamedpro opened 1 year ago

hamedpro commented 1 year ago

@hamedpro

backend part :

there must be a simple websocket or restful api listening for 2 events : get history and new_history_record. each user has a unique id and those history records have that id within them. it can be done anyway you like more. when its done, write specification of how to use it.

@hamedpro

frontend part :

at start time generate a unique id for each user and save it somewhere you like. it can be localSrorage or whatever. then at start time, load and show history and each time user hits "=" save a new record in the server.

hamedpro commented 1 year ago

we have an api which listens on port 4000 and has two endpoints : GET /get_history : send you a json stringified version of all current history records. GET /new_history_record : you must send it a parameter in url query : new_record and it must be a string. it tells you if the job is done.