Skip to content

Instantly share code, notes, and snippets.

@z64
Last active March 2, 2018 10:50
Show Gist options
  • Save z64/6e4d061246bbc6688e7417a757b402e3 to your computer and use it in GitHub Desktop.
Save z64/6e4d061246bbc6688e7417a757b402e3 to your computer and use it in GitHub Desktop.

there's a few primary contenders for frameworks of course crystal draws a lot from ruby style, attracts a lot of ruby programmers, so there's been a handful of efforts to "crystalize" Rails and other ruby packages like Sinatra (minimalist Rails basically, heres-tools-add-what-you-need)

minimalist / "toolkits"

kemalcr: https://github.com/kemalcr

This probably closest tries to mimic ruby's Sinatra. It's website and examples kind of speak for itself so I'll leave you to that. My personal thoughts on kemal is that while its a good "port" of Sinatra, it carries over some things into Crystal that don't feel very Crystal-like. ask me and i'm happy to go into more detail

raze: https://github.com/samueleaton/raze

Very similar, stupidly simple DSL approach a-la Sinatra, but with a middleware system that feels MUCH more at home in crystal's skin Reportedly benches harder than kemal. Since its not as popular, its a little "batteries not included" but the way the library works makes it "hard to write bad code" with it to extend its functionality

frameworks / "full stack"

disclaimer: i haven't used either of these personally yet

amber: https://github.com/amberframework

Probably the most popular framework right now I think, and pretty full featured IIRC It kind of supersedes kemal and gives it the Rails treatment of things. Amber uses https://github.com/imdrasil/jennifer.cr for an ORM. i've used this personally and it's great for those looking for something like sequel. you have to do a bit more heavy lifting (there's no automatic database table -> model mapping) but the query building DSL is nice, as long as you're patient with the documentation and play around with it a little bit.

lucky: https://github.com/luckyframework

a younger framework but gaining traction very quickly another one that i recommend reading the web page for their elevator pitches in the same vein as "kemal vs raze" I like lucky's approach much more and would pick this one if i was going to use a full stack

databases & drivers

This nice thing about crystal is everyone uses a single core database API and builds adapters on top of it:

https://github.com/crystal-lang/crystal-db

example adapters:

side note: for simple projects where you want migrations but don't want a full ORM, or don't want to deal with your ORMs migration system, check out https://github.com/amberframework/micrate for a nice raw-SQL migration manager tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment