Lavandula is a lightweight, fast, and intuitive C web framework designed for building modern web applications quickly. It focuses on simplicity, performance, and productivity, providing all the essentials without the bloat of heavier frameworks.
#include "lavandula.h" // define a route for your app
appRoute(home) { return ok("Hello, World");
} int main() { // initialise your app App app = createApp(); // register a route in your app get(&app, "/home", home); // run the app runApp(&app);
}- Controller and routing system
- HTTP endpoint support (GET, POST, etc)
- Controller local/global middleware pipeline
- Minimal dependencies (pure C)
- Quick project scaffolding via the CLI
- Built-in unit testing framework
- Environment variable support
- Built-in logging
- SQLite integration
- Built-in JSON library
- HTTP JSON body parsing
- Session cookies
- CORS policy configuration
- Lavender ORM
- Embedded Lavandula (ELA) HTML templating engine
- Rate Limiting
- Static file serving
- PostgreSL, MySQL integrations, etc
- Potential dependency injection framework
- Route/Available endpoint listing
- JSON model and function scaffolding
- lavu model User name:string age:int
- generates User struct, JSON serialization, CRUD endpoints in user_controller.c
- URL parameter parsing and routing
To install Lavandula, follow these setps.
git clone https://github.com/ashtonjamesd/lavandula.git
cd lavandulaYou should see the following:
[SUCCESS] ๐ Lavandula installation completed! Quick Start: lavu new my-project # Create a new project cd my-project lavu run # Run your project
Documentation:
GitHub: https://github.com/ashtonjamesd/lavandulaYou should now be able to run the Lavu CLI tool. Refer to api.md for how to use Lavu.
Output:
Setting up Lavandula project 'myProject'...
-> Created myProject/lavandula.yml
-> Created myProject/app/app.c
-> Created myProject/app/controllers/home.c
-> Created myProject/app/routes.c
-> Created myProject/makefile
-> Created myProject/tests/tests.c
๐ Lavandula project 'myProject' setup finished successfully!
Next steps:
1. cd myProject
2. lavu run
Your application will run on http://localhost:3000/.
-
Read the docs
Contributions are welcome. Feel free to submit pull requests or open issues for feature requests or bugs.
Some things that probably need looking at are:
- memory leaks
- outdated and unfinished documentation (API changes warrant a docs update)
- The JSON library does not currently support nested lists
- Some tests need to be written...
Lavandula is registered under the MIT License.e