SpiderBasic

Everything else that doesn't fall into one of the other PB categories.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

SpiderBasic

Post 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...)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Bitblazer
Enthusiast
Enthusiast
Posts: 730
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: SpiderBasic

Post 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.
webpage - discord chat links -> purebasic GPT4All
dige
Addict
Addict
Posts: 1240
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: SpiderBasic

Post by dige »

I use it a lot for Server - Client Apps..
"Daddy, I'll run faster, then it is not so far..."
User avatar
GG
Enthusiast
Enthusiast
Posts: 254
Joined: Tue Jul 26, 2005 12:02 pm
Location: Lieusaint (77), France

Re: SpiderBasic

Post 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...
Purebasic 6.04 64 bits - Windows 11 Pro 64 bits 23H2
BarryG
Addict
Addict
Posts: 3268
Joined: Thu Apr 18, 2019 8:17 am

Re: SpiderBasic

Post by BarryG »

Is SpiderBasic secure? I thought anyone could view the source of your SpiderBasic apps in their browser? Yes or no?
User avatar
Kiffi
Addict
Addict
Posts: 1346
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: SpiderBasic

Post by Kiffi »

BarryG wrote:Is SpiderBasic secure? [...] Yes or no?
No.

The secure things should be executed on the server side.
Hygge
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: SpiderBasic

Post 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...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: SpiderBasic

Post 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.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: SpiderBasic

Post 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:
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Kiffi
Addict
Addict
Posts: 1346
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: SpiderBasic

Post 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
Hygge
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: SpiderBasic

Post 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 :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
skywalk
Addict
Addict
Posts: 3960
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: SpiderBasic

Post 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?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
JCV
Enthusiast
Enthusiast
Posts: 579
Joined: Fri Jun 30, 2006 4:30 pm
Location: Middle East

Re: SpiderBasic

Post 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.

[Registered PB User since 2006]
[PureBasic 5.7][SpiderBasic 2.2] [Win 10 64bit]
[Intel i7 990x 4.20 Ghz] [18GB DDR3]
User avatar
Kiffi
Addict
Addict
Posts: 1346
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: SpiderBasic

Post 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
Hygge
User avatar
skywalk
Addict
Addict
Posts: 3960
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: SpiderBasic

Post by skywalk »

I just thought iis would be more complicated to deal with on desktop PC's? I will try it out and see.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Post Reply