webpp
webpp copied to clipboard
C++ web framework | web development can be done with C++ as well.
WEB++ (C++ Web Framework)
This is a web framework written in C++ and hopefully will be used by other programming languages other than C++ too.
It's being developed. News will be shared on Telegram.
This project on:
Look at the Core Readme file for the core concepts of the project.
Project goals
- To remove the necessity for dealing with low-level networking APIs
- Cross-Platform: no need to deal with OS-specific APIs
- Modular: to use other people's written apps and modules in your code easily
- Cross-Protocol: Remove the necessity for dealing with specific protocols (CGI/FCGI/...)
- Cross-Database-API: being able to access wide range of databases without dealing with DB-specific APIs and switch between them in the config files instead of changing the code itself.
- Parallelization Access: being able to compute things in parallel easily
- Implement Common Patterns easily
What can you should be able to do with this library?
The project is still in development, but this framework should be able to help you with these kinda projects someday:
- Develop a static/dynamic website easily in C++
- Using other people's already written websites/modules/components in your app
- Writing long-runnig web apps and store temporary data in variables instead of database (not all languages can do that)
Why C++?
The most question that I get while talking to other developers is why C++? Well there are multiple answers:
- C++ does have the potential specially the newer versions of C++
- Having full power of C++ and your OS at your disposal
- WebAssembly is getting stronger, you will be able to write both back-end and front-end in the same language with C++ (even though you already can if you choose JavaScript for example, but here's another option)
- Has the potiential to be faster than other languages
- C++ can be easy if the library is easy to use.
- Using modern C++ is fun
- Compile-Time computation is something that youeither can't achive or it's going to be difficult to achieve in other languages
- Remove the necessity to learn other languages if you're already familiar with C++
- Using older codes in your project more easily
- Multi-threading access: not all languages provide that access easily specially in a web framework
Dependencies
These are the dependencies this project requires for certain parts of the project to function properly. Some of these libraries haven't been integrated into the project yet since we're still working on this project.
Some of these dependencies can replace other dependencies; the difference is usually in their performance but other factors are in play as well.
boost(you don't need it for the core)boost::asioorasio(for FastCGI and Self-Hosted interfaces only)boost::beast(optional) (for benchmarking only)fmt: as a fallback forstd::formateve(optional): for better performance with SIMDopenssl(used by asio)- (optional) for
gzipsupport one of these:zlib(optional)zlib-ng(optional)crypto++(optional)libdeflate(optional)
zstd(optional): forzstdcompression supportbrotli(optional): forbrcompression supportCTRE(optional): compile-time-regular-expressionmodp_64: modified version is included in the sources
Development
You can help us develop this project if you're familiar with C++ programming language and web development. Even if you're not really good at web development but you know C++ very well, specially C++17 and C++20 (clang and gcc c++2a is enough), then we have lots of things that you can help with which doesn't have anything to do with web development directly.
I'd appreciate any help of any kind. Even if you're not interested in coding, here are some ways you can help out:
- Writing tests; I dare you to make me mad by writing too much tests 😁
- Writing benchmarks: I write lots of benchmarks (even outside the scope of this project) to make sure I'm using the right tool/library/feature/class/template/... .
- Make jokes: make (not) funny jokes in our @webpp_discuss group
- Share ideas: I have plenty of ideas, and I want more.
- Report bugs: you can find me in the @webpp_discuss group; report the bugs there; or open issues on github/gitlab.
- Financial support: this project is open-source; we'll need some money for hosting and advertising.
- Share on social-media: I'll appreciate any shout-out about this project; even if you give a bad feedback.
- Learn &/ Teach: we can teach you and also learn from you; so let's talk code!
- Suggest someone who can help: I'd appreciate any help on finding people who can help in any way.
- Write documentation: writing documentation is so much fun that I don't want to do it alone! 😂
Examples
In the examples directory you can find examples. That's not much but it'll give you they high level viewpoint. Take a look at them and you can be sure that we'll try to write tests for all of them; so if you read tests, you'll learn even more about the project.
Tests
We currently use googletest library for unit/integrated testing. This might change in a few years though.
There are many tests you can read, confirm, fix, and/or write. They are the perfect place to start learning about the project after the examples.
You currently can run tests just by running the webpptest executable. It's as easy as that.
Benchmarks
Benchmarks are done for us developers so we know which tool/class/implementation/library/framework/solution that we choose is the best. Currently we are using Googles' mini-benchmark library for this purpose.
Documentation
We don't have a documentation/tutorial/guide at this point. You can help us write one. We're just too busy writing the code that we don't have much time writing documentations at this point. But you can be sure from the point that this project becomes production-ready, we'll have documentations.
Build
Requirements for building and testing:
- At least C++20 (we will be using C++20/23/... as they come and deprecate old versions)
- CMake
- Boost
- Googletest (gtest)
git clone https://gitlab.com/webpp/webpp.git --depth=1
cd webpp/
mkdir build/
cd build
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
ninja
sudo ninja install # needed only for building the examples
And then in order to run the tests, you just have to run the webpptest binary in that directory. You don't need to build tests individually but you have to build examples individually; but this may change when we hit our first production-ready version.