Page 2 of 3

Re: Is LC a good choice to write a web based accounting pack

Posted: Thu Apr 28, 2016 11:11 pm
by FourthWorld
I use a libraries on servers often, but what happens on the server is separate.

To run a stack delivered from a server is easy in LiveCode - run this in the Message Box:

Code: Select all

go url "http://fourthworld.net/revnet/devolution/4W_gzipper.livecode"
In fact, that particular stack is useful for this sort of thing, as it lets you drop any file onto it and it'll make a gzip-compressed copy.

If you compress your stacks with that before uploading them to your server, you can download them even faster:

Code: Select all

put url "http://somecompressedstack.livecode.gz" into tData
try
  put decompress(tData) into tStackData
catch tErr
  throw "Invalid stack file data"
end try
go stack tData
Whether you load a stack from your local disk or from the Web, LiveCode doesn't care, it'll run it just the same. The only difference is that the filename property of a download stack is empty, since it exists on the local machine only in memory.

Because it has no filename, it can't be saved back to the server, at least not with the "save stack" command. You can POST data to the server, and if you need to send a stack you can write a CGI to receive files and send stack files to it with POST. But for my projects I use the stacks only for UI and have data handled separately from a data store. When the stack loads its openStack command requests the data it displays from the server, and then calls the server's API to POST data back to it.

With most of the app coming from the server, all I need the standalone for is to provide the LC engine. The standalone's stack script contains just a few lines of code to download the main stack, or report an error to the user if the network is unavailable. That downloaded stack file takes care of everything else, downloading data and even other stacks files as needed in response to things the user does throughout the session.

In most respects, it's very much like working with local stacks, except that rather than loading them from disk I load them the web.

If this sort of thing is interesting (and frankly it's so useful for net-connected apps it's almost a shame not to use downloaded stacks for the UI), you can make a plugin to easily post new versions of your stack to your server. I prefer scp or rsync over FTP because they're secure. Your plugin can have a button named something like "Publish to Server", and it saves your stack file, makes a gzipped copy, and uploads that to your server with SCP. This way any time you want to deploy a bug fix or new feature, making it available for all your users is just one click away. I had the pleasure of using that in a meeting not long ago, where they were describing a bug in a conference call and I fixed it and uploaded it before our meeting was done - all they had to do was run the app again and they were using the latest version.


PS: to see a simple example of a downloaded stack in action, in your LC IDE see Development->Plugins->GoLiveNet (it'll be "GoRevNet" if using a version prior to 8.0). That plugin uses the "load" command to provide async download so it can display a progress bar, but the download is so short I don't really need it.

Re: Is LC a good choice to write a web based accounting pack

Posted: Fri Apr 29, 2016 1:31 am
by ghettocottage
FourthWorld wrote:I use a libraries on servers often, but what happens on the server is separate.

To run a stack delivered from a server is easy in LiveCode - run this in the Message Box:

Code: Select all

go url "http://fourthworld.net/revnet/devolution/4W_gzipper.livecode"

Do you use any sort of security with that? Or does it matter since you are using it for UI?

Re: Is LC a good choice to write a web based accounting pack

Posted: Fri Apr 29, 2016 1:49 am
by FourthWorld
ghettocottage wrote:
FourthWorld wrote:I use a libraries on servers often, but what happens on the server is separate.
To run a stack delivered from a server is easy in LiveCode - run this in the Message Box:

Code: Select all

go url "http://fourthworld.net/revnet/devolution/4W_gzipper.livecode"
Do you use any sort of security with that? Or does it matter since you are using it for UI?
It can be helpful to think of downloaded stacks like any other web resource, using authentication when needed. And since it's coming over HTTP/HTTPS you can use the same authentication methods you'd use for any other web resource.

For public consumption (like the URL above) no auth needed. Workgroup solutions run over HTTPS or VPN and require authentication (the first stack that gets downloaded is a login screen).

Re: Is LC a good choice to write a web based accounting pack

Posted: Fri Apr 29, 2016 8:19 am
by golive
:idea: Thanks all for your detailed responses.

I am undecided on how to proceed but will investigate the suggestions made so far.

Re: Is LC a good choice to write a web based accounting pack

Posted: Tue May 03, 2016 10:23 am
by rblackmore245
I am in the process of writing a CRM package in LiveCode , and finding all the features I need including using jquery menus and graphs for the dashboards and reports.

Re: Is LC a good choice to write a web based accounting pack

Posted: Wed May 04, 2016 2:48 am
by golive
rblackmore245 wrote:I am in the process of writing a CRM package in LiveCode , and finding all the features I need including using jquery menus and graphs for the dashboards and reports.
Are you using LiveCode Server?

Re: Is LC a good choice to write a web based accounting pack

Posted: Thu Jan 12, 2017 10:26 pm
by newpie
Hello, I had two questions:

1. I like option #2 but wanted to know if these options were possible?
Scenario A = Shortcut link on users desktop pointing to URL file that could automatically install a livecode starter application (exe file) locally and then this starter application would use the "go url "http://fourthworld.net/revnet/devolutio ... r.livecode" to start main stack.

Scenario B = Shortcut link on users desktop pointing to URL and when activated starts main stack on server

2. Is there a way to keep my code confidential in livecode stack on the server with password. I have option to do passwords, but that is only for standalone applications I thought.

Thank you for the help

Re: Is LC a good choice to write a web based accounting pack

Posted: Fri Jan 13, 2017 12:05 am
by FourthWorld
newpie wrote:..when activated starts main stack on server
What does that mean specifically?

Re: Is LC a good choice to write a web based accounting pack

Posted: Fri Jan 13, 2017 12:35 am
by newpie
Hello, thanks for quick reply,

I was just referring to the user doubleclicking the shortcut URL on their desktop and the main stack starts up from Server.


Thanks

Re: Is LC a good choice to write a web based accounting pack

Posted: Fri Jan 13, 2017 1:05 am
by FourthWorld
I see. Thanks. Just clarifying that the stack will be downloaded from the server, run locally in your standalone, yes?

Re: Is LC a good choice to write a web based accounting pack

Posted: Fri Jan 13, 2017 1:29 am
by newpie
Hello, as long as I can provide a URL shortcut link on desktop for end user, they doubleclick, then the main stack starts is my goal. Not sure if that was possible.

The medical program I saw has you login via web thru URL shortcut link on desktop, then after you log in multiple icons for certain apps are shown, when you doubleclick the application you desire it starts some type of citrix setup and the program is starts up momentarily. Just trying to simulate that logic.

Re: Is LC a good choice to write a web based accounting pack

Posted: Thu Jan 19, 2017 7:42 pm
by newpie
Hello, I wanted to ask if anyone knew of a way to protect my stack coding via the start livecode activation stack method if I store my main stack on a server.

Thanks

Re: Is LC a good choice to write a web based accounting pack

Posted: Wed Aug 30, 2017 4:06 pm
by YogiYang
golive wrote:I have an accounting package that I created in another language. It is based on dbase tables and runs on a Windows desktop.
I am looking to write a new similar application that runs over the internet. It will have several simultaneous users.

Is LC a good choice for the platform to develop this kind of application?
Also is the web capability of LC up to a task like this?

I would appreciate your opinions, for and against.

All suggestions welcome.
If you are a dBase developer or have ever programmed in FoxPro then I would advise you to check out Lianja (https://www.lianja.com/index.php?option ... cle&id=499). It supports 3 programming languages and is easy to master. It is not suitable for creating non DB oriented app though.

HTH

Re: Is LC a good choice to write a web based accounting pack

Posted: Wed Aug 30, 2017 4:18 pm
by FourthWorld
newpie wrote:Hello, I wanted to ask if anyone knew of a way to protect my stack coding via the start livecode activation stack method if I store my main stack on a server.
If by "stack coding" you mean scripts it's far simpler to set a password on the delivered stacks; a UI for this is in the Standalone Builder.

There may be other benefits to downloading stacks within your application, but it's probably not worth the trouble if all you want is to protect your code.

Besides, whether read from local disk or read from a remote disk and transferred over the 'Net, you'll still want to password-protect the stack regardless of where it's stored.

Re: Is LC a good choice to write a web based accounting pack

Posted: Wed Aug 30, 2017 4:24 pm
by dave.kilroy
@Richard do you (or anyone?) have any information on the encryption used in password protecting a stack? Yesterday I had to write a 'security statement' on how a LiveCode project I'm working on saved data to mobile devices, I was able to talk about the built-in encrypt() command and AES-256 (which I'm using to encrypt and decrypt locally saved data), but I couldn't find anything describing the protection used when password protecting a stack. I'm sure LiveCode don't want to have details of how they password protect stacks common knowledge, but is there an official company statement describing the process even in a vague way that I could reference?

Kind regards

Dave