Project

pico_api

0.0
No release in over a year
A tiny Rack-based ruby template for building JSON-API REST APIs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2
~> 0.2
~> 13
~> 3
~> 5
~> 3.5
~> 2.6
 Project Readme

Pico API

A tiny boilerplate JSON API template in ruby. Its minimal footprint makes it ideal for microservices or even full blown APIs. It has been created for those who don't need the RAILS "magic" and bloat. Can easily create different architectures, like STAR, CQRS, DDD..., and MVC.

Pico API is just a collection of the fastest ruby libraries put together to form a basic API environment, with the JSON:API specification. It doesn't create any folder structures for your business logic, it only creates the initial configurations to get you started.

Example demo project can be found here

Libraries Used

Usage

Create your app

gem install pico_api

pico_api --new my_app

cd my_app

bundle install

Configure your database

Migration info: https://rom-rb.org/5.0/learn/sql/migrations/

  • Add the database config details in config/database.yml
  • Setup the Database: rake db:setup
  • Create a migration: rake db:create_migration[create_users] (include your preferred DB gem in the Gemfile)
  • Run the migrations: rake db:migrate
  • Run the server: rackup -p 3001

Routing

Routing info: https://github.com/jeremyevans/roda

Add routing info in config/application.rb file

Development

  • Create Database config
  • Hook a json-api library
  • Handle Errors
  • Create a Logger config
  • Create a testing environment
  • Allow multiple db gateways in the config
  • Add irb/pry console script
  • Seperate configs to different environments (dev, prod, etc..)

Contributing

All Pull Requests are welcome, from a single typo to a new feature.

  • Fork this repo
  • Create a new branch, add your changes with tests when necessary
  • Submit a Pull Request