Recent

Author Topic: webCRT unit: make simple web apps easy  (Read 6860 times)

bee

  • Sr. Member
  • ****
  • Posts: 393
webCRT unit: make simple web apps easy
« on: September 06, 2016, 10:19:43 am »
Hi all,

Let me introduce my fun project, webCRT unit. It's a server side web app utility unit to make simple CGI web app development easy, as easy as making classic console program. This unit is especially targetted to both pascal and web newbies who would like to try web app development. It's suitable for apps with single pass workflow, like a simple input → process → output flow. It's not recommended to use this unit to create complex or huge or interactive web applications.

A simple web app using webCRT unit can be as simple as this:

Code: Pascal  [Select][+][-]
  1. program webapp;
  2.  
  3. uses webCRT;
  4.  
  5. var
  6.   s: string;
  7.  
  8. begin
  9.   ClrScr;
  10.   webWrite('Type your name: ');
  11.   webReadln(s);
  12.   if isWebInput then
  13.     webWriteln('Hello, '+s+'… nice to see you!');
  14.   webReadln;
  15. end.

which would give you something like this: http://i.imgur.com/SzUyPzU.png (on an Android device).

However, anyone could also use the unit to make simple web apps without using huge and complex web frameworks, like for prototyping, or brain storming, or just to play around with some algorithms. Of course fpWeb, Brook, FastPlaz, or any web frameworks out there are great, but sometimes it's too complex and overkill to use them, especially when we just need to create a simple web app or service.

So, without further ado… here are the links to the source code and examples:
- webCRT unit source code: http://pak.lebah.web.id/viewcode.cgi?file=webCRT.pas
- features demo app: http://pak.lebah.web.id/webdemo.cgi

Some sample apps I've written using webCRT unit:
- word percentage calculator: http://pak.lebah.web.id/wordpc.cgi
- josephus problem: http://pak.lebah.web.id/josephus.cgi (explain here)
- 5n+1 vs 5n+3 problem: http://pak.lebah.web.id/collatz3t.cgi (discussed here)
- firebird access demo: http://pak.lebah.web.id/fbcrud.cgi (this is a bit complex)
- maybe there are some more, just take a look at my code repo here.

Those source code files above are also available through my gitHub here.

Since this unit is for newbies, don't expect any advance features or fancy look. It's created for simplicity, after all. Though you may modify the source code any way you like. And… as usual, no documentation is available yet. Just examine the source code. Sorry.

If you find anything wrong with my code or want to suggest something (necessary features, optimizations, anything), feel free to communicate them to me.

Enjoy and have fun! :D

Regards,

-Bee

P.S.
By the way… it's fun to look how my fad project went from just over a hundred lines of code at the beginning of this year, is now growing to over a thousand lines of code. I didn't think this unit would become this big. :D
-Bee-

A long time pascal lover.

apexcol

  • Jr. Member
  • **
  • Posts: 54
Re: webCRT unit: make simple web apps easy
« Reply #1 on: October 02, 2017, 08:57:41 am »
COOL

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: webCRT unit: make simple web apps easy
« Reply #2 on: February 21, 2018, 05:21:24 am »
WebCRT unit is just updated with some minor bug fixes, added a GIF demo to show the ease of use, and a brief how-to documentation. Unfortunately, the how-to doc is written in Indonesian language. Any help to translate it into English would be very much appreciated. Thank you.
-Bee-

A long time pascal lover.

linnemann

  • New Member
  • *
  • Posts: 34
Re: webCRT unit: make simple web apps easy
« Reply #3 on: February 26, 2018, 02:45:01 pm »
Hi

Have you implemented file uploading?

Would be an awesome to be able to upload a file, do some work spitting it back again.

Eg. convert png to jpg.

« Last Edit: February 26, 2018, 02:58:53 pm by linnemann »

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: webCRT unit: make simple web apps easy
« Reply #4 on: February 27, 2018, 01:33:43 am »
Have you implemented file uploading?

I don't think file upload is necessary for simple web apps. However, it's an open source project. Feel free to fork the project, add the feature you need, test it, and send a pull request. :)
-Bee-

A long time pascal lover.

linnemann

  • New Member
  • *
  • Posts: 34
Re: webCRT unit: make simple web apps easy
« Reply #5 on: February 27, 2018, 08:27:26 am »
Weeelll I think my example converting png to jpg would be a great example of how a simple web app could use file upload/download.

I understand you sentiment though, will see if I have the skills to do it properly.

 

TinyPortal © 2005-2018