Skip to content

Drogon is a high-performance C++ framework for developing web applications. Designed for modern C++ (C++17 and beyond), Drogon is fast, scalable, and supports both synchronous and asynchronous programming. With its robust feature set, it’s an excellent choice for building high-performance backend servers.

Notifications You must be signed in to change notification settings

alamjamal/drogoncpp_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drogoncpp_server

Drogon C++ Backend Server

Drogon is a high-performance C++ framework for developing web applications. Designed for modern C++ (C++17 and beyond), Drogon is fast, scalable, and supports both synchronous and asynchronous programming. With its robust feature set, it’s an excellent choice for building high-performance backend servers.

Features

  • High Performance: Optimized for speed and efficiency, making it one of the fastest C++ frameworks available.
  • Asynchronous and Synchronous Support: Flexible API design allows for both synchronous and asynchronous request handling.
  • Built-in ORM: Simplifies database interactions with an easy-to-use Object-Relational Mapping (ORM) system.
  • Template Engine: Supports embedded template languages for dynamic HTML generation.
  • Full HTTP/HTTPS Support: Comprehensive support for HTTP and HTTPS protocols, including WebSocket.
  • RESTful API: Native support for creating RESTful APIs, including routing and parameter handling.
  • Middleware Support: Easily extend functionality with custom middleware.
  • Cross-Platform: Works seamlessly on Linux, macOS, and Windows.

Getting Started

Prerequisites

  • C++17 compatible compiler (e.g., GCC 7+, Clang 5+, MSVC 2017+)
  • CMake 3.10+
  • Boost libraries
  • OpenSSL (for HTTPS support)

Installation

  1. Clone the Repository:

    git clone https://github.com/alamjamal/drogoncpp_server/
    cd drogon-backend-server
  2. Build the Project:

    mkdir build
    cd build
    cmake ..
    make
  3. Run the Server:

    ./drogon_backend_server

Basic Usage

Drogon allows you to define routes and handlers in a clean and straightforward manner.

#include <drogon/drogon.h>

int main() {
    // Define a simple route
    drogon::app().registerHandler("/hello",
        [](const drogon::HttpRequestPtr &req,
           std::function<void (const drogon::HttpResponsePtr &)> &&callback) {
            auto resp = drogon::HttpResponse::newHttpResponse();
            resp->setBody("Hello, Drogon!");
            callback(resp);
        });

    // Run the app
    drogon::app().run();
    return 0;
}

Directory Structure

drogon-backend-server/
├── CMakeLists.txt
├── src/
│   ├── main.cpp
│   ├── controllers/
│   │   ├── example_controller.h
│   │   └── example_controller.cpp
│   ├── models/
│   │   ├── example_model.h
│   │   └── example_model.cpp
│   └── views/
│       ├── example_view.html
├── include/
│   ├── example_header.h
└── README.md

Documentation

For detailed documentation, please refer to the Drogon official documentation.

Contributing

We welcome contributions to enhance Drogon. To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Commit your changes.
  4. Push your branch and create a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For any questions or suggestions, feel free to open an issue or contact us at [[email protected]].


Drogon C++ Backend Server - Fast, scalable, and modern C++ web framework. Start building your high-performance backend today!

About

Drogon is a high-performance C++ framework for developing web applications. Designed for modern C++ (C++17 and beyond), Drogon is fast, scalable, and supports both synchronous and asynchronous programming. With its robust feature set, it’s an excellent choice for building high-performance backend servers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published