So, as I started collecting vinyls recently, I needed a good way to keep track of them all. Not satisfied with a simple Google Spreadsheet and always looking for interesting programming problems, I decided to roll my own solution. Here were my requirements
- Simple (as always): I wanted the collection to be displayed in an easy-to-follow table, and adding/editing items should be a simple process.
- Fluid Schema: if I want to add/remove attributes, I should be able to do that
- Public: I want to be able to share this collection without worry or fear of other people messing with it without permission.
Enter cataloguais. Built on Sinatra, MongoDB and jQuery, cataloguais is basically exactly what I wanted. This is not my first time working with Sinatra or jQuery, but my first foray into MongoDB. MongoDB gets a lot of flak, but I think this is a good use-case for it. Its in-memory, fluid schema architecture lends itself well to my collection of all-string objects. Plus, MongoMapper makes it easy to manipulate and fetch objects, adding a lot of methods I'm used to using with Rails.
It was an interesting task writing something that I'm going to use specifically to be designed for more general use cases. I wanted to write code that anyone could use to keep track of their collection. Thus, the schema is specified in a settings.yml file and applied each time the app spins up.
To be honest, I'm not exactly happy with the authentication as it stands. It's a plain-text string comparison. I'm thinking of moving over to an Oauth setup/administration, which could be cool. The lock works on a really simple level as-is for now.
All in all, cataloguais has managed to fullfill my needs really well. Check out the code on github and see it in action here.
A cause de ma nouvelle collection des disques, j'avais besoin d'un bon façon à les cataloguer. Je n'étais pas satisfait de Google Spreadsheet et parce que je toujours cherches des problèmes interessantes de la programmation, j'ai decidé à faire une solution moi-même. Mes besoins étaient:
- Simple (comme toujours): Je voulais que la collection serait montrée dans une table simple, et ajouter/supprimer des chose doivent être facile.
- Schéma liquide: Si on veut ajouter/supprimer des attributs, on doit pouvoir le faire.
- Public: Je veut montret ma collection sans peur que des gens traficoteraient.
Voila cataloguais. Utilisant Sinatra, MongoDB et jQuery, cataloguais est exactement dont j'avais besoin. Ce n'est pas ma premiére expérience avec Sinatra ou jQuery, mais c'est ma premiére avec MongoDB. MongoDB reçoit beaucoup de critiques, mais je pense que ce soit un bon emploi de lui. Son in-memory, schéma liquide architecture se confère à ma collection des strings. Plus, MongoMapper la rend facile à changer des objets, avec beaucoup de méthodes avec qui je suis familier à cause de Rails.
C'était interessant à ecrire quelque chose pour moi-même qui doit être général aussi. J'ai voulu écrire du code pour permettre n'importe qui à cataloguer leur collection. Donc, le schéma est spécifié dans un fichier settings.yml et appliqué chaque fois l'application commence.
Etre franc, je ne suis pas content avec l'authentication comme elle est maintenant. C'est une comparasion du texte. Je pense d'utiliser Oauth. Mais l'authentication marche pour maintenant.
Cataloguais me suffit exactement. Voila le code sur github et le produi ici.