{"id":21657594,"url":"https://github.com/sourcemeta-research/native","last_synced_at":"2025-03-20T05:22:04.836Z","repository":{"id":263008711,"uuid":"791520097","full_name":"sourcemeta-research/native","owner":"sourcemeta-research","description":"The Native Framework. Build a desktop applications with C++","archived":false,"fork":false,"pushed_at":"2024-11-21T16:11:30.000Z","size":142,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T07:07:24.194Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcemeta-research.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}},"created_at":"2024-04-24T21:33:32.000Z","updated_at":"2024-11-21T16:11:33.000Z","dependencies_parsed_at":"2024-11-15T15:41:05.714Z","dependency_job_id":"d19018eb-a870-464a-b455-1b03794cb1b2","html_url":"https://github.com/sourcemeta-research/native","commit_stats":null,"previous_names":["sourcemeta-research/native"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta-research%2Fnative","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta-research%2Fnative/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta-research%2Fnative/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta-research%2Fnative/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcemeta-research","download_url":"https://codeload.github.com/sourcemeta-research/native/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244554884,"owners_count":20471316,"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","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":[],"created_at":"2024-11-25T09:27:11.915Z","updated_at":"2025-03-20T05:22:04.815Z","avatar_url":"https://github.com/sourcemeta-research.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg width=\"300px\" src=\"./assets/logo.png\" alt=\"native framework logo\"/\u003e\u003c/p\u003e\n\u003ch1 align=\"center\"\u003enative\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eBuild your Desktop application with C++\u003c/h3\u003e\n\nNative is a C++ framework designed to streamline the development of native applications for C++ developers.\n\n\u003e ✋ Native is currently available in alpha for macOS and Windows, but *it is not production ready*!\n\n## ✨ Features\n\n-  🚀 **Modern C++ API**: Streamlined API for modern C++.\n-  🛠 **CMake Integration**: Seamless integration with CMake projects.\n-  📦 **Packaging Ready**: Includes code signing for macOS (notarization is comming)\n-  🧩 **Modular Architecture**: Opt-in modules for tailored functionality.\n\n### Roadmap\n\n#### `ui`\n\n| Module       | macOS Support       | Win32 Support       | Notes                                                           |\n|--------------|---------------------|---------------------|-----------------------------------------------------------------|\n| **Window**   | ✅ Supported        | ✅ Supported        | Basic window creation and management                            |\n| **WebView**  | ✅ Supported        | ✅ Supported        | Embeds web content in a native app                              |\n| **Menu**     | 🚧 Planned          | 🚧 Planned          | Application menus                                               |\n| **IPC**      | 🚧 Planned          | 🚧 Planned          | Communication channel between the main process and the Webview. |\n| **Tray**     | 🚧 Planned          | 🚧 Planned          | System tray icons and context menus                             |\n\n#### `sysmod`\n\n| Module           | macOS Support       | Win32 Support       | Notes                                         |\n|------------------|---------------------|---------------------|-----------------------------------------------|\n| **Open**         | 🚧 Planned          | 🚧 Planned          | Open URLs, URIs, and files                    |\n| **Storage**      | 🚧 Planned          | 🚧 Planned          | Key-value storage for app data                |\n| **HTTP Client**  | 🚧 Planned          | 🚧 Planned          | Send HTTP requests, handle responses          |\n\n## Getting Started with Native using CMake\n\n1. Code!\n\nCreate these three files at the root of your project.\n   \n```cc\n// main.cc\n#include \u003csourcemeta/native/application.h\u003e\n#include \u003csourcemeta/native/webview.h\u003e\n#include \u003csourcemeta/native/window.h\u003e\n\n#include \u003cexception\u003e\n#include \u003ciostream\u003e\n\nclass App : public sourcemeta::native::Application {\npublic:\n  auto on_start() -\u003e void override { std::cout \u003c\u003c \"Starting!\" \u003c\u003c std::endl; }\n\n  auto on_ready() -\u003e void override {\n    std::cout \u003c\u003c \"Ready!\" \u003c\u003c std::endl;\n\n    window.size(1200, 900);\n    window.show();\n\n    webview.load_html(\"index.html\");\n    window.add(webview);\n\n    this-\u003eexit();\n  }\n\n  auto on_error(std::exception_ptr) noexcept -\u003e void override {}\n\nprivate:\n  sourcemeta::native::Window window;\n  sourcemeta::native::WebView webview;\n};\n\nNATIVE_RUN(App)\n```\n\n```html\n\u003c!-- index.html --\u003e\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003ctitle\u003eNative Framework\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" href=\"style.css\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003ch1\u003eWelcome to Native\u003c/h1\u003e\n  \u003cp\u003eThis is a simple example to demonstrate loading HTML with CSS styling.\u003c/p\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n```css\n/* style.css */\nbody {\n    font-family: Arial, sans-serif;\n    margin: 0;\n    padding: 0;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    height: 100vh;\n    background-color: #f0f0f0;\n}\nh1 {\n    color: #333;\n}\np {\n    color: #666;\n}\n```\n\n2. Configure!\n\n```cmake\ncmake_minimum_required(VERSION 3.14)\n\nproject(my_hello_world)\n\nset(CMAKE_CXX_STANDARD 20)\nset(CMAKE_CXX_STANDARD_REQUIRED ON)\nset(CMAKE_CXX_EXTENSIONS OFF)\n\nfind_package(Native REQUIRED)\n\nnative_add_app(\n    TARGET hello_world_app\n    PLATFORM desktop\n    SOURCES hello_world.cc)\n\nnative_add_assets(\n    TARGET hello_world_app\n    ASSETS index.html style.css)\n\nnative_set_profile(\n    TARGET hello_world_app\n    NAME \"example_hello_world\"\n    IDENTIFIER \"com.native.example_hello_world\"\n    VERSION \"1.0.0\"\n    DESCRIPTION \"My app ...\"\n    CODESIGN_IDENTITY \"W4MF6H9XZ6\"\n    MODULES \"ui/window\" \"ui/webview\")\n```\n\n\n3. Build!\n\n```shell\ncmake -S . -B ./build \n\ncmake --build ./build\n```\n\n4. Enjoy!\n\nThe application is available in the `/dist` folder of your current directory.\n\nhttps://github.com/user-attachments/assets/fba80492-d42d-4f9c-be3b-34ce6c1eabbf\n\n## Contributing\n\nWe welcome contributions to this project! To get started, please follow these steps.\n\n### Prerequisites\n\nMake sure you have the following tools installed:\n\n- [CMake](https://cmake.org/)\n\n### Building the Project\n\n1. **Clone the repository**:\n    ```sh\n    git clone https://github.com/sourcemeta-research/native.git\n    cd native\n    ```\n    \n2. **Install dependencies**:\n    ```sh\n    git clone https://github.com/sourcemeta-research/native.git\n    cd native\n    ```\n\n3. **Configure and build the project**:\n    We use a Makefile to handle the build process, which in turn uses CMake. Simply run:\n    ```sh\n    make\n    ```\n\n    This will configure the project, build the necessary files, and run the executable.\n\n4. **Running the Executable**:\n    After building the project, you can run the executable to ensure everything is working as expected:\n    ```sh\n    make test\n    ```\n\n    The `make` command will handle this for you and check the exit status of the executable.\n\nWe highly advise you to explore and play with the project inside the `/example` folder.\n\n### Cleaning Up\n\nTo clean the build directory, run:\n```sh\nmake clean\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcemeta-research%2Fnative","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcemeta-research%2Fnative","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcemeta-research%2Fnative/lists"}