Skip to content

Commit 2ee12e2

Browse files
committed
📌 Nodepp | Stable Release | V1.0.0 📌
1 parent c526d3a commit 2ee12e2

File tree

247 files changed

+17612
-8919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+17612
-8919
lines changed

CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cmake_minimum_required(VERSION 4.0.0)
2+
3+
project(nodepp VERSION 1.0.0)
4+
5+
set(CMAKE_CXX_STANDARD 17)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
8+
9+
set(NODEPP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
10+
11+
# Search for OpenSSL
12+
find_package(OpenSSL REQUIRED COMPONENTS Crypto SSL)
13+
if(NOT OpenSSL_FOUND)
14+
message(FATAL_ERROR "OpenSSL not found. Please install OpenSSL development files.")
15+
endif()
16+
17+
# Search for ZLIB
18+
find_package(ZLIB REQUIRED)
19+
if(NOT ZLIB_FOUND)
20+
message(FATAL_ERROR "ZLIB not found. Please install ZLIB development files.")
21+
endif()

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
[Nodepp's Report Page](http://nodepp.xyz/report).
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 NODEPP
3+
Copyright (c) 2023 The Nodepp Project Authors. All Rights Reserved.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 140 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,165 @@
1-
# Node++
1+
# Nodepp
22

3-
**Node++** is an innovative open source project that aims to make it easier to create applications in **C++**. This project introduces a high-level abstraction layer that allows developers to write **C++** code in a way that is similar to how they would write code in **NodeJS**. With **Node++**, developers can leverage the advantages of the **C++** language while benefiting from the ease of use and flexibility that **NodeJS** offers. This unique combination of features makes **Node++** a powerful tool for creating high-performance and scalable applications. Additionally, since it is an open source project, anyone can contribute and improve **Node++** to fit their specific needs.
3+
Nodepp is a groundbreaking open-source project that simplifies C++ application development by bridging the gap between the language's raw power and the developer-friendly abstractions of Node.js. By providing a high-level API, Nodepp empowers developers to write C++ code in a familiar, Node.js-inspired style.
44

5-
- **uNode++:** compatible with embed devices [here](https://github.com/EDBCREPO/uNODEPP)
6-
- **Node++:** compatible with PC and esp32 [here](https://github.com/EDBCREPO/NODEPP)
5+
One of the standout features of Nodepp is its 100% asynchronous architecture, powered by an internal Event Loop. This design efficiently manages Nodepp’s tasks, enabling you to develop scalable and concurrent applications with minimal code. Experience the power and flexibility of Nodepp as you streamline your development process and create robust applications effortlessly!
76

87
## Dependencies
9-
- Openssl `sudo apt install libssl-dev`
10-
- Zlib `sudo apt install zlib1g-dev`
8+
```bash
9+
# Openssl
10+
🪟: pacman -S mingw-w64-ucrt-x86_64-openssl
11+
🐧: sudo apt install libssl-dev
12+
13+
# Zlib
14+
🪟: pacman -S mingw-w64-ucrt-x86_64-zlib
15+
🐧: sudo apt install zlib1g-dev
16+
```
17+
18+
## Features
1119

12-
## Key Features
20+
- 📌: **Node.js-like API:** Write C++ code in a syntax and structure similar to Node.js, making it easier to learn and use.
21+
- 📌: **High-performance:** Leverage the speed and efficiency of C++ for demanding applications.
22+
- 📌: **Scalability:** Build applications that can handle large workloads and grow with your needs.
23+
- 📌: **Open-source:** Contribute to the project's development and customize it to your specific requirements.
1324

14-
- Allows writing C++ code as if writing in NodeJS
15-
- Adds a high-level abstraction layer to simplify C++ application development
16-
- Includes an event loop that can handle multiple events and tasks on a single thread of execution
17-
- Supports coroutines, which allows running multiple tasks concurrently on a single thread
18-
- Includes support for TCP, TLS, UDP, HTTP, and HTTPS, making it easy to create networked applications
19-
- Includes a regular expression engine for processing and manipulating text strings
20-
- Compatible with several platforms, including Windows, macOS, Linux, ESP32, and ESP8266
21-
- Open source project, meaning anyone can contribute and improve it
22-
- Has extensive documentation and an active community of developers willing to help
25+
## Bateries Included
2326

24-
## Installation
27+
- 📌: Include a **build-in JSON** parser / stringify system.
28+
- 📌: Include a **build-in RegExp** engine for processing text strings.
29+
- 📌: Include Support for **UTF** manipulation | **UTF8 - UTF16 - UTF32**
30+
- 📌: Include a **build-in System** that make every object **Async Task** safety.
31+
- 📌: Include a **Smart Pointer** base **Garbage Collector** to avoid **Memory Leaks**.
32+
- 📌: Include support for **Reactive Programming** based on **Events** and **Observers**.
33+
- 📌: Include an **Event Loop** that can handle multiple events and tasks on a single thread.
34+
- 📌: Include support for **TCP | TLS | UDP | HTTP | WS** making it easy to create networked applications.
35+
- 📌: Include Support for **Poll | Epoll | Kqueue | WSAPoll** making it easy to handle multiple file descriptors.
2536

37+
## Build & Run
2638
```bash
27-
g++ -o main main.cpp -I ./include ; ./main
39+
🐧: g++ -o main main.cpp -I ./include ; ./main
40+
🪟: g++ -o main main.cpp -I ./include -lws2_32 ; ./main
2841
```
2942

30-
## Usage
43+
## Examples
44+
### Hello world
45+
```cpp
46+
#include <nodepp/nodepp.h>
47+
48+
using namespace nodepp;
3149

32-
To use **Node++**, simply include the `node++.h` header file in your project and start writing **C++** code as if you were writing in **NodeJS**. Here's a simple example:
50+
void onMain() {
51+
console::log("Hello World!");
52+
}
3353

54+
// note that we are using onMain() instead of main()
55+
```
56+
57+
### HTTP Client
3458
```cpp
35-
#include <node++/node++.h>
59+
#include <nodepp/nodepp.h>
60+
#include <nodepp/http.h>
3661

37-
using namespace nodepp;
62+
using namespace nodepp;
3863

39-
void _Ready() {
40-
console::log("Hello World!");
41-
}
64+
void onMain(){
65+
66+
fetch_t args;
67+
args.method = "GET";
68+
args.url = "http://www.google.com/";
69+
args.headers = header_t({
70+
{ "Host", url::host(args.url) }
71+
});
72+
73+
http::fetch( args )
74+
75+
.then([]( http_t cli ){
76+
console::log( stream::await( cli ) );
77+
})
78+
79+
.fail([]( except_t err ){
80+
console::error( err );
81+
});
82+
83+
}
4284
```
4385

44-
Examples - [here](https://github.com/EDBCREPO/NODEPP/tree/main/examples)
86+
### HTTP Server
87+
```cpp
88+
#include <nodepp/nodepp.h>
89+
#include <nodepp/http.h>
90+
#include <nodepp/date.h>
91+
92+
using namespace nodepp;
93+
94+
void onMain(){
95+
96+
auto server = http::server([=]( http_t cli ){
97+
98+
console::log( cli.path, cli.get_fd() );
99+
100+
cli.write_header( 200, header_t({
101+
{ "content-type", "text/html" }
102+
}));
103+
104+
cli.write( date::fulltime() );
105+
cli.close(); // optional | GC automaticaly close unused sockets
106+
107+
});
108+
109+
server.listen( "localhost", 8000, [=]( socket_t server ){
110+
console::log("server started at http://localhost:8000");
111+
});
112+
113+
}
114+
```
115+
116+
### More Examples [here](https://github.com/NodeppOfficial/Nodepp/tree/main/examples)
117+
118+
## Projects made with NodePP
119+
- 🔗: [Draw on your PC using your smartphone](https://github.com/ScreenDraw/PCDraw)
120+
- 🔗: [Simple multiplayer Game With Raylib](https://medium.com/@EDBCBlog/create-your-own-online-multiplayer-small-fast-and-fun-with-raylib-nodepp-and-websockets-190f5c174094)
121+
- 🔗: [Cursed Luna - A simple Raylib Game](https://github.com/EDBCREPO/Space-Shocker)
122+
- 🔗: [Smart Card Reader(Nodepp-Arduino)](https://github.com/EDBCREPO/emv-reader)
123+
- 🔗: [Serial Port arduino using Nodepp](https://github.com/EDBCREPO/Arduino_PC)
124+
- 🔗: [Simple Raylib Real-Time Chat](https://github.com/EDBCREPO/simple-raylib-websocket-chat)
125+
- 🔗: [Simple Bitget Trading Bot](https://github.com/EDBCREPO/simple-binance-bot-nodepp)
126+
127+
Check out some articles on [Medium](https://medium.com/@EDBCBlog)
128+
129+
## Compatibility
130+
- 🔗: [NodePP for Window | Linux | Mac | Bsd ](https://github.com/NodeppOfficial/nodepp)
131+
- 🔗: [NodePP for Arduino](https://github.com/NodeppOfficial/nodepp-arduino)
132+
- 🔗: [Nodepp for ESP32](https://github.com/NodeppOfficial/nodepp-ESPXX)
133+
- 🔗: [Nodepp for WASM](https://github.com/NodeppOfficial/nodepp-wasm)
134+
135+
## Official Libraries for Nodepp
136+
- 🔗: [ExpressPP](https://github.com/NodeppOfficial/nodepp-express) -> Express equivalent for Nodepp
137+
- 🔗: [ApifyPP](https://github.com/NodeppOfficial/nodepp-apify) -> Socket.io equivalent for Nodepp
138+
- 🔗: [SerialPP](https://github.com/NodeppOfficial/nodepp-serial) -> Serial Port for Nodepp
139+
- 🔗: [Argon2](https://github.com/NodeppOfficial/nodepp-argon2) -> Argon2 for Nodepp
140+
- 🔗: [Torify](https://github.com/NodeppOfficial/nodepp-torify) -> HTTP|Ws over Tor
141+
- 🔗: [NginxPP](https://github.com/NodeppOfficial/nodepp-nginx) -> Reverse Proxy
142+
- 🔗: [InputPP](https://github.com/NodeppOfficial/nodepp-input) -> Fake Inputs
143+
- 🔗: [JWT](https://github.com/NodeppOfficial/nodepp-jwt) -> JSON Web Token
144+
- 🔗: [NmapPP](https://github.com/NodeppOfficial/nodepp-nmap) -> Scan IPs and Ports
145+
- 🔗: [Redis](https://github.com/NodeppOfficial/nodepp-redis) -> Redis Client for Nodepp
146+
- 🔗: [Sqlite](https://github.com/NodeppOfficial/nodepp-sqlite) -> Sqlite Client for Nodepp
147+
- 🔗: [MariaDB](https://github.com/NodeppOfficial/nodepp-mariadb) -> MariaDB Client for Nodepp
148+
- 🔗: [Postgres](https://github.com/NodeppOfficial/nodepp-postgres) -> Postgres Client for Nodepp
45149

46150
## Contribution
47151

48-
If you want to contribute to **Node++**, you are welcome to do so! You can contribute in several ways:
152+
If you want to contribute to **Nodepp**, you are welcome to do so! You can contribute in several ways:
153+
154+
- ☕ Buying me a Coffee
155+
- 📢 Reporting bugs and issues
156+
- 📝 Improving the documentation
157+
- 📌 Adding new features or improving existing ones
158+
- 🧪 Writing tests and ensuring compatibility with different platforms
159+
- 🔍 Before submitting a pull request, make sure to read the contribution guidelines.
49160

50-
- Improving the documentation
51-
- Reporting bugs and issues
52-
- Adding new features or improving existing ones
53-
- Writing tests and ensuring compatibility with different platforms
54-
- Before submitting a pull request, make sure to read the contribution guidelines.
161+
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/edbc_repo)
55162

56163
## License
57164

58-
**Node++** is distributed under the MIT License. See the LICENSE file for more details.
165+
**Nodepp** is distributed under the MIT License. See the LICENSE file for more details.

0 commit comments

Comments
 (0)