Page 1 of 2

SpiderBasic

Posted: Mon Oct 21, 2019 4:48 pm
by blueznl
Not sure where to put this (if in the wrong place, then mods, feel free to move it!) but I wonder: how many people do use PureBasic AND SpiderBasic?

(I am actually considering dabbling a bit in SpiderBasic, so I'd like find out the experience of other PureBasic / SpiderBasic combo users...)

Re: SpiderBasic

Posted: Mon Oct 21, 2019 5:18 pm
by Bitblazer
I licensed both and started to develop my first spiderbasic app, but still struggle to get it to run on one of my smartphones. google developer console is giving me enough trouble so i started to look for other ways now.

Re: SpiderBasic

Posted: Tue Oct 22, 2019 6:39 am
by dige
I use it a lot for Server - Client Apps..

Re: SpiderBasic

Posted: Tue Oct 22, 2019 8:41 am
by GG
100% Purebasic, 0% Spiderbasic.

Until now, Purebasic has belonged to my professional needs.
I will now probably have to develop client-server schemes, so will study SpiderBasic side... I don't feel comfortable at all with Spider, but let's try however...

Re: SpiderBasic

Posted: Tue Oct 22, 2019 8:58 am
by BarryG
Is SpiderBasic secure? I thought anyone could view the source of your SpiderBasic apps in their browser? Yes or no?

Re: SpiderBasic

Posted: Tue Oct 22, 2019 9:07 am
by Kiffi
BarryG wrote:Is SpiderBasic secure? [...] Yes or no?
No.

The secure things should be executed on the server side.

Re: SpiderBasic

Posted: Tue Oct 22, 2019 1:40 pm
by blueznl
Is there a kind of 'dummy' set of instructions?

I have NO clue whatsoever when it comes to web development, however I have an idea I'd like to try, which requires a server somewhere :-) and something to run on the mobile device. (Sorry I cannot give details, that's commercial. If you want to compare it with anything, assume it's a Dungeons and Dragons spellbook that is managed online, but can be viewed offline, it's as close as it gets...)

Options

I have two options / see two stages:

a. either web only (all intelligence on the server side) which limits the deployment to online only, but that might be acceptable, or...

b. (partially) operational even when offline, which requires some code on the user's device, but this is for later worrying

I'd probably start with a, but want to move to b in the long run.

I've been browsing the SpiderBasic website a bit, but some things aren't very clear to me. (I might have just missed the 'survival guide' equivalent :oops: :wink: )

Questions

1. Is there a 'SpiderBasic for Dummies'?

2. What do I need to run things 'at home'? I assume I need to set up some webserver in a VM or similar to simulate real world behavior (though I could simply opt to run a second 'instance' on the actual server) and SpiderBasic. Anything else I need?

3. I suppose the hosting party must offer me some things... For example, I need to store that database somewhere on the server side, so the hosting party must support a database, I suppose? (The hoster I am considering is supporting MariaDB, kind of MySQL.)

4. Now here's the kicker. Everything above is on the SpiderBasic / web side. But I plan to run some 'raw' PureBasic code, at first on a test machine from home, but I'll probably switch to a dedicated server if things work and are commercially viable. So can I access that (remote) MariaDB with PureBasic?

Here's an example of the setup:

mypc + PureBasic <-- internet --> MariaDB on hoster <-- internet --> browser on mobile

Then, one day, I'd like to also support this:

mypc + PureBasic <-- internet --> MariaDB on hoster <-- internet --> limited data + app on on mobile

Why and why now?

Well, I just lost my regular job, and will do some consultancy over the next year. Getting a regular job as a 50+ guy is hard, so why not start to pursue some old ideas I never finished developing...

Part of the issue is that data in that database is processed 'in batches' which will allow quite a bit of off-line processing, compute, and me :-( tweaking the algorithms until it all works properly and is ready for prime time.

I know there must be better ways to make some money, but at least this way there's a bit of fun still in there 8) I think I'll be able to make a second income with the concept, but it isn't big enough to start hiring people, set up a big company etcetera.

So, assume I'm out of my mind, and assume I'm not (yet) about to hire a web expert... how would I start?

SpiderBasic

... though I am a bit worried about the viability of SpiderBasic, it's what I am most familar with...

Does anyone use that forum? I tried to register, but never receive the registration confirmation, so cannot even ask questions over there...

Re: SpiderBasic

Posted: Wed Oct 23, 2019 12:53 pm
by Rinzwind
In case the concept isn't fully clear: SpiderBasic is purely a 'compiler' to client-side HTML/JavaScript/CSS. It doesn't handle the server side. To store something in a server side DB you still need to POST to a server script like PHP. The build-in database functionality provides access to browsers local SQLITE support. SpiderBasic seems to be all about showing a desktop-like GUI dialogs on a web page, although a powerful grid control (buildin sorting, reordering, interactive find) is missing (just like native with PureBasic sadly).

ps. I just created an account successfully. The confirmation e-mail ended up in spam (sent from an @gmail.com address), so check that too. I used a Hotmail address.

You could use PB as CGI application instead of PHP. See https://forums.spiderbasic.com/viewtopic.php?f=9&t=1703 for a combo PB/SB example.

Re: SpiderBasic

Posted: Wed Oct 23, 2019 1:44 pm
by blueznl
Thanks Rinzwind, that clarifies a bit.

Leaves me two things to check out:

1. An example / step by step instructions of how to store / retrieve data from a remote database? Suitable for idiots like me :-)

2. An example / step by step instructions of how to turn a SpiderBasic program into an 'app'? Again for idiots like me :lol:

Re: SpiderBasic

Posted: Wed Oct 23, 2019 4:21 pm
by Kiffi
blueznl wrote:1. An example / step by step instructions of how to store / retrieve data from a remote database? Suitable for idiots like me :-)
If you use (SpiderBite), an example code would look like this:

Code: Select all

#SpiderBite_Profile = "SimpleDatabaseTest"

EnablePbCgi
  
  UseSQLiteDatabase()  
  
  Procedure InitDatabase()
    
    Protected DB
    
    Protected DatabaseFilename.s = GetPathPart(ProgramFilename()) + "db.db"
    
    If FileSize(DatabaseFilename) = -1
      
      CreateFile(0, DatabaseFilename)
      CloseFile(0)
      
      DB = OpenDatabase(#PB_Any, DatabaseFilename, "", "", #PB_Database_SQLite)
      
      DatabaseUpdate(DB, "Create Table TestTable (Counter INTEGER)")
      
      DatabaseUpdate(DB, "Insert Into TestTable (Counter) Values (0)")
      
    Else
      
      DB = OpenDatabase(#PB_Any, DatabaseFilename, "", "", #PB_Database_SQLite)
      
    EndIf
    
    ProcedureReturn DB
    
  EndProcedure
  
  ProcedureDLL.s myPbCgiProcedure()
    
    Protected DB
    
    Protected ReturnValue.s = "Ups!"
    
    DB = InitDatabase()
    
    If DB
      
      If DatabaseUpdate(DB, "Update TestTable Set Counter = Counter + 1")
        
        If DatabaseQuery(DB, "Select Counter From TestTable")
          
          NextDatabaseRow(DB)
          
          ReturnValue = "Hello from myPbCgiProcedure (called " + Str(GetDatabaseLong(DB, 0)) + " times)"
          
          FinishDatabaseQuery(DB)
          
          CloseDatabase(DB)
          
        EndIf
        
      EndIf
      
    EndIf
    
    ProcedureReturn ReturnValue
    
  EndProcedure
  
DisablePbCgi

Debug myPbCgiProcedure()
(Yes, I know that SQLite databases are not suitable for web applications, but I was too lazy to write an example for real database server.)

This example runs locally on my computer with the IIS.

It depends on whether your web hoster allows you to execute CGIs. Most hosters, for example, only allow the execution of PHP scripts (which my SpiderBite also supports).

Greetings ... Peter

Re: SpiderBasic

Posted: Wed Oct 23, 2019 6:17 pm
by blueznl
Thanks. Another one to look at, but it's slowly beginning to make sense...

> Can't decide if i need a hug, an XXL coffee, 6 shots of vodka or 2 weeks of sleep.

All, and probably in that order :-)

Re: SpiderBasic

Posted: Wed Oct 23, 2019 7:06 pm
by skywalk
Hi Kiffi,
Do you have any experience using nginx(FCGI only?) or mongoose(Fred uses this for SpiderBasic) servers on Windows PC's?

Re: SpiderBasic

Posted: Thu Oct 24, 2019 7:32 am
by JCV
blueznl wrote:Not sure where to put this (if in the wrong place, then mods, feel free to move it!) but I wonder: how many people do use PureBasic AND SpiderBasic?

(I am actually considering dabbling a bit in SpiderBasic, so I'd like find out the experience of other PureBasic / SpiderBasic combo users...)

Hi blueznl,

I'm still using both PB and SB. I ported my PB software desktop frontend to SB and it was easier than expected.
Our users have an alternative to access our online system via browser instead of using desktop.
I use combination of (PB or SB) + MYSQL + PHP.

Re: SpiderBasic

Posted: Thu Oct 24, 2019 7:52 am
by Kiffi
Hello skywalk,
skywalk wrote:Do you have any experience using nginx(FCGI only?) or mongoose(Fred uses this for SpiderBasic) servers on Windows PC's?
Unfortunately I don't have enough experience with these servers. On my local PC as well as on my vServer I use the IIS, which is completely sufficient for me.

Do you have a specific question regarding this?

Greetings ... Peter

Re: SpiderBasic

Posted: Thu Oct 24, 2019 12:52 pm
by skywalk
I just thought iis would be more complicated to deal with on desktop PC's? I will try it out and see.