• Specialized membership li

    From Va7aqd@VERT/VA7AQDS to All on Wednesday, May 08, 2019 23:44:00
    Hi everyone,

    I'm not much of a programmer, but I think I would like to tinker with an idea I had.

    I was wondering how difficult it is to build an external program in Synchronet in Javascript where one would require a small
    database of user objects. In essence, what I want to build is a HAM Club membership door, but it would of course require handling
    a small DB of "people" along with other pertinent data that I have yet to fully define, but things like "Member since", and a field
    relating to being paid up for the current year, etc., along with other items that might already be captured by the BBS - email
    address, DOB, mailing address, phone #, etc.

    Is it at all practical to do this in JS as a door?

    I guess I should mention that I've looked through the Synchro JS docs and it doesn't appear that Synchro will make/run a DB of
    items for an external program, so I guess that's what I'm mostly curious about.

    Thanks in advance.

    ---
    Synchronet VA7AQD's Tavern - bbs.isurf.ca
  • From Nightfox@VERT/DIGDIST to Va7aqd on Thursday, May 09, 2019 00:36:00
    Re: Specialized membership list
    By: Va7aqd to All on Wed May 08 2019 04:44 pm

    I'm not much of a programmer, but I think I would like to tinker with an idea I had.

    I was wondering how difficult it is to build an external program in Synchronet in Javascript where one would require a small
    database of user objects. In essence, what I want to build is a HAM Club membership door, but it would of course require handling
    a small DB of "people" along with other pertinent data that I have yet to fully define, but things like "Member since", and a field
    relating to being paid up for the current year, etc., along with other items that might already be captured by the BBS - email
    address, DOB, mailing address, phone #, etc.

    Is it at all practical to do this in JS as a door?

    I guess I should mention that I've looked through the Synchro JS docs and it doesn't appear that Synchro will make/run a DB of items for an external program, so I guess that's what I'm mostly curious about.

    Thanks in advance.

    Yeah, you'd probably need to use an external database program and find a way to interface with it from JavaScript (at the least, you may be able to run an external program and capture its output).

    At that point, you could also think about whether you want to limit the door to running only in Synchronet (with JS) or if you'd want to implement a stand-alone door (with C++, for instance) which could be used with any BBS software using a drop file.

    There are advantages and disadvantages to both approaches. With Synchronet JavaScript, you don't have to compile it and it would run wherever Synchronet runs. If it's in a compiled language (such as C++) for any BBS, you'd have to consider supporting it for multiple platforms. Releasing for Windows would be fairly easy, as you could just ship an executable, but for Linux and such, it may be better to ship the source code so the sysop could compile it on whatever distro they have to ensure it will run.

    Nightfox

    ---
    Synchronet Digital Distortion: digitaldistortionbbs.com
  • From echicken@VERT/ECBBS to Va7aqd on Thursday, May 09, 2019 05:32:00
    Re: Specialized membership list
    By: Va7aqd to All on Wed May 08 2019 16:44:37

    I was wondering how difficult it is to build an external program in Synchronet in Javascript where one would require a small
    database of user objects. In essence, what I want to build is a HAM Club membership door, but it would of course require handling
    a small DB of "people" along with other pertinent data that I have yet to

    items that might already be captured by the BBS - email
    address, DOB, mailing address, phone #, etc.

    Is it at all practical to do this in JS as a door?

    Sure, but there are many different approaches one could take to organizing the data.

    If your club members are also BBS users, then you can use their user records for whatever data is available there, as you mentioned. Additional data could be stored elsewhere, in a file or in per-user files, or in a JSON-DB.

    Lots more could be said about how to make this work.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-425-5435
    Synchronet electronic chicken bbs - bbs.electronicchicken.com
  • From Va7aqd@VERT/VA7AQDS to echicken on Thursday, May 09, 2019 04:42:00
    Re: Specialized membership list
    By: echicken to Va7aqd on Wed May 08 2019 10:32 pm

    If your club members are also BBS users, then you can use their user records for whatever data is available there, as you
    mentioned. Additional data could be stored elsewhere, in a file or in per-user files, or in a JSON-DB.

    Right - I think it would be fun to have members use the BBS for various things, but I wouldn't suggest anyone have to. So, perhaps
    some information could be pulled from particular users if they were on the BBS, but otherwise, it would be a mostly manually
    administered thing.

    I presume Synchronet doesn't provide anything for this itself, but I see some external programs get .json data files built, but
    these are handled from other included .js scripts? I guess the question is - is there anything provided in the entire Synchro
    suite that assists with .js data handling?

    ---
    Synchronet VA7AQD's Tavern - bbs.isurf.ca
  • From echicken@VERT/ECBBS to Va7aqd on Thursday, May 09, 2019 08:42:00
    Re: Specialized membership list
    By: Va7aqd to echicken on Wed May 08 2019 21:42:46

    I presume Synchronet doesn't provide anything for this itself, but I see some external programs get .json data files built, but these are handled from other included .js scripts? I guess the question is - is there anything provided in the entire Synchro suite that assists with .js data handling?

    A JS module running under Synchronet can natively read a JSON string from a file and parse it, and can serialize an object into JSON and write it to a file. This would involve using our File class to read and write, and the built-in JSON.parse and JSON.stringify methods for translation.

    You could also use INI files if your data structure is fairly flat. Or invent your own format or use CSV or whatever.

    You don't need to include any other .js files in your script to do any of the above.

    The JSON-DB does involve some other components, but they are included with your BBS. It takes a bit of extra setup, but also handles a lot of stuff you would need to do on your own otherwise. (No need to parse/stringify, or really do anything with JSON at all; in fact, the name of this database is a bit unfortunate even if it uses JSON on the back end.)

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-425-5435
    Synchronet electronic chicken bbs - bbs.electronicchicken.com
  • From Digital Man@VERT to Va7aqd on Thursday, May 09, 2019 10:50:00
    Re: Specialized membership list
    By: Va7aqd to All on Wed May 08 2019 04:44 pm

    Hi everyone,

    I'm not much of a programmer, but I think I would like to tinker with an ide had.

    I was wondering how difficult it is to build an external program in Synchron in Javascript where one would require a small
    database of user objects. In essence, what I want to build is a HAM Club membership door, but it would of course require handling
    a small DB of "people" along with other pertinent data that I have yet to fu define, but things like "Member since", and a field
    relating to being paid up for the current year, etc., along with other items that might already be captured by the BBS - email
    address, DOB, mailing address, phone #, etc.

    Is it at all practical to do this in JS as a door?

    Yes, totally. For the Synchronet BBS List module/door, I use a JSON file as a database. Works fine so long as you're not expecting a lot of concurrent modifications.

    digital man

    Synchronet "Real Fact" #46:
    Synchronet External X/Y/ZMODEM protocol driver (SEXYZ) was introduced in 2005. Norco, CA WX: 55.7F, 89.0% humidity, 1 mph SE wind, 0.00 inches rain/24hrs

    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From Digital Man@VERT to Va7aqd on Thursday, May 09, 2019 10:54:00
    Re: Specialized membership list
    By: Digital Man to Va7aqd on Thu May 09 2019 03:50 am

    Re: Specialized membership list
    By: Va7aqd to All on Wed May 08 2019 04:44 pm

    Hi everyone,

    I'm not much of a programmer, but I think I would like to tinker with an had.

    I was wondering how difficult it is to build an external program in Synch in Javascript where one would require a small
    database of user objects. In essence, what I want to build is a HAM Club membership door, but it would of course require handling
    a small DB of "people" along with other pertinent data that I have yet to define, but things like "Member since", and a field
    relating to being paid up for the current year, etc., along with other it that might already be captured by the BBS - email
    address, DOB, mailing address, phone #, etc.

    Is it at all practical to do this in JS as a door?

    Yes, totally. For the Synchronet BBS List module/door, I use a JSON file as database. Works fine so long as you're not expecting a lot of concurrent modifications.

    I should note: the JSON stuff is built into the JavaScript engine (nothing Synchronet-specific about it).

    Also the Synchronet File object has .ini file parsing built-into it, so if you a simple layout of your DB, that might be a good choice. There are lots of exmaples of both approaches included in the various *.*js files.

    digital man

    Synchronet "Real Fact" #86:
    Stephen and Rob have a fledgling podcast at http://techdorks.net (also iTunes). Norco, CA WX: 55.7F, 90.0% humidity, 2 mph SE wind, 0.00 inches rain/24hrs

    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net
  • From Va7aqd@VERT/VA7AQDS to echicken on Thursday, May 09, 2019 16:50:00
    Re: Specialized membership list
    By: echicken to Va7aqd on Thu May 09 2019 01:42 am

    The JSON-DB does involve some other components, but they are included with your BBS. It takes a bit of extra setup, but also
    handles a lot of stuff you would need to do on your own otherwise. (No need to parse/stringify, or really do anything with JSON
    at all; in fact, the name of this database is a bit unfortunate even if it uses JSON on the back end.)

    Thank you, sir! Yes, I suspect that's where I would wind up, especially considering Rob's comments in a later post.

    I think my plan of attack will be like so:

    - Write a 'hello world' .js, see if it will run under jsexec (maybe?)
    - Get the same program to run as a door and pause for input
    - Figure out how to get the basics going with json-db, write a single simple entry to a db
    - Read an entry from a db
    - Start working on user input/output, a real db structure, etc..

    I guess step #1 should be to actually read the Javascript guide linked to in the Synchro wiki - so, that's where I'm starting.
    Heh.

    ---
    Synchronet VA7AQD's Tavern - bbs.isurf.ca
  • From Va7aqd@VERT/VA7AQDS to Digital Man on Thursday, May 09, 2019 16:52:00
    Re: Specialized membership list
    By: Digital Man to Va7aqd on Thu May 09 2019 03:50 am

    Yes, totally. For the Synchronet BBS List module/door, I use a JSON file as a database. Works fine so long as you're not
    expecting a lot of concurrent modifications.

    Thanks for that, too! I am starting from scratch but hope to have some basics on what will probably be quite an interesting
    learning curve moving forward right away.

    ---
    Synchronet VA7AQD's Tavern - bbs.isurf.ca
  • From echicken@VERT/ECBBS to Va7aqd on Thursday, May 09, 2019 20:26:00
    Re: Specialized membership list
    By: Va7aqd to echicken on Thu May 09 2019 09:50:59

    Thank you, sir! Yes, I suspect that's where I would wind up, especially considering Rob's comments in a later post.

    I believe he was talking about reading and writing a JSON file, which is definitely an option for you. The JSON-DB does that behind the scenes if you use it.

    - Write a 'hello world' .js, see if it will run under jsexec (maybe?)

    Any of these will do, but the middle one is probably bestest:

    write('hello world');

    writeln('hello world');

    log('hello world');

    - Get the same program to run as a door and pause for input

    Look at methods of the 'console' object on the jsobjs page. Here's your chance to learn how to clear the terminal window, write a string on its own line, then pause.

    - Figure out how to get the basics going with json-db, write a single simple entry to a db - Read an entry from a db

    json-service.ini:

    [db_test]
    dir = ../temp

    mods/db-test.js:

    load('json-client.js');
    const json_client = new JSONClient('localhost', 10088);
    const write_this = { some: 'data' };
    json_client.write('db_test', 'test', write_this, 2);
    const read_this = json_client.read('db_test', 'test', 1);
    writeln(JSON.stringify(read_this));
    writeln(read_this.some);

    That's at least a start.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-425-5435
    Synchronet electronic chicken bbs - bbs.electronicchicken.com
  • From Va7aqd@VERT/VA7AQDS to echicken on Thursday, May 09, 2019 21:28:00
    Re: Specialized membership list
    By: echicken to Va7aqd on Thu May 09 2019 01:26 pm

    That's at least a start.

    Wow, many thanks! Maybe I can buy you a beer next time I'm out in 416-land.

    ---
    Synchronet VA7AQD's Tavern - bbs.isurf.ca