r/transprogrammer • • Sep 03 '22
writing a simple c/c++ library to handle web services
hi people! I (15 she/her) finally got a decent understanding of c++ and i'm trying to make a lightweight library to make web apps in c and cpp. I'd like to know what a web app needs, for now its pretty much basic, since it can handle get and post data, so yeah just the bare bones. when im done with it im gonna put it on github (even tho no one will use it rip) I dont have any knowledge of advanced things and I never worked, so plz dont get angry :)
46
Upvotes
10
u/secret_samantha Sep 03 '22
Maybe look up other web app libraries and try to recreate their features? Off the top of my head, account creation and login / log out would be cool!
5
u/Zethra Sep 04 '22
Some stuff web frameworks have:
This isn't a complete list and you don't need all of them. This is just a starting point.
Also a good web framework should be able to handle multiple requests at once either using a thread pool or async I/O.
4
u/ATotalPieceOfShit_ Sep 04 '22
Ok, I'm not 100% sure if I'm reading this right, but you're saying that you can already use GET and POST with your WebServer? If so, you can skip the first step.
(First you'll need to decide wether you wanna work on Linux or Windows, since networking works different on both, alternatively you can look for a library to do networking for you.)
After you've decided this, you'll need to think about what you want your WebApp to do. Since you're making a proper server maybe a chat service (tho that'd probably require WebSockets) or something else (sorry, am not rly creative).
After that it's worth thinking about how exactly you'll do things, since you're saying you wanna make a WebApp, you'll probably need to learn some JavaScript, to make the website the user sees (Frontend) communicate with your server (Backend), alternatively maybe WASM (Web Assembly) can be used? (Then you might be able to write Frontend code in C/C++) Tho I've got no clue here, since I've never used it and haven't looked to much into it either, sorry.
Featurewise you might wanna look into making:
and then obviously all the features your particular WebApp might need.
If any of my points are unclear, pls just ask for clarification, I'm always happy to help (tho I might take a bit to reply)
I'll update this comment if more comes to mind ^^
If I said anything wrong pls also correct me, I'm not too deep into this stuff rn, so I might've confused some terminology
-1
u/Maeve-transalt Sep 03 '22
Oh gods. If you already have c++ under your belt, just abandon it and learn python and flask if you want a web app. Or a real web framework that's based on JS. The transition should be easier than... well, other types of transitions.
0
u/[deleted] Sep 03 '22
[deleted] — view deleted comment