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?

Quick Start

  1. First, make sure you have Crystal installed.

  2. Create a new Crystal application and step into it:

crystal init app my-kemal-app
cd my-kemal-app
  1. Add Kemal to your app's shard.yml:
dependencies:
  kemal:
    github: kemalcr/kemal
  1. Replace the contents of src/my_kemal_app.cr with 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. Install dependencies and run your application:
shards install
crystal run src/my_kemal_app.cr
  1. Visit http://localhost:3000 - That's it! πŸŽ‰

Key Features

Philosophy

Kemal aims to be a simple, fast and reliable foundation for building production-grade web applications and APIs in Crystal.

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

Contributing

We love contributions! Please read our Contributing Guide to get started.

Acknowledgments

Special thanks to Manas for their work on Frank.

License

Kemal is released under the MIT License.