Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 1.77 KB

README.md

File metadata and controls

23 lines (14 loc) · 1.77 KB

Charlie

Let's get him a new ratstick!

What?

A script that will take care of some (hopefully most?) of the Charlie work involved in setting up an API - database schema and route generation. It is all fairly boilerplate, but by not wrapping it in a module and instead generating source, you are able to use and modify at will.

My initial goal is to support HapiJS (a Node HTTP framework) for the web interface and Knex and Bookshelf for any database interaction. Ideally the architecture will be such that adding other frameworks/databases is just a matter of outputting the correct syntax. I would eventually like to support at least 1 flavor of SQL database (MySQL/Postgres, for example).

How?

$ node charlie /Users/badass/rats/schema.json

The only argument to the script is the path to a JSON file that is a schema for your object models. Using this schema, we can very easily create the database side of things, but also generate all of the object CRUD routes and their basic functionality.

Why?

I wasted way too much time trying to set this all up manually (without having much of a background in either Node/Hapi or Mongo) so I figured other people would probably have the same problems as well. I decided to write this in Node.js as an exercise for myself.

Who?

Charlie is written and maintained by Ameesh Kapoor (@tupakapoor) with significant advice and input from Johnny Domino (@jmonsterflex) of Yayuhh LLC. Please feel free to contribute or say hi on Twitter.