Sinatra
Sorry, this isn’t about Frank Sinatra.
I built a Sinatra CRUD webapp for gardeners called myGarden Tracker where users can signup, login, add new plants, view plants, edit plants, delete plants, and logout. It seems pretty simple, but this dynamic webapp took me a little more time than I thought it would. For example, a couple of aspects to consider:
Security…should a user be able to edit another user’s information? Should they be able to login if their password is incorrect? What if that username is already taken?
Routes…how will a user get from point A to point B? When there’s a GET request…what will happen and what will my server display to the user?
Edits…how can a user successfully edit? Which page should they be able to edit their plant(s) on? Where should they be redirected after editing a plant?
Needless to say, it takes time and concentration. I got lost in a world of routes several times.
For example, in order to let a User create a new Plant, I need to have a get and a post request in my PlantsController and a .erb file named “/plants/new” to route it to and from. Here’s a snippet:
Overall, I’m proud of myGarden Tracker and could easily add to it in the future. If you’d like to view my whole project, click here.
If you’d like to view my video about the project, click here.