An open API service indexing awesome lists of open source software.

https://github.com/arviisoft/mini-ruby-web

๐Ÿ’Ž A lightweight Ruby web framework inspired by Sinatra, designed for educational purposes and simplicity.
https://github.com/arviisoft/mini-ruby-web

framework ruby web

Last synced: 8 months ago
JSON representation

๐Ÿ’Ž A lightweight Ruby web framework inspired by Sinatra, designed for educational purposes and simplicity.

Awesome Lists containing this project

README

          

# MiniRubyWeb

A lightweight Ruby web framework inspired by Sinatra, designed for educational purposes and simplicity.

---

## ๐Ÿš€ Features

| Feature | Description |
|----------------------|--------------------------------------------|
| ๐Ÿ›ฃ๏ธ Routing | Supports static and dynamic routes |
| ๐Ÿงญ Controllers | BaseController structure for logic separation |
| ๐Ÿงพ Views | ERB rendering system for templates |
| โœ… Rack Compatible | Works with `rackup` and middleware |
| ๐Ÿ” Testable | Designed with RSpec and modularity in mind |

---

## ๐Ÿ—‚๏ธ Project Structure

```
mini_ruby_web/
โ”œโ”€โ”€ lib/
โ”‚ โ”œโ”€โ”€ base_controller.rb
โ”‚ โ”œโ”€โ”€ mini_ruby_web.rb
โ”‚ โ””โ”€โ”€ router.rb
โ”œโ”€โ”€ controllers/
โ”‚ โ””โ”€โ”€ users_controller.rb
โ”œโ”€โ”€ views/
โ”‚ โ””โ”€โ”€ user_show.erb
โ”œโ”€โ”€ app.rb
โ””โ”€โ”€ config.ru
```

---

## ๐Ÿ”ง Usage

### Start the server

```bash
rackup
```

### Example Routes

```ruby
app.get "/merhaba" do |req, res|
res.write "Merhaba ArviS."
end

app.get "/users/:id" do |req, res|
controller = UsersController.new(req, res)
controller.show
end
```

---

## ๐Ÿ“ฆ Future Improvements

- Middleware support
- Sessions and cookies
- ORM integration (e.g., ActiveRecord)
- CLI tool
- RESTful routing