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.
- Host: GitHub
- URL: https://github.com/arviisoft/mini-ruby-web
- Owner: ArviiSoft
- License: mit
- Created: 2025-06-07T08:24:29.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-06-07T08:27:19.000Z (10 months ago)
- Last Synced: 2025-07-18T22:32:50.527Z (8 months ago)
- Topics: framework, ruby, web
- Language: Ruby
- Homepage: https://discord.gg/aVBCqTU4PZ
- Size: 6.84 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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