From adc45671b4b65cf3d73a9554a8b26961ff3131b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LoboGuardian=20=F0=9F=90=BA?= Date: Sat, 12 Apr 2025 21:12:48 -0400 Subject: [PATCH 1/3] Update Cargo.toml and README.md for improved documentation and structure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (And, while we're at it, let's bring back the dancing parrot emoji. 🦜 in the README. Because, why not? 🕺) --- Cargo.toml | 15 +++++++------ README.md | 64 ++++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 53 insertions(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 495bbc9..933843b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,16 +1,17 @@ [package] -edition = "2024" name = "hteapot" version = "0.5.0" -exclude = ["config.toml", "demo/", "readme.md"] -license = "MIT" -keywords = ["HTTP", "HTTP-SERVER"] +edition = "2024" +authors = ["Alb Ruiz G. "] description = "HTeaPot is a lightweight HTTP server library designed to be easy to use and extend." +license = "MIT" +readme = "README.md" +documentation = "https://docs.rs/hteapot/" homepage = "https://github.com/az107/HTeaPot" repository = "https://github.com/az107/HTeaPot" -readme = "readme.md" -categories = ["network-programming", "web-programming"] -authors = ["Alb Ruiz G. "] +keywords = ["http", "server", "web", "lightweight", "rust"] +categories = ["network-programming", "web-programming", "command-line-utilities"] +exclude = ["config.toml", "demo/"] [lib] name = "hteapot" diff --git a/README.md b/README.md index 3137911..c114e0a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,19 @@ A high-performance, lightweight HTTP server and library built in Rust. HTeaPot is designed to deliver exceptional performance for modern web applications while maintaining a simple and intuitive API. -## Features +## 📚 Table of Contents + +- [Features](#--features) +- [Getting Started](#-getting-started) + - [Standalone Server](#standalone-server) + - [As a Library](#as-a-library) +- [Performance](#-performance) +- [Roadmap](#-roadmap) +- [Contributing](#-contributing) +- [License](#-license) +- [Acknowledgments](#-acknowledgments) + +## ✨ Features ### Exceptional Performance - **Threaded Architecture**: Powered by a custom-designed thread system that handles **70,000+ requests per second** @@ -34,9 +46,9 @@ A high-performance, lightweight HTTP server and library built in Rust. HTeaPot i - **Extensible Design**: Easily customize behavior for specific use cases - **Lightweight Footprint**: Zero dependencies and efficient resource usage -## Getting Started +## 🚀 Getting Started -### Installation +### 🔧 Installation ```bash # Install from crates.io @@ -48,11 +60,11 @@ cd hteapot cargo build --release ``` -### Standalone Server +### 🖥️ Running the Server -#### Using a configuration file: +#### Option 1: With Config -Create a `config.toml` file: +1. Create a `config.toml` file: ```toml [HTEAPOT] @@ -61,27 +73,27 @@ host = "localhost" # The host address to bind to root = "public" # The root directory to serve files from ``` -Run the server: +2. Run the server: ```bash hteapot ./config.toml ``` -#### Quick serve a directory: +#### Option 2: Quick Serve ```bash hteapot -s ./public/ ``` -### As a Library +### 🦀 Using as a Library -1. Add HTeaPot to your project: +1. Add HTeaPot to your ```Cargo.toml``` project: ```bash cargo add hteapot ``` -2. Implement in your code: +2. Implement in your code: ```example``` ```rust use hteapot::{HttpStatus, HttpResponse, Hteapot, HttpRequest}; @@ -97,16 +109,18 @@ fn main() { } ``` -## Performance +## 📊 Performance HTeaPot has been benchmarked against other popular HTTP servers, consistently demonstrating excellent metrics: -| Metric | HTeaPot | Industry Average | -|---------------|---------|------------------| -| Requests/sec | 70,000+ | 30,000-50,000 | -| Error rate | <0.1% | 0.5-2% | -| Latency (p99) | 5ms | 15-30ms | -| Memory usage | Low | Moderate | +```markdown +| Metric | HTeaPot | Industry Average | +|---------------|---------------|------------------------| +| Requests/sec | 70,000+ req/s | 30,000 - 50,000 req/s | +| Error rate | < 0.1% | 0.5% - 2% | +| Latency (p99) | 5ms | 15ms - 30ms | +| Memory usage | Low | Moderate | +``` ## Roadmap @@ -122,7 +136,19 @@ HTeaPot has been benchmarked against other popular HTTP servers, consistently de ## Contributing -We welcome contributions from the community! See our [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to get involved. +We welcome contributions from the community! To get started: + +```sh +# Format the code +cargo fmt + +# Lint for warnings +cargo clippy --all-targets --all-features + +# Run tests +cargo test +``` +See [CONTRIBUTING.md](CONTRIBUTING.md) for more details. ## License From 6585f458d8f45abf50befa8a021d3bf37d4dfe65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LoboGuardian=20=F0=9F=90=BA?= Date: Sat, 12 Apr 2025 21:15:36 -0400 Subject: [PATCH 2/3] Update link to CONTRIBUTING.md in README for improved accessibility --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c114e0a..59b91e2 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ cargo clippy --all-targets --all-features # Run tests cargo test ``` -See [CONTRIBUTING.md](CONTRIBUTING.md) for more details. +See [CONTRIBUTING.md](https://github.com/Az107/HTeaPot/wiki/Contributing) for more details. ## License From 17c76462704723f9dd0a8a5f9ab3835b84bbcaaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?LoboGuardian=20=F0=9F=90=BA?= Date: Sun, 13 Apr 2025 03:20:46 -0400 Subject: [PATCH 3/3] Remove markdown formatting from benchmark metrics in README for clarity --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 59b91e2..d1bcc20 100644 --- a/README.md +++ b/README.md @@ -113,14 +113,12 @@ fn main() { HTeaPot has been benchmarked against other popular HTTP servers, consistently demonstrating excellent metrics: -```markdown | Metric | HTeaPot | Industry Average | |---------------|---------------|------------------------| | Requests/sec | 70,000+ req/s | 30,000 - 50,000 req/s | | Error rate | < 0.1% | 0.5% - 2% | | Latency (p99) | 5ms | 15ms - 30ms | | Memory usage | Low | Moderate | -``` ## Roadmap