http://www.dothrb.com
Sorry if I use the list, but after my reply to a question here, many
are asking info about dothrb. We have created the Google Group dothrb.
You're invited to join it if you want to discuss about dothrb.
We created dothrb (dothrb.com) for our internal use and to allow our
customers to easily create in-house extensions to our applications.
We have never advertised it as a standalone product since a market
research showed that it would have been hard to repay the costs of
documentation, support and administration so it was always part of our
ERP suite.
Just a quick summary of what actually dothrb is ( and is not ) so you
can decide if it can be of your interest:
- IS a set of binaries and templates available for Linux/OSX/Win
- IS NOT a library
- DOESN'T NEED a C compiler
- DOESN'T NEED hbmk2
- CAN work WITHOUT Harbour or nodejs ( but with them it can do more )
- IS an HTTP multi threading server ( can serve html/css/js directory
without any configuration )
- CAN use the harbour binary ( as an external command ) to compile
prgs into hrbs
- CAN load and execute hrbs
- CAN do CRUD to DBFs without any code
- CAN use nodejs/express proxy to serve https
- CAN be chained to node express/graphql to server DBfs data to graphql clients
- CAN access Postgresql and/or SQLite data
- CAN create PDFs/XLSX/DOCX/XML
- ....
- BUT IT CAN'T AUTOMAGICALLY convert text/GUI code to modern
web/iOS/Android apps.
other tools of the set are:
- dotcmd = the development tool ( init, clean, build, dist, ... )
- dotdbf = dbf manager ( create, index, zap, select, append )
- dotsql = sql manager ( import dbf, execute sql, ... tested with
Postgresql and SQlite )
- dotcln = http client ( get, post, delete, ... )
dothrb has been developed and tested in the last 7 years and has been
designed and tested for 24x7x365 reliability ( in a Linux box with
50-200 concurrent users )
Just few use cases:
- serve DBF from a prg
// server.prg
#include "dothrb.ch"
class server
var cName
method init
endclass
method init()
_Server:clearRoutes()
_Server:setRoute( "get", "/myfunc", { || myfunc() } )
return this
static function myfunc()
local aTest := {}
local cDbfFile := hb_cwd() + "data" + hb_ps() + "test.dbf"
rddSetDefault( "DBFCDX" )
dbusearea( true,, cDbfFile, "test", true, true )
if neterr()
console.log( "Error opening file")
endif
test->( dbeval( { || aadd( atest, alltrim(field->first) )}) )
use
return _Ok( "application/json", hb_jsonencode( aTest ) )
- simple CRUD on single DBF without code
GET: http://<ip>:<port>/dbf/test?seek='Doe'&order='1'&fields=last,first,street
returns a json like { last="Doe", first="John", street="1st avenue" }
POST: for dbappend
DELETE for dbdelete
PUT/PATCH dbeval/fieldput
- can be called from node/express using f.e. axios
- can be use node/express as proxy for https
- it can "automatically" creates html forms and tables using BootStrap:
a form:
...
cHtml := rows2HtmlForm( { "form-file" => "shared/show.html", ;
"rows" => ::oModel:read( hFind ), ;
"properties" => ::oModel:getDataProps() ;
} )
...
a table:
...
cHtml := rows2HtmlTable( { "rows" => ::oModel:read( hFind ), ;
"properties" => ::oModel:getDataProps(), ;
"checkboxes" => "id", ;
"usefooter" => "no", ;
"idfield" => "id", ;
"actions" => _stdRow_Actions(), ;
"msgtexts" => { "empty-table" => "Empty table", ;
"check-column" => "Select", ;
"action-column" => "Actions", ;
"idfield-not-found" => "idfield not found" } ;
} )
...
where dataProps is a json like:
{
"fields": {
"id": {
"field": "id",
"label": "Id",
"type": "+",
"len": 4,
"dec": 0,
"picture": "@X",
"attributes": "type=\"text\" readonly"
},
"title": {
"field": "title",
"label": "Title",
"type": "C",
"len": 30,
"dec": 0,
"picture": "@X",
"attributes": "type=\"text\""
},
...
created by dotdbf
and many other things for example:
- we create IOS/Android apps using React Native to run our prg code
and access our DBFs
- using dotsql we import our DBFs into Postgresql servers to and use
dothrb to show charts using google-charts, create dashboards for
sales, inventory and so on.
best regards,
Lorenzo Fiorini
Saudações,
Itamar M. Lins Jr.