$ show ashtonjamesd/lavandula
Lavandula is a lightweight C web framework designed for building small web applications quickly. It provides HTTP server functionality with routing, middleware pipeline support, SQLite3 integration, and a built-in JSON library. The framework includes a CLI tool (lavu) for project scaffolding and features a 'hot restart' mechanism for development. The codebase is well-organized with clear separation of concerns between HTTP parsing, routing, middleware, and database operations. However, the README explicitly states it's in early development and not production-ready, with several features still in progress including multithreading, TLS, rate limiting, and the Lavender ORM layer. The framework demonstrates solid C engineering practices with proper memory management, error handling, and a comprehensive test suite covering core components like JSON parsing, authentication, CORS, and HTTP parsing.
The LLM identified 6 files worth highlighting for reuse:
A complete custom JSON library implementing parsing and serialization from scratch. Handles nested objects, arrays, strings, numbers, booleans, and null values with proper memory management. The parser correctly handles RFC 4648 compliant encoding/decoding with padding. This is genuinely reusable as it solves a common problem without external dependencies and demonstrates non-obvious skill in implementing a full JSON parser in C.
Implements HTTP Basic Authentication with constant-time string comparison to prevent timing attacks. Properly encodes/decodes credentials using Base64 and manages credential storage with dynamic allocation. The security-conscious approach (consttimeStrcmp) demonstrates awareness of common authentication vulnerabilities and could be safely extracted for use in other C projects requiring HTTP auth.
Implements a clean middleware pipeline pattern that combines global and route-specific middleware handlers. The design properly manages memory for handler arrays and supports short-circuiting the pipeline when responses are returned. This is a reusable architectural pattern that could be extracted and applied to other C projects needing request processing pipelines.
Provides SQLite3 integration with parameterized queries to prevent SQL injection. Implements proper error handling, result set management with dynamic row allocation, and type-safe parameter binding. The code demonstrates good database engineering practices and could be adapted for other SQLite-based C projects with minimal modification.
Implements RFC 4648 compliant Base64 encoding and decoding with proper padding handling. The implementation is well-tested with comprehensive test vectors covering edge cases like empty strings, special characters, and various padding scenarios. This is a standalone utility that could be extracted and reused in any C project requiring Base64 operations.
Custom token-based parser for .env files that loads environment variables into a map structure. Implements proper memory management with cleanup functions and handles various value types (strings, numbers). This solves a common configuration problem and could be extracted for use in other C projects needing environment variable management.