Hacker News new | ask | show | jobs
Show HN: A C++ web/application framework I have been building for the last 12yrs (github.com)
29 points by sumeetchhetri 1153 days ago
Back then there were not a lot of frameworks for C++ like there are available now, gradually added serialization, reflection, orm, modules for apache|nginx, then started adding programming language integration and then finally added support for building on various Os'es and also support for most of the build tools out there.
3 comments

I had to click through way too many links to finally find some code examples. The first page that contains at least some examples is the "Controllers" page in the wiki.

I think you should improve the README and include a showcase of how your framework works.

I really am not that great at documentation, you can find the various example applications https://github.com/sumeetchhetri/ffead-cpp/tree/master/web, for a comprehensive REST API example, you can see https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/t...

Agreed documentation is really poor, but I have really enjoyed building the framework and have never really been focusing on the docs, point taken, thanks.

Updated Readme as suggested on the project page, thanks again https://github.com/sumeetchhetri/ffead-cpp/blob/master/READM...
What would be the main drivers for using a C++ web framework? There must be a lot of gain for this pain?
For me, the main driver for using c++ with anything is performance. I use Drogon and its exceptional, there is some initial pain when you pick it up for the first time but that's probably the case with Rust alternatives as well. Once you set up and get used to how it works its a breeze to use, the CLI tool makes it easy to add web sockets and controllers, and it has very nice database and JSON integration as well, although I do use Rapidjson for heavy lifting rather than the default.

One of the big gains I have found is you end up with a really nicely structured, rock solid c++ project that is painless to return to even after 6 months, you just pick it up and go. I find coming back to python or javascript projects that I need to sit with the editor open for days before I can get a good handle on things and be productive again. As a solo dev that is important to me as moving between backend, frontend and data tools, you can only can keep one section loaded in Ape RAM at a time.

I’m about to start a new job, I’ve worked on and off at my current work place for about 13 years spread out over the last 20 years. We were an early start up and we did web development in c and then later c++ because the web browser and the database and web server and the os were all c/c++ so why wouldn’t we use it? We switched to c# and python and js/ts for new dev at some point because we couldn’t hire c++ devs at the same rates, that switch killed the company, but to us along time see it. Well the company’s not going to die, but it’s not going to be a software company anymore.

Our 20 year old c++ runs fine, and has been straight forward to extend. Everything else got caught up in endless cycles of framework updates and paradigm shifts, leaving slag heaps of angular 1 and early dot net abandonware, years of work dumped because dependencies and frameworks were out of support. It’s become such an unruly mess that if all goes to plan they’ll shut it all down, move on to a competitor technology, which I understand is all c++

Yeah web is pretty crazy, I only got into it recently but ive noticed that the major frameworks are not really rivals like their users, they are all sharing ideas and maybe it's converging towards a bit more stability. Im bullish on SolidJS to live up to the name, the creator Ryan Carniato has a wealth of knowledge in that area having been through the whole web roller coaster, and he is getting close to "this is how it should be done".
Notice that it's not the only C++ web framework (which means there are some use cases) : see for example https://www.webtoolkit.eu/wt
Web UI for embedded devices.
Performance, executable size, control and unexpected fun !!
This. Just a "Hello World" would go a long way. I still have not found the example yet.
REST API example - https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/t...

Template example - https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/m... & https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/d...

Dynamic C++ page example - https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/d...

Action based view example - https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/d... & https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/d...

XML driven configuration example - https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/d...

Annotation (#pragma) driven example - https://github.com/sumeetchhetri/ffead-cpp/tree/master/web/m...

ORM example - https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/d...

Caching example - https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/d...

Script execution example - https://github.com/sumeetchhetri/ffead-cpp/tree/master/web/d...

Programming language integration examples - https://github.com/sumeetchhetri/ffead-cpp/tree/master/lang-...

OS Build scripts - https://github.com/sumeetchhetri/ffead-cpp/tree/master/docke...

Cross compiling (android, mingw54, dockcross) - https://github.com/sumeetchhetri/ffead-cpp/tree/master/docke...

ffead-cpp modules - https://github.com/sumeetchhetri/ffead-cpp/tree/master/src/m...

ThreadPool - https://github.com/sumeetchhetri/ffead-cpp/tree/master/src/m...

Backend Server integration - https://github.com/sumeetchhetri/ffead-cpp/tree/master/src/s...

Server modules (apache/nginx/openlitespeed*) - https://github.com/sumeetchhetri/ffead-cpp/tree/master/modul...

Websocket example - https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/d...

Wefilter example - https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/d...

Webcontroller example - https://github.com/sumeetchhetri/ffead-cpp/blob/master/web/d...

Cron Jobs module - https://github.com/sumeetchhetri/ffead-cpp/tree/master/src/m...

SOLR-Zookeeper/Elasticsearch (Search module) - https://github.com/sumeetchhetri/ffead-cpp/tree/master/src/m...

Toy/Useless interpreter - https://github.com/sumeetchhetri/ffead-cpp/tree/master/src/m...

Solaris/BSD vagrant builds - https://github.com/sumeetchhetri/ffead-cpp/tree/master/vagra...

A Dumb code autogenerator - https://github.com/sumeetchhetri/ffead-cpp/blob/master/ffead...

All github workflows for build validations - https://github.com/sumeetchhetri/ffead-cpp/tree/master/.gith...

You should put these links directly in the first page of the README. But preferrably in a tutorial format:

Step 1: Code

Step 2: Compile and run

Keep on pushing my brother, highlight the strengths and usefulness of it and make your baby fly
Is there any reason you used kqueue directly instead of libdispatch for Darwin? Memory allocations?
My main intention was always to learn new things about C++ and hence I always tried to choose the path of maximum resistance and hence tried to work on lower level concepts with my limited abilities. So there is select, poll, dev/poll, event ports, kqueue, epoll, io_uring and i/o completeion ports, on various operating systems that you can use to build something to send/receive bits in/out of the wire. So this was more of a learning and building exercise rather than going with the best option available out there.