Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivanshamatov/automagically
Micro framework to build API with UI
https://github.com/ivanshamatov/automagically
Last synced: about 1 month ago
JSON representation
Micro framework to build API with UI
- Host: GitHub
- URL: https://github.com/ivanshamatov/automagically
- Owner: IvanShamatov
- License: mit
- Created: 2015-12-24T12:31:31.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-29T15:37:41.000Z (almost 9 years ago)
- Last Synced: 2024-10-14T02:13:03.947Z (2 months ago)
- Language: Ruby
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Automagically
Micro-framework to build API for your frontend app and simple admin to be able to store some content. Works automagically.
UNDER CONSTRUCTION. Read the story in progress `https://medium.com/@wi11son`
---
## Why do you need this?
Inpired by:
* sinatra + padrino
* grape
* goliath
* active_model_serializer
* active_admin + rails_admin
* and rails of couseYep, there are bunch of solutions how to create backend for SPA or simple website. In most cases you just use Sinatra if you need simple backend processing, or Grape if you need API. You can even use Padrino to have backend with generators and create some code and get Admin panel. Finally you can create `rails --api` now to create really simple api+DB using active_model_serializer and one of gems to generate admin panel.
But what if you want:
* simplicity of sinatra (like routes driven framework)
* simplicity of Grape to generate API mostly for frontend app,
* still have to use database to get out some information like rails ActiveRecord
* need a restricted area like autogenerated padrino-admin/rails_admin/active_admin, where you can put some data inside database through UI
* and it should be really light solutionEach of these frameworks can do the parts, but there is no one, who can fulfill everything. That's why I will try to implement that in `automagically`.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'automagically'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install automagically
## Quick start
```ruby
require 'automagically'
route :reports, Report.all
```It means that you can make a `GET /reports` request and it will respond you with a collection of reports like:
```json
{
"reports": [
{
"title": "First one",
"author": "Kent Willson"
},
{
"title": "Report last",
"author": "Maria Brown"
}
]
}
```More than that, it will give you access to CRUD your model via admin panel.
`/admin/reports` is really heavy because it's gonna be frontend app, which will use api to create/edit and store data.## Restrictions
Yep, first of all there should be a bunch of restrictions, so then you have to use other instuments and don't use `automagically` when it is not appropriate. For example
Don't use `automagically`:
* when you need complex data processing on backend. It is not for processing, but just giveback some JSON.
* ...## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).