kemal

Lightning Fast, Super Simple web framework. Inspired by Sinatra kemal web-framework websocket api fast simple efficient json rest
1.7.0 released
kemalcr/kemal
3681 187
Kemal

Kemal

Kemal

Kemal is the Fast, Effective, Simple Web Framework for Crystal. It's perfect for building Web Applications and APIs with minimal code.

CI

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.

  2. Add Kemal to your project's shard.yml:

dependencies:
  kemal:
    github: kemalcr/kemal
  1. Create your first Kemal app:
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
  1. Run your application:
crystal run src/your_app.cr
  1. Visit http://localhost:3000 - That's it! πŸŽ‰

Key Features

  • βœ… Full REST Support: Handle all HTTP verbs (GET, POST, PUT, DELETE, etc.)
  • πŸ”Œ WebSocket Support: Real-time bidirectional communication
  • πŸ“¦ Built-in JSON Support: Native JSON handling
  • πŸ—„οΈ Static File Serving: Serve your static assets easily
  • πŸ“ Template Support: Built-in ECR template engine
  • πŸ”’ Middleware System: Add functionality with middleware
  • 🎯 Request/Response Context: Easy parameter and request handling

Learning Resources

Contributing

We love contributions! If you'd like to contribute:

  1. Fork it (https://github.com/kemalcr/kemal/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Acknowledgments

Special thanks to Manas for their work on Frank.

License

Kemal is released under the MIT License.

kemal:
  github: kemalcr/kemal
  version: ~> 1.7.0
License MIT
Crystal >= 0.36.0

Authors

Dependencies 2

  • exception_page ~> 0.5.0
    {'github' => 'crystal-loot/exception_page', 'version' => '~> 0.5.0'}
  • radix ~> 0.4.0
    {'github' => 'luislavena/radix', 'version' => '~> 0.4.0'}

Development Dependencies 0

Dependents 73

Show all 73 dependents
Last synced .
search fire star recently