Node.js experiment part 2: Research, review, and learning
I want to do this experiment right, so rather than jump right in I’ve decided to do a lot of research and planning before hand. I’ve also decided to review JavaScript and learn Node.js “correctly” by reading introductions and tutorials.
But two things before I begin:
- I need a name for the project! It’s bothering me that I don’t have one, and I don’t want to go through the bother of going with a temporary name and renaming everything afterward. Any ideas? It needs to describe the “resource blog” idea, but also maybe be cute and easy to remember. These are some random thoughts I’ve jotted down:
- bacon links?
- piggy links?
- library?
- repository?
- reference?
- collection?
- anthology?
- compilation?
- I want to be organized, so I’ve started a notebook for this project. I write notes on introductions/tutorials in it, and also just jot down any thoughts I have. I like writing things down on paper rather than just typing them, because it helps force me to think through it – when I type, sometimes I type so fast I can’t even think fast enough to keep up. I also discovered Trello, this awesome “collaboration tool” that’s perfect for organizing a project, especially projects with multiple people. I found it when I was looking through code52 about their most recent project. Here is their Trello board for their project Samurai. It’s awesome – there are lists of different types of tasks, and you put cards in the lists, which represent tasks. The cards can have notes, comments, and checklists, and can be labeled with categories and even have people assigned to them! Here is my Trello board for my experiment. I’ve just started putting it together so I’ll definitely be expanding it. Comments on the cards are welcome :) Also I feel silly assigning myself to everything, but when I finish things it makes me feel like I’ve accomplished a lot!
Here’s a table of contents again:
First I expanded my feature list so I could figure out what I would need to do. Here is what I have in my notebook:
- Log in to post
- Only me for now
- Goes to admin center – like the WordPress admin page
- Add/edit/delete resources
- Save versions eventually?
- Save drafts
- Moderate comments
- For posts:
- Create/select category (can only belong to a single category)
- Add tags
- Title
- URL
- Note
- Rating
- In the future, expanding for more users
- Admin can manage users
- Manage user profile – name, email, picture, URL, bio, etc.
- Add/edit/delete own posts
- Versions?
- Drafts
- Same as above for posts
- Permissions model – everyone sees same functionality but can only act based on permissions
- View resources
- Summary view and full view
- Summary view – multiple summary views on a page, “more” link will show full view
- Title
- URL
- Snippet of note
- Rating
- Category
- Tags
- Number of comments
- Votes with ability to vote (like Reddit)
- Full view – each resource on a single page
- Title
- URL
- Note
- Rating
- Category
- Tags
- Votes with ability to vote
- All comments
- Name
- URL/email
- Comment
- Add comment
- Name
- URL/email
- Comment
- Recaptcha
- Default view
- Display resources by time, most recent first
- Show each resource in summary view
- Category view
- All on one page
- Alphabetical categories
- Show in category tree
- Show minimized by default, can maximize to see summary view
- By category
- Same format as all on one page except each page is for each outmost category (subcategories don’t get own page)
- Can sort by date, rating, votes
- By tags (user search by tag)
- Show summary view of results, by date as default
- Can sort by date, rating, votes
- Minimized by default, maximize to see summary view
- By highest rated (my rating)
- Same format as tags view
- By highest voted (by visitors)
- Same format as tags view
- Index page
- Default view of resources
- Tag cloud
- Short list of highest rated with “more” link
- Short list of highest voted with “more” link
- Link to page with different category views
- Search bar for tags
- About link
- Contact link
Now that I’ve typed it out, I realized that there may be too many different views of a single resource – full view, summary view, and minimized view. I need to think more on that. I figured that showing the full view of every resource would be too much information if it wasn’t the index page so I think there should be at least two views, but it may not be necessary for both a summary view and a minimized view. I may get rid of the minimized view, otherwise someone would have to first expand the minimized view, and then click “more” on the summary view to see the full view.
I’ve also come up with a list of tools/frameworks that I think I’ll need for the project. I did quite a bit of research on the best tool for each function, and I think this is the finalized list. They’re in no particular order under each category:
- The general code – server and client side
- Node.js – obviously
- Express – web development framework
- Jade – template engine
- Stylus – CSS pre-processor
- nodeQuery – DOM manipulation framework with JQuery methods
- everyauth – authentication and authorization
- Async – utility module for asynchronous code
- node-UUID – generate UUIDs
- node-recaptcha – renders and verifies Recaptcha captchas
- Database
- Testing and debugging
- Vows – asynchronous behavior driven development
- should – assertion library
- Node Inspector – debugger interface
- nodemon – development monitor script
- JSLint – static code analysis
- node-jslint – JSLint from command line
- Deployment
- Forever – tool to ensure a script runs forever
- Logging
- winston – multi-transport asynchronous logging library
- Documentation
- NDoc – documentation generator
I’ve always had this really weird attitude towards using external tools. On one hand, I feel like doing everything myself is “better” in terms of me being a programmer and not being lazy. But at the same time I guess it’s not lazy, it’s being resourceful and using what’s already out there. I never know how I feel about it… I still get conflicted about it all the time. But I’ve got this huge list now, so I’ll have to deal with it!
There are still some things I need to consider for the project, and need to do research on – I won’t fully go into them here but they’re on the Node.js Experiment Trello board.
Since all my JavaScript is self-taught, and JavaScript is kind of important to Node.js, I decided to fill myself in by following a introduction tutorial. I also want to learn to use Node.js the “right” way, so I am following an introduction tutorial for that too. I decided on Felix’s Node.js Beginners Guide, which was suggested by a lot of people when I was researching best Node.js tutorials. And as luck had it, that tutorial suggested Eloquent JavaScript as a JavaScript tutorial, and it had good reviews when I researched it, so I’ve decided to follow that for my JavaScript review.
I’m up to chapter 9 in Eloquent JavaScript and it’s been great for me so far, as someone who already has programming background in other languages and wants to just pick up the little nuances about JavaScript (it still throws me off that you don’t have to tell a variable what kind of variable it is. And null vs undefined? == vs. ===? Closures?! Prototypes?!?!) However I think that as an introduction for someone who has never programmed before, it’s kind of a mess. It doesn’t explain things very clearly and kind of brushes over some programming concepts as “magic”. I had to do some outside research about closures and prototypes, and I still don’t fully understand them. They also try to shove too much down your throat – they had an entire chapter that was based around the concept of graphs but never explained graphs and just sort of threw code at you. I love the in-browser console though; it’s really easy to follow along with their code samples and edit it myself. Try out the in-browser console – it’s awesome. Overall I think it was a good choice. Still need the finish taking notes on the last few chapters though.
I’m also playing around with Codecademy to keep filling in any knowledge gaps I have. It’s neat, I like the tutorial format, with the skeleton code in the editor and the console to run it.
After that I’m going to take notes on Felix’s Node.js Beginners Guide. Then I’ll see what other knowledge I may be lacking and research some more good tutorials.
I guess I kind of already covered this with Felix’s Node.js Beginners Guide. But I’m also going to need to become familiar with all of the tools and frameworks I’ve chosen to use in the experiment, so I think that I will have to do some reading on each of those and code through some small sample projects for each of them, before I try to use them all together. I still need to come up with a plan for that – not sure what order I’ll be going in, as the list of tools and frameworks above are in random order. I wonder if it’s better to familiarize myself with testing tools first so that I can use them while I learn the others?
Anyway, it’s late now, so I’m going to bed. Goodnight!
Rohit
This helped me. Thanks !