This commit is contained in:
Rolands 2023-07-26 12:41:02 +03:00
commit 6e9611e5aa
2 changed files with 9 additions and 7 deletions

View file

@ -10,7 +10,7 @@
* ```npm i``` * ```npm i```
* ```npm run demo``` * ```npm run demo```
Should start the express webserver and print out its url, that you can visit on your fav browser to begin the interactive demo. This should start the express webserver and print out its url, that you can visit on your fav browser to begin the interactive demo.
* Visi the URL on one or multiple tabs or browser instances. * Visi the URL on one or multiple tabs or browser instances.
* Then press the big INSERT button, which will insert a new row into the DB on the users table. * Then press the big INSERT button, which will insert a new row into the DB on the users table.
@ -20,4 +20,6 @@ As you will notice, all instances of the browsers and their tabs update their va
This is powerful because you nolonger need to write a REST API middle layer between front and back end and manually sync states and data, which in practice is often challenging and laborious. With Socio this is all done automagically for you. As well as no need to write DB query interfacing middle layers, since your SQL queries can just sit in one place - the front end - where their use sits. This is powerful because you nolonger need to write a REST API middle layer between front and back end and manually sync states and data, which in practice is often challenging and laborious. With Socio this is all done automagically for you. As well as no need to write DB query interfacing middle layers, since your SQL queries can just sit in one place - the front end - where their use sits.
## Next check out the ``client.js`` file to see how the magic is done on the frontend - its super simple ;) ## Next check out
* [client.js](./client.js) file to see how the magic is done on the frontend - it's super simple ;)
* [server.js](./server.js) file to see how the magic is done on the backend. The Express.js http server and SocioServer is created here.

View file

@ -10,7 +10,7 @@
* ```npm i``` * ```npm i```
* ```npm run dev``` * ```npm run dev```
Should start the SvelteKit Vite local webserver and print out its url, that you can visit on your browser to begin the interactive demo. That should start the SvelteKit Vite local webserver and print out its url, that you can visit on your browser to begin the interactive demo.
Should also log some startup status messages upon the first http request. Should also log some startup status messages upon the first http request.
* Visi the URL on one or multiple tabs or browser instances. * Visi the URL on one or multiple tabs or browser instances.
@ -23,9 +23,9 @@ This is powerful because you nolonger need to write a REST API middle layer betw
In addition, this demo makes use of the included SocioSecure Vite plugin to encrypt the actual SQL queries on the front end source code. You can check the console logs, websocket messages in the browser Network panel or the Svelte source code on the browser. The sent SQL messages are scrambled gibberish. However, the dynamic parameters are not. In addition, this demo makes use of the included SocioSecure Vite plugin to encrypt the actual SQL queries on the front end source code. You can check the console logs, websocket messages in the browser Network panel or the Svelte source code on the browser. The sent SQL messages are scrambled gibberish. However, the dynamic parameters are not.
## Next check out the [src/routes/+page.svelte](https://github.com/Rolands-Laucis/Socio/blob/master/demos/full-stack_framework/src/routes/%2Bpage.svelte) file to see how the magic is done on the frontend - it's super simple ;) ## Next check out
* [src/routes/+page.svelte](./src/routes/+page.svelte) file to see how the magic is done on the frontend - it's super simple ;)
This is because im new to TypeScript and am not yet aware of the configuration options i need to get stuff working for everyone. Would be nice, if someone could help with this :) * [src/hooks.server.ts](./src/hooks.server.ts) file to see how the magic is done on the backend. SocioServer is created here.
## Building this for production ## Building this for production
* ```npm i @sveltejs/adapter-node``` or other production adapter you need. For Node.js backend servers, this will work. * ```npm i @sveltejs/adapter-node``` or other production adapter you need. For Node.js backend servers, this will work.
@ -33,4 +33,4 @@ This is because im new to TypeScript and am not yet aware of the configuration o
* Set up .env config loading in Vite. Either the npm lib `dotenv` or use ``import.meta.env`` ES property, which Vite should populate with env vars automatically on build. * Set up .env config loading in Vite. Either the npm lib `dotenv` or use ``import.meta.env`` ES property, which Vite should populate with env vars automatically on build.
* ```npm run build``` to build the project to a default dir called ``./build`` * ```npm run build``` to build the project to a default dir called ``./build``
* ``node build/index.js`` to run the built node.js backend server, that will host the entire built SvelteKit project. Or ```node build``` for short. * ``node build/index.js`` to run the built node.js backend server, that will host the entire built SvelteKit project. Or ```node build``` for short.
* Probably a good idea to set up NginX reverse proxy and launch the run cmd through ``pm2`` (process manager 2), so that it is revived, if it crashes. * Probably a good idea to set up NginX reverse proxy and launch the run cmd through ``pm2`` (process manager 2), so that it is revived, if it crashes.