diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 2c0cd5c..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "extern/pybind11"] - path = extern/pybind11 - url = https://github.com/pybind/pybind11.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 18d3e31..d2eac86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,9 +15,6 @@ endif() # Include directories include_directories(${PROJECT_SOURCE_DIR}/src) include_directories(${PROJECT_SOURCE_DIR}/src/cimi) -include_directories(${PROJECT_BINARY_DIR}/extern) -include_directories(${PROJECT_BINARY_DIR}/extern/pybind11) -include_directories(${PROJECT_BINARY_DIR}/extern/pybind11/pybind11) # Source files set(SOURCES @@ -44,5 +41,3 @@ add_executable(CimiWeb ${SOURCES} examples/src/server.cpp ) - -configure_file(${PROJECT_SOURCE_DIR}/examples/public/index.html ${CMAKE_CURRENT_BINARY_DIR}/index.html COPYONLY) \ No newline at end of file diff --git a/README.md b/README.md index 1797104..d57238c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Cimi Web + A C/C++ micro framework for building web applications. The idea is to create a minimalistic framework in c++ and CMake to make it as easy as possible. @@ -6,16 +7,23 @@ The framework must handle Servers and Web Sockets. And be as easy to use and possible with simple download to be used ## How to run in C++ + To run server just execute [shell script](https://github.com/Yggdrasill501/cimi-web/blob/main/server.sh) + ``` server.sh ``` + If you're having a struggle running server.sh, remember to give it the correct permission. + ``` chmod +x server.sh ``` -### Examples + +### Examples + - Simple Server implementation + ```c++ //// For Server listening int main() { @@ -32,6 +40,7 @@ int main() { ``` - Simple Client connection + ```c++ //// For Client connection int main() { @@ -54,22 +63,21 @@ int main() { - For more Examples check [./examples/](https://github.com/Yggdrasill501/cimi-web/tree/main/examples) ## Import as python package + ```zsh pip install cimi-web ``` -```python -import cimi -``` - ## Motivation + You may ask where is the motivation coming from? It's coming to understand and to handle the best way how to handle back-end and api development, and since C/C++ is probably the most abstract way to do it your self. ## BTW -The Motivation of this project was to make it as simple as possible. -Simplicity is always found in minimalism, + +The Motivation of this project was to make it as simple as possible. +Simplicity is always found in minimalism, so for the whole project I was using neovim, and if you wish to see my simple config visit [Neovim Setup](https://github.com/Yggdrasill501/yggdrasill501_nvim_setup). After this I can say, "I USE NEOVIM BTW!!!" diff --git a/examples/public/GithubButton.png b/examples/public/GithubButton.png deleted file mode 100644 index e2ee55c..0000000 Binary files a/examples/public/GithubButton.png and /dev/null differ diff --git a/examples/public/LinkedInButton.png b/examples/public/LinkedInButton.png deleted file mode 100644 index d67e970..0000000 Binary files a/examples/public/LinkedInButton.png and /dev/null differ diff --git a/examples/public/MenuIcon.png b/examples/public/MenuIcon.png deleted file mode 100644 index ab2a9d7..0000000 Binary files a/examples/public/MenuIcon.png and /dev/null differ diff --git a/examples/public/favicon.png b/examples/public/favicon.png deleted file mode 100644 index 20a025d..0000000 Binary files a/examples/public/favicon.png and /dev/null differ diff --git a/examples/public/header-image.png b/examples/public/header-image.png deleted file mode 100644 index fd35247..0000000 Binary files a/examples/public/header-image.png and /dev/null differ diff --git a/examples/public/index.html b/examples/public/index.html deleted file mode 100644 index 7a394af..0000000 --- a/examples/public/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - Yggdrasill501's Portfolio - - -
-

I am a heading

-

I am paragraph

-
- - diff --git a/examples/public/manifest.json b/examples/public/manifest.json deleted file mode 100644 index 080d6c7..0000000 --- a/examples/public/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/examples/public/robots.txt b/examples/public/robots.txt deleted file mode 100644 index e9e57dc..0000000 --- a/examples/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/examples/src/main.py b/examples/src/main.py deleted file mode 100644 index 0a5d883..0000000 --- a/examples/src/main.py +++ /dev/null @@ -1,6 +0,0 @@ -import cimi - - -if __name__ == '__main__': - cimi.app.runServer() - cimi.app.runClient() diff --git a/setup.py b/setup.py deleted file mode 100644 index d21806e..0000000 --- a/setup.py +++ /dev/null @@ -1,20 +0,0 @@ -from setuptools import setup, Extension -from pybind11.setup_helpers import Pybind11Extension, build_ext -import pybind11 - -setup( - name="Cimi-Web", - version="0.1", - author="Filip Žitný", - description="The C++ micro framework for building web applications.", - ext_modules=[ - Extension( - 'cimi', - ['wrapper.cpp', 'client.cpp', 'server.cpp', 'socket.cpp'], - include_dirs=[pybind11.get_include()], - language='c++', - extra_compile_args=['-std=c++17'], - ), - ], - zip_safe=False, -) \ No newline at end of file diff --git a/src/wapper.cpp b/src/wapper.cpp deleted file mode 100644 index 639f13d..0000000 --- a/src/wapper.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// Created by Filip Žitný on 03/02/2024. -// -#include -#include -#include -#include -#include -#include - -namespace py = pybind11; - -PYBIND11_MODULE(cimi,m) { - - m.doc() = "The C++ micro framework for building web applications."; - m.def("add", &add, "A function that adds two numbers"); - - py::class_(m, "Client") - .def(py::init<>()) - .def("connect_server", &Client::connectToServer) - .def("send_message", &Client::sendMessage) - .def("parse_address", &Clinet::parseAddress); - - py::class_(m, "Server") - .def(py::init<>()) - .def("run_server", &Server::runServer); - - py::class_(m,"Socket") - .def(py::init<>()) - .def("get_sock_fd", &Socket::getSockfd) - .def("create", &Socket::create) - .def("bind_socket", &Socket::bindSocket) - .def("listen_socket", &Socket::listenSocket) - .def("accept_connection", &Socket::acceptConnection) - .def("connect_server", &Socket::connectToServer) - .def("parse_address", &Socket::parseAddress); - - py::class_(m,"HtmlLHandler") - .def("read_html", &HtmlLHandler::readHtmlFile); - - py::class_(m,"Cimi") - .def("run_server",&App::runServer) - .def("run_client", &App::runClient) - .def("run", &App::run); -} -