Keeping Focus on Rails Feat. PKMN Nuzlocke challenge
On my coding journey with Flatiron School, i’ve finally reached my Rails portfolio project. I was filled with excitement but, I was filled with a lot of nervous emotion; common thing that happens in the community is the imposter syndrome. Imposter Syndrome “is the persistent inability to believe that one’s success is deserved or has been legitimately achieved as a result of one’s own efforts or skills” according to google. So I was getting those type of vibes mixed with excitement; I felt ready but, not. Weird right?
In the middle of my project, I lost all thought of what I was doing. I tried the focus timer several times but on my breaks I didn’t know what to do, so here I was passed my third focus timer and clocked in over an hour of work and looking at it like “What is this? Does this make sense?”. I was keeping way too much focus on my project and not taking a necessary mental break like I should have that can pull me away for a couple of minutes. So, after three restarts, literally 3 project restarts. I was able to create routes, create a couple of has_many relationships and verify data from a user, I would lose track of where I was heading. I needed to find something to calm my mind in the middle of my project for when I needed an answer but couldn’t find it.
I found something on reddit about the Pokemon Nuzlocke challenge. I grew up with Pokemon, played almost every entry to completion; it was a huge part of my childhood for the good and bad times, I still play casually to this day. So, what is a Nuzlocke challenge? Well, it’s a self implemented challenge not offered by the games, somewhat dark but creates a great more rewarding challenge; when a Pokemon faints, that Pokemon Is considered “dead” and must be released. To create more of an emotion/attachment to that Pokemon, they must have a nickname and theres many more rules to go over so here’s a link: (https://bulbapedia.bulbagarden.net/wiki/Nuzlocke_Challenge). Give it a shot!
So why am I bringing this up? Well, being so immersed by the challenge and having constrained myself to only play the Nuzlocke challenge on my project breaks, it forced me to work harder and work on my project way more often. It was quite literally creating my own story within the regular Pokemon story, who’ll live? Who’ll pass? What Pokemon will I be able to catch next? This is what I needed, not excitement for whats gonna happen next, but being immersed in something else away from code for a few minutes and being able to give my mind a rest in the middle of project. This has helped me outstandingly. On top of my crazy schedule of two jobs along with a couple of family issues that came across, the focus timer, Pokemon, and project help me keep on track on finishing, proud to say Im done with it! It’s all thanks to a reddit post, Sparks the Charmander [& crew] and the focus timer. So let’s get back to the main topic, keeping focused and the results i’ve landed because of it.
So from being able to only do the resources(routes), I was able to restart my project for the final time, from Pokemon trainers to sneaker community where I have Users adding sneakers to the database with images, be able to write reviews and sign in using Github! One of the bigger challenges has to be adding omniauth and having a Github Sign In. First I started with adding the gem omniauth along with ominauth-github, then having to add a new file within initializers naming it “omniauth.rb” and adding some code, having the provider being github with the ENV(environment) of github_id and github_secret.
Where did I get the ID and secret? I created it through Github and they assigned me a personal id and secret that I cannot share unfortunately for safety reasons, I then put them both within a file named .env and also had to put .env into .gitignore for keeping it secret and such. What you probably saw in my routes.rb file above is that I had github/callback assigned to sessions#omniauth. The reason why I had it like that is I wanted my homepage to have the ability to login with Github immediately. so I have my welcome page look like this in code:
With a little bit of styling with CSS and having a default layout, the user sees it like this on the page:
That was just a little snippet of what the focus timer and the Nuzlocke challenge has done to help me create this. Sometimes you gotta break your focus for a little bit, take a break, to come back with better focus and more answers than questions. I plan on writing my Pokemon journey throughout my project on a future story. But for now, cheers to the mad lads that help me have fun with my project and to hopefully new adventures in the future!
Thank you for reading this far in! I hope my little advice will help someone out there when they’re stuck. From one programmer to another, you belong here, don’t doubt yourself. You got this! Once again…