diff --git a/README.md b/README.md index 6c6cbfb..4cdd537 100644 --- a/README.md +++ b/README.md @@ -4,27 +4,15 @@ Say goodbye to REST APIs. No more API middleware and DB interfacing functions and wrappers and handlers. Write your SQL queries on the frontend and have their results be automagically refreshed on all clients when a resource is changed on the server DB. -Check [basic demo](./demos/basic/README.md) to try an interactive bare-bones demonstration. +Check [Basic Demo](./demos/basic/README.md) to try an interactive bare-bones demonstration. -Check [secure framework demo](./demos/framework/README.md) to try an interactive demonstration on a Svelte-Vite app! +Check [Secure Framework Demo](./demos/framework/README.md) to try an interactive demonstration on a Svelte-Vite app! -NB! These might not work sometimes, bcs i use them to develop the lib and forget to reset them. Just look for the import errors and in the source uncomment the right import. - -Check [docs](./core/docs.md) to see direct examples and explinations of how to use various parts of the lib. Might be out of date, but the lib core files arent that big, and they are full of comments, so u can read up on those. +Check the [Simple Documentation](./core/docs.md) page to see direct examples and explinations of how to use various parts of the lib. Might be out of date, but the lib core files arent that big, and they are full of comments, so u can read up on those. Comes with a class for auto securing the SQL, so no worries about injections. And even a simple Vite plugin that wraps it 🥳 -## TODOs 📝 -* Session ID sync with backend webserver sessions -* Keyed SQL queries -* Better SQL dependency distinguisher on queries -* Typescript migration -* Rate-limit query updates -* Threading paralization pipelines for async querry queues -* Data loading and success or fail states -* Caching and dedup UPD msg kind -* File and blob sending and replacing on the client side -* plenty more +Check the lib [README](./core/README.md) for a fuller readme that has more info, otherwise i have to update both of them all the time. ### Dont be shy to try this out on your small project. Feedback from real world use cases is much appreciated 🥰 diff --git a/core/README.md b/core/README.md index fe4bfcd..4464fff 100644 --- a/core/README.md +++ b/core/README.md @@ -4,18 +4,15 @@ Say goodbye to REST APIs 👋. No more API middleware and DB interfacing functions and wrappers and handlers. Write your SQL queries on the frontend and have their results be automagically refreshed on all clients when a resource is changed on the server DB. -Check [basic demo](../demos/basic/README.md) to try an interactive bare-bones demonstration. +Check [Basic Demo](https://github.com/Rolands-Laucis/Socio.js/blob/master/demos/basic/readme.md) to try an interactive bare-bones demonstration. -Check [secure framework demo](../demos/framework/README.md) to try an interactive demonstration on a Svelte-Vite app! +Check [Secure Framework Demo](https://github.com/Rolands-Laucis/Socio.js/blob/master/demos/framework/README.md) to try an interactive demonstration on a Svelte-Vite app! -NB! These might not work sometimes, bcs i use them to develop the lib and forget to reset them. Just look for the import errors and in the source uncomment the right import. - -Check [docs](./docs.md) to see direct examples and explinations of how to use various parts of the lib. Might be out of date, but the lib core files arent that big, and they are full of comments, so u can read up on those. +Check the [Simple Documentation](https://github.com/Rolands-Laucis/Socio.js/blob/master/core/README.md) page to see direct examples and explinations of how to use various parts of the lib. Might be out of date, but the lib core files arent that big, and they are full of comments, so u can read up on those. Comes with a class for auto securing the SQL, so no worries about injections. And even a simple Vite plugin that wraps it 🥳 ## TODOs 📝 -* Session ID sync with backend webserver sessions * Keyed SQL queries * Better SQL dependency distinguisher on queries * Typescript migration diff --git a/core/secure.js b/core/secure.js index 2bfd756..0caaba3 100644 --- a/core/secure.js +++ b/core/secure.js @@ -97,7 +97,7 @@ export class SocioSecurity{ //surrouded by the same quotes as original, the sql gets encrypted along with its marker, so neither can be altered on the front end. //+ a random int to scramble and randomize the encrypted string for every build. EncryptSocioString(q='', sql='', marker=''){ - return q + this.EncryptString(sql + (marker ? marker : '--socio') + '-' + this.GenRandInt()) + q + return q + this.EncryptString(sql + (marker ? marker : '--socio') + '-' + this.GenRandInt()) + q //`--${this.GenRandInt()}\n` + } GenRandInt(min = 100, max = 10_000){ diff --git a/demos/basic/package.json b/demos/basic/package.json index 534ecd4..57cf4a5 100644 --- a/demos/basic/package.json +++ b/demos/basic/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "demo": "node server.js" + "dev": "node server.js" }, "author": "", "license": "ISC", diff --git a/demos/framework/src/App.svelte b/demos/framework/src/App.svelte index 5fc0620..65971bd 100644 --- a/demos/framework/src/App.svelte +++ b/demos/framework/src/App.svelte @@ -31,7 +31,7 @@ users = res //res is whatever object your particular DB interface lib returns from a raw query }) - console.log(await sc.query("SELECT 42+69 AS RESULT;--socio-auth;")) + console.log(await sc.query("SELECT 42+69 AS RESULT;--socio;")) })