jimguys/cuddlychang — pull request #3 by drueck (2013-09-08 06:39:11+00:00)
Title: Basic start of Postgres integration

I added a db directory with a schema file and a little README about how to use that to create the database. I didn't get into details about how to set up a user or configure authentication in postgres, but all that will need to be done in order to actually create the database, and the process will be slightly different depending on the OS and how you want to handle authentication.

I wasn't sure how to organize our back end code, so I just created a `lib` directory and within that a `repositories` directory. I created a basic first draft of a `PoemsRepository` to do CRUD + Queries on poems. Right now it has create, read, destroy and "all" which returns all poems. This is handling just the poem records themselves not the lines yet.

I hooked up the poems routes to use the `PoemsRepository` to read and write to the database, and tested it locally. It worked for me, but there is no error handling and no tests. :/ So yeah, just a super rough first draft of some basic database interaction.