This commit is contained in:
2018-06-28 23:08:13 +00:00
commit 877637f1e5
69 changed files with 13521 additions and 0 deletions

107
notes/algorithm Normal file
View File

@@ -0,0 +1,107 @@
OLD Backend algorithm:
/*
SYNC STRATEGY
=-=-=-=-=-=-=
NEW ITEMS:
client record is iterated looking for non id or versioned items meaning newly added. If any are found the master rev is incremented and new items
are added.
DELETED ITEMS:
Server record is itereated looking for deleted items (not on the client's list and are older revision than the client version), if any are
found master rev is incremented (unless it was already) then they are removed from the master list.
UPDATE
Compare client record to master record, compare list name for a change, then find all items that have the same ID but different user editable values, if any found update master rev
if not done already, make master changed items match client changed items, update master.
RETURN:
Finally, if master list has changed, it is saved to db then it is returned to user otherwise {nochange:1} or something is returned.
*/
NEW ALGORITHM
Basically the same, except it will sync all lists on the device at once, so the routes need to take a list of lists of listitems as a chunk, not just a single list
OLD ROUTES
=-=-=-=-=-=
//POST - GET AN AUTHENTICATION TOKEN
router.route('/authenticate')
//GET USERS LISTS
// get all the lists for username specified
router.route('/mylists')
//GET A LIST OBJECT
// get the list object for id specified .
router.route('/list/:listid')
//POST - CREATE / SYNC A LIST
router.route('/list')
//DELETE - REMOVE A LIST
router.route('/list')
//DOWNLOAD - download all data
router.route('/mylists/download_all')
NEW ROUTES
=-=-=-=-=-
Since there is so little data overall in these lists, we are just going to assume all lists on all devices.
A Sync operation just sends the whole graph and gets the whole graph back, it's stored in a single field in sqlite table
If a user doesn't want to see a list maybe it's filtered out at the client view
Authenticate - POST
/user - post get
Gets and sets the users list subscriptions
/sync
POST -
client posts their entire subscribed list graph at once,
the return is the entire user's list graph after synced at server
new lists are also created via this mechanism (at client first)
If a client is just getting lists (for example in a first run scenario) they just post an empty list graph
GET - (no get? Post an empty list if you want to get all the user's lists)
NEW List data object graph:
{
lists:[
Name:listname,
id:ShortIdString,
name_v:integer,
v:integer,
items:[
id: ShortIdString or empty if new and not assigned an id yet,
completed: bool,
text:,
v:incrementing_long,
priority:[int 0-3]
]
]
}
https://github.com/tastejs/todomvc/blob/gh-pages/examples/jquery/js/app.js
https://github.com/tastejs/todomvc/blob/master/examples/jquery/index.html

63
notes/notes Normal file
View File

@@ -0,0 +1,63 @@
8750e825f27d77a16755a7b14a9622fe6d4653ceaab2dd5645bbc89b5702fa1d
*********************************************
Updating Microsoft CODE editor
Download the .deb file for 64 bit
execute it
sudo dpkg -i code_1.8.1-1482159060_i386.deb
HANDLEBARS
=-=-=-=-=-
Install:
sudo npm install -g handlebars
Build handlebars template:
handlebars -m wwwroot/js/templates/> wwwroot/js/templates/templates.js
3rd party Packages used:
JWT JSON web token support using jose-jwt found here:
https://jwt.io/#libraries
Mailkit (supposedly system.net.mail will be ported in v2.0 of .net core but for now mailkit is the shit):
<!-- NOTE: bouncycastle needed for license gen but mailkit brings a slightly different one in so there is a conflict but just removing bouncycastle works because the license code uses teh mailkit bouncycastle-->
<!--PackageReference Include="bouncycastle.netcore" Version="1.8.1.3" /-->
DEVICE METRICS LIST
https://material.io/devices/
John phone 411px wide (dp)
Joyce s7 360px wide (dp)
***********************
HOW TO DEPLOY TO IIS
https://stackify.com/how-to-deploy-asp-net-core-to-iis/
1) SET VERSION
RENAME ?plvx.x parameter in index.html to the new version so all files update on mobile
2) PUBLISH
publish command line from rockfishCore folder:
//this will build a release version which is what we use on the server now
dotnet publish -c Release -o ./../plpublish/
//This is what I have seen online, not sure why the -f is necessary or useful, the build is the exact same size as above, have a question in to stackoverflow about it
dotnet publish -f netcoreapp2.1 -c Release -o ./../plpublish/
//if need a debug version
dotnet publish -o ./../plpublish/
3) COPY
Copy over to production server, only need the .dll and the wwwroot folder contents,
remember not to delete the folders on the server only replace their contents because there are Windows file permissions set

2
notes/todo Normal file
View File

@@ -0,0 +1,2 @@