{"id":15068158,"url":"https://github.com/webstrugglers/super-frmwrk","last_synced_at":"2025-08-10T16:07:06.260Z","repository":{"id":242966981,"uuid":"804818331","full_name":"webstrugglers/super-frmwrk","owner":"webstrugglers","description":"HTTP Framework written in C++ for C++","archived":false,"fork":false,"pushed_at":"2025-02-02T16:38:09.000Z","size":3858,"stargazers_count":4,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-28T11:41:12.025Z","etag":null,"topics":["cpp","cpp17","framework","http","server"],"latest_commit_sha":null,"homepage":"https://webstrugglers.github.io/super-frmwrk/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webstrugglers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-23T10:30:00.000Z","updated_at":"2025-01-29T01:31:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"cdfc51a4-9aea-4a9e-85aa-4faa8d278e12","html_url":"https://github.com/webstrugglers/super-frmwrk","commit_stats":{"total_commits":99,"total_committers":5,"mean_commits":19.8,"dds":0.303030303030303,"last_synced_commit":"6242f3bcf129b09421c170a2ce14c70389503e4f"},"previous_names":["webstrugglers/super-frmwrk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/webstrugglers/super-frmwrk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webstrugglers%2Fsuper-frmwrk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webstrugglers%2Fsuper-frmwrk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webstrugglers%2Fsuper-frmwrk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webstrugglers%2Fsuper-frmwrk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webstrugglers","download_url":"https://codeload.github.com/webstrugglers/super-frmwrk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webstrugglers%2Fsuper-frmwrk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269748044,"owners_count":24469104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp17","framework","http","server"],"created_at":"2024-09-25T01:31:50.977Z","updated_at":"2025-08-10T16:07:06.223Z","avatar_url":"https://github.com/webstrugglers.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Super-framework (WIP)\n\nSuper is a lightweight and expressive HTTP framework for C++ inspired by Express.js, designed to be simple, efficient, and flexible. The framework provides easy-to-use routing, a built-in web server, and a powerful response API.\n\n## Table of Contents\n\n- [Features](#features)\n- [Example Usage](#example-usage)\n- [Architecture](#framework-architecture)\n- [Plans](#planned-features)\n- [Getting started](#getting-started)\n- [License](#license)\n\n## Features\n\n- **HTTP 1.0 Support**: The framework fully supports the HTTP 1.0 protocol, making it suitable for basic web applications.\n- **Static File Serving**: Serve static files from a specified directory effortlessly.\n- **Express.js-like Workflow**: The framework offers a familiar and straightforward workflow similar to Express.js.\n- **Easy Routing Mechanisms**: Define routes and handle HTTP methods with a clean and simple interface.\n- **Built-in Web Server**: The framework includes a built-in web server that uses blocking sockets with a timeout to manage connections.\n- **Thread-per-Request Model**: Each request is handled in its own thread, ensuring that the server remains responsive even under load. (Note: we don't use thread pool yet, but will implement it in the future)\n- **Simple Response API**: The response API is designed to be similar to Express.js, allowing you to send responses and set status codes with intuitive methods.\n- **Query Parameter Support**: Easily access and manipulate query parameters in your routes.\n\n## Example Usage\n\n```cpp\n#include \"server.hpp\"\n\n#define port 5000\n\nvoid hello_world(const Request\u0026 req, Response\u0026 res) {\n    res.send(\"Hello, world from handler function!!\").status(OK);\n}\n\nvoid init_router(Router\u0026 router) {\n    router.route(HTTP_GET, \"/handler\", hello_world);\n    router.serve_static(\"./public/\");\n}\n\nint main() {\n    Router router;\n    init_router(router);\n\n    Server server;\n    server.start(port, router);\n\n    return 0;\n}\n```\n\n## Framework architecture\n\nThe architecture is designed to be modular and efficient. Below is an overview of the main components:\n\n1. **Server**: Listens for incoming requests and delegates them to the dispatcher thread.\n2. **Dispatcher Thread**: Is responsible for reading data from the socket, processing the request, and sending a response.\n3. **Request Parser**: Parses the raw HTTP request and generates a request object.\n4. **Router**: Routes the request to the appropriate handler based on the URL.\n5. **handler**: Handles the logic for the request and prepares the response object (This is you).\n6. **Client**: Receives the serialized response object and processes the response.\n\n![Framework design](FRMWRKarch.png)\n\nThe handler functions must adhere to the following signature:\n\n```cpp\nvoid handler(const Request\u0026 req, Response\u0026 res) {\n    // body\n}\n```\n\n## Planned Features\n\n- **Route Parameters**: Support for dynamic route parameters (path variables in Spring Boot).\n- **Thread Pool**: Implement a thread pool to handle requests more efficiently under high load.\n- **HTTP 1.1 Support**: Add support for HTTP 1.1 to take advantage of persistent connections and other improvements.\n- **Middleware Support**: Introduce middleware to allow for more modular and reusable code.\n\n## Getting started\n\n1. Clone the repository\n\n```sh\ngit clone git@github.com:webstrugglers/super-frmwrk.git\ncd super-frmwrk\n```\n\n2. Build the framework\n\n```sh\nmake\n```\n\n3. Run\n\n```sh\n./superFrmwrk\n```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebstrugglers%2Fsuper-frmwrk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebstrugglers%2Fsuper-frmwrk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebstrugglers%2Fsuper-frmwrk/lists"}