https://github.com/kemalcr/kemal
Fast, Effective, Simple Web Framework
https://github.com/kemalcr/kemal
api crystal efficient fast json kemal rest simple web-framework websocket
Last synced: 4 days ago
JSON representation
Fast, Effective, Simple Web Framework
- Host: GitHub
- URL: https://github.com/kemalcr/kemal
- Owner: kemalcr
- License: mit
- Created: 2015-10-23T16:56:29.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2026-04-10T20:11:51.000Z (7 days ago)
- Last Synced: 2026-04-10T20:15:44.607Z (7 days ago)
- Topics: api, crystal, efficient, fast, json, kemal, rest, simple, web-framework, websocket
- Language: Crystal
- Homepage: https://kemalcr.com
- Size: 849 KB
- Stars: 3,843
- Watchers: 70
- Forks: 194
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - kemal - Lightning Fast, Super Simple web framework. Inspired by Sinatra (Web Frameworks)
- awesome-luooooob - kemalcr/kemal - Fast, Effective, Simple Web Framework (Crystal)
- awesome-crystal - kemal - Lightning Fast, Super Simple web framework. Inspired by Sinatra (Web Frameworks)
- awesome-crystal - kemal - Lightning Fast, Super Simple web framework. Inspired by Sinatra (Web Frameworks)
- stars - kemalcr/kemal - Fast, Effective, Simple Web Framework (Crystal)
- awesome - kemalcr/kemal - Fast, Effective, Simple Web Framework (<a name="Crystal"></a>Crystal)
README
[](http://kemalcr.com)
# Kemal
Kemal is the Fast, Effective, Simple Web Framework for Crystal. It's perfect for building Web Applications and APIs with minimal code.
[](https://github.com/kemalcr/kemal/actions/workflows/ci.yml)
## Why Kemal?
- π **Lightning Fast**: Built on Crystal, known for C-like performance
- π‘ **Super Simple**: Minimal code needed to get started
- π **Feature Rich**: Everything you need for modern web development
- π§ **Flexible**: Easy to extend with middleware support
## Quick Start
1. First, make sure you have [Crystal installed](https://crystal-lang.org/install/).
2. Create a new Crystal application and step into it:
```bash
crystal init app my-kemal-app
cd my-kemal-app
```
3. Add Kemal to your app's `shard.yml`:
```yaml
dependencies:
kemal:
github: kemalcr/kemal
```
4. Replace the contents of `src/my_kemal_app.cr` with your first Kemal app:
```crystal
require "kemal"
# Basic route - responds to GET "http://localhost:3000/"
get "/" do
"Hello World!"
end
# JSON API example
get "/api/status" do |env|
env.response.content_type = "application/json"
{"status": "ok"}.to_json
end
# WebSocket support
ws "/chat" do |socket|
socket.send "Hello from Kemal WebSocket!"
end
Kemal.run
```
5. Install dependencies and run your application:
```bash
shards install
crystal run src/my_kemal_app.cr
```
6. Visit [http://localhost:3000](http://localhost:3000) - That's it! π
## Key Features
- π **High-performance by default**: Built on Crystal with a thin abstraction layer so you can serve a large number of requests with low latency and low memory footprint.
- π **Full REST & HTTP support**: Handle all HTTP verbs (GET, POST, PUT, PATCH, DELETE, etc.) with a straightforward routing DSL.
- π **WebSocket & real-time**: First-class WebSocket support for building chats, dashboards and other real-time experiences.
- π¦ **JSON-first APIs**: Native JSON handling makes building JSON APIs and microservices feel natural.
- ποΈ **Static assets made easy**: Serve static files (assets, uploads, SPA bundles) efficiently from the same application.
- π **Template engine included**: Built-in ECR template engine for serverβrendered HTML when you need it.
- π **Composable middleware**: Flexible middleware system to add logging, auth, rate limiting, metrics and more.
- π― **Ergonomic request/response API**: Simple access to params, headers, cookies and bodies via a clear context object.
- πͺ **Session management**: Easy session handling with [kemal-session](https://github.com/kemalcr/kemal-session), suitable for production apps.
## Philosophy
Kemal aims to be a simple, fast and reliable foundation for building production-grade web applications and APIs in Crystal.
- **Simple core, powerful building blocks**: The core is intentionally simple and easy to reason about. Most power comes from Crystal itself and from middleware, not from hidden magic.
- **Performance as a baseline, not a feature**: Crystal's native speed means high performance is the default. Kemal keeps abstractions thin so you stay close to the metal when you need to.
- **Minimal assumptions, maximum flexibility**: Kemal does not force a specific ORM, template engine, or project layout. You are free to choose the tools that fit your application and your team.
- **Batteries within reason**: Kemal ships with the essentials (routing, middleware, templates, static files, request/response helpers) while keeping advanced concerns in separate shards you can opt into as your app grows.
Kemal is designed to feel familiar if you come from popular web frameworks, while embracing Crystal's strengths and keeping your application code straightforward, maintainable, and ready for production.
## Learning Resources
- π [Official Documentation](http://kemalcr.com)
- π» [Example Applications](https://github.com/kemalcr/kemal/tree/master/examples)
- π [Kemal Guide](http://kemalcr.com/guide/)
- π» [Kemal By Example](https://github.com/sdogruyol/kemal-by-example)
- π¬ [Community Chat](https://discord.gg/prSVAZJEpz)
## Contributing
We love contributions! Please read our [Contributing Guide](CONTRIBUTING.md) to get started.
## Acknowledgments
Special thanks to Manas for their work on [Frank](https://github.com/manastech/frank).
## License
Kemal is released under the MIT License.