Skip to content

Commit d7d2b38

Browse files
committed
Improve the logo
1 parent 48e3ffb commit d7d2b38

35 files changed

+2184
-703
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ uv.lock
9898
public/
9999
site/
100100
*.a
101+
docs/api

README.md

Lines changed: 17 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -14,64 +14,33 @@
1414
[![Release](https://img.shields.io/github/release/CogitatorTech/helium.svg?label=release&style=flat&labelColor=282c34&logo=github)](https://github.com/CogitatorTech/helium/releases/latest)
1515
[![License](https://img.shields.io/badge/license-MIT-007ec6?label=license&style=flat&labelColor=282c34&logo=open-source-initiative)](https://github.com/CogitatorTech/helium/blob/main/LICENSE)
1616

17-
A lightweight, fast web framework for Zig
17+
A micro web framework for Zig
1818

1919
</div>
2020

2121
---
2222

23-
Helium is a small, configurable web framework for Zig programming language.
24-
It provides the essential building blocks for creating fast and efficient web applications and services in Zig by
25-
composing a set of reusable components.
26-
Helium follows a micro-framework design philosophy with a small core feature set that could be extended via optional
23+
Helium is a small, configurable web framework for the Zig programming language.
24+
It aims to provide the essential building blocks needed for creating fast and efficient web applications and services in
25+
Zig without getting in the way of your application's logic.
26+
27+
Helium follows a micro-framework design philosophy with a small core feature set that can be extended via optional
2728
middleware and utilities.
29+
It aims to be lightweight and easy to use, while still providing the necessary building blocks for building complex web
30+
applications by allowing users to compose their applications from reusable components.
2831

2932
### Features
3033

31-
- Fully configurable and extensible components
32-
- Build your application from small, reusable components
33-
- Use what you need, ignore what you don't
34-
- A small, focused API that doesn't get in your way
35-
- Explicit and predictable behavior with minimal hidden states
36-
37-
### Core Features
38-
39-
**Routing & Request Handling**
40-
41-
- Express.js-like routing with HTTP method support (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS)
42-
- Dynamic route parameters (e.g., `/users/:id`)
43-
- Query parameter parsing
44-
- Route grouping with shared prefixes
45-
- Request body parsing
46-
47-
**Middleware System**
48-
49-
- Global middleware applied to all routes
50-
- Group-scoped middleware for route collections
51-
- Route-specific middleware chains
52-
- Custom middleware support with simple function signatures
53-
54-
**Server Modes**
55-
56-
- Thread pool mode for high concurrency
57-
- Minimal thread pool with event-driven I/O
58-
- Configurable worker thread counts
59-
60-
**Built-in Utilities** (all optional)
61-
62-
- **CORS middleware**: Cross-origin resource sharing (allow-all)
63-
- **Static file serving**: Secure file server with path traversal protection
64-
- **Logging middleware**: Common log format with timing information
65-
- **JSON responses**: Built-in JSON serialization support
66-
67-
**Flexibility**
68-
69-
- Generic context type for application state
70-
- Custom error handlers per application
71-
- Memory allocator control
72-
- Type-safe handler functions
34+
- Supports application type with custom context
35+
- Supports Type-safe request handlers and middleware
36+
- Supports configurable memory allocator and error handlers
37+
- Provides routing API with dynamic parameters and query parsing
38+
- Supports route groups with shared path prefixes
39+
- Provides middleware for global, group, and route-specific logic
40+
- Supports JSON and plain text response serialization
41+
- Supports static file serving with path traversal protection
7342

74-
See the [ROADMAP.md](ROADMAP.md) for the list of implemented and planned features.
43+
See the [ROADMAP.md](ROADMAP.md) for the full list of implemented and planned features.
7544

7645
> [!IMPORTANT]
7746
> Helium is in early development, so bugs and breaking changes are expected.

ROADMAP.md

Lines changed: 57 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ It outlines features to be implemented and their current status.
88
99
---
1010

11-
### Implemented Features
11+
### Features
12+
13+
The following features are currently being worked on or planned for future releases.
1214

1315
#### Core Framework
1416

@@ -21,11 +23,17 @@ It outlines features to be implemented and their current status.
2123
#### Routing System
2224

2325
- [x] Express.js-like routing API
24-
- [x] HTTP method support (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS)
25-
- [x] Dynamic route parameters (e.g., `/users/:id`)
26+
- [x] HTTP method support (GET, POST, PUT, DELETE, PATCH, HEAD, and OPTIONS)
27+
- [x] Dynamic route parameters (like `/users/:id`)
2628
- [x] Query parameter parsing
2729
- [x] Route grouping with shared path prefixes
2830
- [x] Tree-based router for efficient path matching
31+
- [ ] Route wildcards (like `/files/*`)
32+
- [ ] Route matching with regular expressions
33+
- [ ] Route priority and ordering control
34+
- [ ] Nested route groups
35+
- [ ] Route metadata and tagging
36+
- [ ] Automatic OPTIONS handling per route
2937

3038
#### Middleware System
3139

@@ -34,38 +42,27 @@ It outlines features to be implemented and their current status.
3442
- [x] Route-specific middleware chains
3543
- [x] Middleware composition with `next()` pattern
3644
- [x] Type-safe middleware signatures
37-
38-
#### Built-in Utilities
39-
4045
- [x] CORS middleware (allow-all origins)
41-
- [x] Static file server with path traversal protection
4246
- [x] Common log format middleware with timing
43-
- [x] JSON response helpers
47+
- [ ] Configurable CORS middleware (custom origins, methods, and headers)
48+
- [ ] Rate limiting middleware
49+
- [ ] Authentication middleware (JWT, Bearer, and Basic Auth)
50+
- [ ] Session management middleware
51+
- [ ] Cookie parsing and management
52+
- [ ] Request ID tracking
53+
- [ ] Body parser middleware (JSON, form-urlencoded, and multipart)
54+
- [ ] CSRF protection
55+
- [ ] Security headers middleware (helmet-style)
56+
- [ ] Request timeout middleware
57+
- [ ] Circuit breaker pattern
58+
- [ ] Error recovery middleware
59+
- [ ] Panic recovery
60+
- [ ] Debug middleware
4461

45-
#### Request/Response
62+
#### Request Handling
4663

47-
- [x] Request parameter access (path params, query params)
64+
- [x] Request parameter access (path and query parameters)
4865
- [x] Request body string access
49-
- [x] Response status code setting
50-
- [x] Response header management
51-
- [x] JSON response serialization
52-
- [x] Plain text responses
53-
54-
---
55-
56-
### Planned Features
57-
58-
#### 1. Enhanced Routing
59-
60-
- [ ] Route wildcards (e.g., `/files/*`)
61-
- [ ] Route matching with regular expressions
62-
- [ ] Route priority/ordering control
63-
- [ ] Nested route groups
64-
- [ ] Route metadata and tagging
65-
- [ ] Automatic OPTIONS handling per route
66-
67-
#### 2. Request Handling
68-
6966
- [ ] Multipart form data parsing
7067
- [ ] File upload handling
7168
- [ ] Request body size limits (configurable)
@@ -74,58 +71,53 @@ It outlines features to be implemented and their current status.
7471
- [ ] Request validation helpers
7572
- [ ] Custom body parsers (pluggable)
7673

77-
#### 3. Response Enhancements
74+
#### Response Handling
7875

76+
- [x] Response status code setting
77+
- [x] Response header management
78+
- [x] JSON response serialization
79+
- [x] Plain text responses
7980
- [ ] Response streaming API for large payloads
8081
- [ ] Request body streaming for file uploads
8182
- [ ] Template rendering support (pluggable)
82-
- [ ] Response compression (gzip, deflate, brotli)
83+
- [ ] Response compression (gzip, deflate, or brotli)
8384
- [ ] ETag support for caching
84-
- [ ] Conditional requests (If-None-Match, If-Modified-Since)
85+
- [ ] Conditional requests (If-None-Match and If-Modified-Since)
8586
- [ ] Server-Sent Events (SSE) support
8687
- [ ] Chunked transfer encoding
8788

88-
#### 4. Middleware Ecosystem
89+
#### Static File Serving
8990

90-
- [ ] Configurable CORS middleware (custom origins, methods, headers)
91-
- [ ] Rate limiting middleware
92-
- [ ] Authentication middleware (JWT, Bearer, Basic Auth)
93-
- [ ] Session management middleware
94-
- [ ] Cookie parsing and management
95-
- [ ] Request ID tracking
96-
- [ ] Body parser middleware (JSON, form-urlencoded, multipart)
97-
- [ ] CSRF protection
98-
- [ ] Security headers middleware (helmet-style)
99-
- [ ] Request timeout middleware
100-
- [ ] Circuit breaker pattern
91+
- [x] Static file server with path traversal protection
92+
- [ ] ETag support for static files
93+
- [ ] Range request support for partial content
94+
- [ ] Directory listing (optional)
95+
96+
#### Error Handling
97+
98+
- [x] Custom error handler support
99+
- [ ] Detailed error responses (development mode)
100+
- [ ] Error logging integration points
101+
- [ ] Structured error types
101102

102-
#### 5. Performance & Scaling
103+
#### Performance & Scaling
103104

104105
- [ ] Connection pooling
105-
- [ ] Request/response pooling
106+
- [ ] Request and response pooling
106107
- [ ] Zero-copy optimizations
107108
- [ ] HTTP keep-alive connection management
108109
- [ ] Graceful shutdown support
109110
- [ ] Health check endpoints
110111
- [ ] Metrics and monitoring hooks
111112

112-
#### 6. Error Handling
113-
114-
- [ ] Error recovery middleware
115-
- [ ] Detailed error responses (development mode)
116-
- [ ] Error logging integration points
117-
- [ ] Panic recovery
118-
- [ ] Structured error types
119-
120-
#### 7. Testing & Development
113+
#### Testing & Development
121114

122115
- [ ] Test client for integration testing
123-
- [ ] Mock request/response builders
116+
- [ ] Mock request and response builders
124117
- [ ] Development mode with hot reload (external tool integration)
125-
- [ ] Request/response logging levels
126-
- [ ] Debug middleware
118+
- [ ] Request and response logging levels
127119

128-
#### 8. Security
120+
#### Security
129121

130122
- [ ] HTTPS/TLS support
131123
- [ ] Certificate management helpers
@@ -135,9 +127,9 @@ It outlines features to be implemented and their current status.
135127
- [ ] Rate limiting by IP/user
136128
- [ ] Request size limits
137129

138-
#### 9. Documentation & Examples
130+
#### Documentation & Examples
139131

140-
- [x] Basic examples (simple server, error handling)
132+
- [x] Basic examples (simple server and error handling)
141133
- [x] Route grouping example
142134
- [ ] REST API example
143135
- [ ] WebSocket chat example
@@ -149,14 +141,14 @@ It outlines features to be implemented and their current status.
149141
- [ ] Best practices guide
150142
- [ ] Migration guide from other frameworks
151143

152-
#### 10. Ecosystem Integration
144+
#### Ecosystem Integration
153145

154146
- [ ] Database connection pooling patterns
155147
- [ ] ORM integration examples
156148
- [ ] Message queue integration patterns
157-
- [ ] Cache integration (Redis, Memcached)
149+
- [ ] Cache integration (Redis and Memcached)
158150
- [ ] Logging framework integration
159-
- [ ] OpenTelemetry/tracing support
151+
- [ ] OpenTelemetry and tracing support
160152

161153
---
162154

build.zig

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,90 +4,59 @@ const fs = std.fs;
44
pub fn build(b: *std.Build) void {
55
const target = b.standardTargetOptions(.{});
66
const optimize = b.standardOptimizeOption(.{});
7-
8-
// --- Library Setup ---
97
const lib_source = b.path("src/lib.zig");
10-
11-
// This creates the "helium" module, makes it available to other packages,
12-
// and returns a reference to it.
138
const lib_module = b.addModule("helium", .{
149
.root_source_file = lib_source,
1510
.target = target,
1611
.optimize = optimize,
1712
});
18-
19-
// Then, we use the same module for the library artifact.
2013
const lib = b.addLibrary(.{
2114
.name = "helium",
2215
.root_module = lib_module,
2316
});
2417
b.installArtifact(lib);
25-
26-
// --- Docs Setup ---
2718
const docs_step = b.step("docs", "Generate API documentation");
2819
const doc_install_path = "docs/api";
29-
30-
// This command remains the same, but the directory creation can be improved.
3120
const gen_docs_cmd = b.addSystemCommand(&[_][]const u8{
32-
b.graph.zig_exe, // Use the same zig that is running the build
21+
b.graph.zig_exe,
3322
"build-lib",
3423
"src/lib.zig",
3524
"-femit-docs=" ++ doc_install_path,
3625
});
37-
38-
// Using `b.addSystemCommand` for `mkdir` is not portable (e.g., to Windows).
39-
// For this case it is acceptable, but for broader compatibility,
40-
// a RunStep with `std.fs.makeDir` would be better.
4126
const mkdir_cmd = b.addSystemCommand(&[_][]const u8{
4227
"mkdir", "-p", doc_install_path,
4328
});
4429
gen_docs_cmd.step.dependOn(&mkdir_cmd.step);
45-
4630
docs_step.dependOn(&gen_docs_cmd.step);
47-
48-
// --- Test Setup ---
49-
// The test runner also consumes a module now.
5031
const lib_unit_tests = b.addTest(.{
5132
.root_module = lib_module,
5233
});
53-
5434
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
5535
const test_step = b.step("test", "Run unit tests");
5636
test_step.dependOn(&run_lib_unit_tests.step);
57-
58-
// --- Example Setup ---
5937
const examples_path = "examples";
60-
// This block gracefully handles the case where the examples directory doesn't exist.
6138
examples_blk: {
6239
var examples_dir = fs.cwd().openDir(examples_path, .{ .iterate = true }) catch |err| {
6340
if (err == error.FileNotFound or err == error.NotDir) break :examples_blk;
6441
@panic("Can't open 'examples' directory");
6542
};
6643
defer examples_dir.close();
67-
6844
var dir_iter = examples_dir.iterate();
6945
while (dir_iter.next() catch @panic("Failed to iterate examples")) |entry| {
7046
if (!std.mem.endsWith(u8, entry.name, ".zig")) continue;
71-
7247
const exe_name = fs.path.stem(entry.name);
7348
const exe_path = b.fmt("{s}/{s}", .{ examples_path, entry.name });
74-
75-
// Create a module for the executable.
7649
const exe_module = b.createModule(.{
7750
.root_source_file = b.path(exe_path),
7851
.target = target,
7952
.optimize = optimize,
8053
});
81-
// Add the main library as a dependency to the executable's module.
8254
exe_module.addImport("helium", lib_module);
83-
84-
// Create the executable artifact from the module.
8555
const exe = b.addExecutable(.{
8656
.name = exe_name,
8757
.root_module = exe_module,
8858
});
8959
b.installArtifact(exe);
90-
9160
const run_cmd = b.addRunArtifact(exe);
9261
const run_step_name = b.fmt("run-{s}", .{exe_name});
9362
const run_step_desc = b.fmt("Run the {s} example", .{exe_name});
@@ -96,4 +65,3 @@ pub fn build(b: *std.Build) void {
9665
}
9766
}
9867
}
99-

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.{
22
.name = .helium,
3-
.version = "0.1.0",
3+
.version = "0.1.0-alpha.1",
44
.fingerprint = 0x530afceb745b01bc, // Changing this has security and trust implications.
55
.minimum_zig_version = "0.15.1",
66
.paths = .{

0 commit comments

Comments
 (0)