Skip to content

Commit

Permalink
Improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
sdogruyol committed Jan 13, 2025
1 parent a9324be commit 5359781
Showing 1 changed file with 62 additions and 34 deletions.
96 changes: 62 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,95 @@

[![Kemal](https://avatars3.githubusercontent.com/u/15321198?v=3&s=200)](http://kemalcr.com)

# Kemal

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

[![CI](https://github.com/kemalcr/kemal/actions/workflows/ci.yml/badge.svg)](https://github.com/kemalcr/kemal/actions/workflows/ci.yml)
[![Join the chat at https://gitter.im/sdogruyol/kemal](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sdogruyol/kemal?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

# Super Simple ⚑️
## 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. Add Kemal to your project's `shard.yml`:

```yaml
dependencies:
kemal:
github: kemalcr/kemal
```
3. Create your first Kemal app:
```ruby
```crystal
require "kemal"

# Matches GET "http://host:port/"
# Basic route - responds to GET "http://localhost:3000/"
get "/" do
"Hello World!"
end

# Creates a WebSocket handler.
# Matches "ws://host:port/socket"
ws "/socket" do |socket|
socket.send "Hello from Kemal!"
# 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
```

Start your application!
4. Run your application:

```bash
crystal run src/your_app.cr
```
crystal src/kemal_sample.cr
```
Go to *http://localhost:3000*

Check [documentation](http://kemalcr.com) or [samples](https://github.com/kemalcr/kemal/tree/master/samples) for more.
5. Visit [http://localhost:3000](http://localhost:3000) - That's it! πŸŽ‰

# Installation
## Key Features

Add this to your application's `shard.yml`:
- βœ… **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

- πŸ“š [Official Documentation](http://kemalcr.com)
- πŸ’» [Sample Applications](https://github.com/kemalcr/kemal/tree/master/samples)
- πŸš€ [Getting Started Guide](http://kemalcr.com/guide/)
- πŸ’¬ [Community Chat](https://discord.gg/prSVAZJEpz)

```yaml
dependencies:
kemal:
github: kemalcr/kemal
```

See also [Getting Started](http://kemalcr.com/guide/).
## Contributing

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

- Support all REST verbs
- Websocket support
- Request/Response context, easy parameter handling
- Middleware support
- Built-in JSON support
- Built-in static file serving
- Built-in view templating via [ECR](https://crystal-lang.org/api/ECR.html)
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

# Documentation
## Acknowledgments

You can read the documentation at the official site [kemalcr.com](http://kemalcr.com)
Special thanks to Manas for their work on [Frank](https://github.com/manastech/frank).

## Thanks
## License

Thanks to Manas for their awesome work on [Frank](https://github.com/manastech/frank).
Kemal is released under the MIT License.

0 comments on commit 5359781

Please sign in to comment.