Posts

Showing posts with the label development

How to Eat an Elephant

Image
Now that our immediate actionable goal has completed, Kelly and I are stretching our project to include more pages than just the original home page. We have most of the internal links fleshed out but the remaining tasks seem endless and daunting. They are absolutely achievable issues. There are, however, many achievable tasks to make up a whole mountain. One of my favorite sayings that has prevailed over the last few days is "How do you eat an elephant? One bite at a time." What I've learned so far definitely aligns with that statement. It's easiest to tackle a project by breaking it into manageable pieces and doing one line of code at a time. For this project in particular, we've been utilizing a lot of Github's tools for tracking issues, listing problems, and delegating assignments. Each day I aim to resolve at least four issues and tackle any that I see along the way.

Code Snippets: Storing Data with Mongo

Image
Now that I have schemas in my models folder for both users and snippets I'm going to need a way to store them. I could use a SQL database which would store the snippets in the user table with a foreign key or a NoSQL database which is a bit more flexible. Even though SQL is the better choice, I am more familiar with Mongoose then Sequelize (both are the middleware used to help Node talk to the database).  For now, I will use Mongo and Mongoose to store the data from my application. Since I put each of those schemas in their own file I was able to export them. Once they were exported, I could require them in my main file along with the routes I created for each of my pages. I made a route for the login, the register page, the home page, and a place to render the results of a search. All of these are referenced in my app.js - the index of my project. In that same file is where I declare a url for Mongoose. Mongoose needs a connection between my application and the database inside o...

Salt Your Hash!

Image
Security is a huge topic in tech. As technology progresses so does cyber security. I know basically nothing about it either! However, we did learn about encrypting passwords yesterday and tried our hand at two different ways to do so. One package is bcrypt and another is Password. I played around with each and the biggest difference is that Password allows for logging in through twitter or facebook. Pretty neat, right? I didn't get the chance to play around with it that much though. I did local encryption instead. This all still looks foreign to me but a great benefit of Node.js is the ability to use these packages when you need them with the code you already have. As I get more comfortable with the language I'll be able to create a multi-page application with authentication, validation, and password encryption!

Model View Controller (Rinse and Repeat)

Image
There seems to be a lot of debate around what Model View Controller (MVC) is. After almost 48 hours of discussion, intense Googling, and furious debate I believe I can comfortably say that MVC is a way to organize your code. To compare, there are dozens of ways to organize a craft room. On top of those dozens of ways you could think of to organize your stuff - there are overarching theories and methods to help. I've read articles on the psychology of organization and popular methods such as bundling your stamps based on theme versus month of the year you would use it. MVC is a method of organization for programmers. Keep in mind a lot of the implementation is dependent on the project itself. Also, a programmer's code is personal and nothing beats methods that work for that programmer. With that in mind, MVC attempts to propose an ideology to follow. Model can be a folder to store sets of data and any logic used to filter through that data. View's purpose is to hold any vi...