Adding ability to upload profile photos

With Express 4, running into a couple of issues
Fuck connect-flash issue

Some shitty problem with fucking flash messages. Hooray.
Redid Passport.js for Express 4.0 - No dice

Not working, still getting 'no method flash' errors...
workspace blah

yep
Fixed the Issue thx to rdegges on IRC #express

Basically, being a complete n00b and knowing literally nothing about how
to program, I managed to place the app set-up files in a 'development'
only statement, meaning that req.flash() wasn't being initiated in a
production environment. This means I'll have to read up a lot more on
what environments are (i.e. production vs dev) and how to use them to my
advantage. Ah well, better late than never ;) On to file uploads...
Workspace

yeep
Made some progress with image uploads, about 20%

Got to the point where the upload form will take the file, send it to
tmp, rename it and keep it in an uploads folder. Next steps are linking
the file with the user, adding the url to their schema and making the
image their 'profile' photo. Also need to do type checking before
allowing uploads, and then need to make the file upload a jQuery / AJAX
/ socket.io production before sending through to Express. 20% seems
about right. Getting there...
Managed to get profile photos upload working.but....
Testing with passing more data to Jade template

Re: previous problem about rendering data from friends, could just be
the database choice which would mean redoing the whole thing with a
different database (likely relational), or could be me just not
understanding how to grab / send data using mongodb with jade. Need more
time to work this one out.
!Don't Go Live! Not yet...

To get friend details and pass to Jade
Proof of Concept, Failure in Execution :)

So I have user photos showing up (friend photos), but it's only working
on a small set - when I try to use an account with more friends it
hangs. I have to more deeply understand JavaScript callback functions
and work out how to make the database call fit in with the async nature
of node.js, as at the moment the response is executing before I receive
the data back from mongodb.

More work to be done...
Must. Learn. How. To. Use. Callbacks.

Yes.
Added asynchronous for loop to show friend's photos

Used this chapter of Mixu's Node.js book
(http://book.mixu.net/node/ch7.html) 7.2.1. (Control flow pattern #1:
Series - an asynchronous for loop) to add a series control flow that
iterates through each item of an array, does something (in this case
gets the friend ID and returns the name and their profile photo), and
once finished *then* calls the view render (profile.ejs). Problems
before this was the asynchronous rendering of the view before the
friends details had arrived, resulting in an empty section where the
profile photos should be. There was also an issue with duplicating
results, but all I had to do was set the array length back to zero
(array.length = 0). Cool, next step is to add the same functionality to
the chat view for profile photos and then decide if MongoDb is the right
choice for a social network (which it probably isn't...).
Was over-writing profile-photos with GitHub

Will see if problem is solved, .gitignore is the answer, just need to
get the format right
gitignore will work it out

photo thingy
one more time, should be ok now fingers crossed

gitignore profile-photos/
git ignore

yes
Profile Photos working, various minor edits

users will now see the profile photos of their friends in both the
profile and chat view. Started trying to change the way that gifs are
loaded to minimize drain on the cpu. Next steps include persistent cloud
storage for the images, and building a room feature for dynamic chat
rooms / groups i.e. me and these 2 friends in a private chat.
Changed file storage to cloud, persistent files

Was previously using a temp directory to upload files, causing them to
be wiped upon every restart / deployment. Now the files are uploaded
within cloud storage, meaning they are persistent. A next step re: photo
uploads would be allowing gif uploads, resizing images and creating
thumbnails, but that will take a back-seat to the next 2 major projects:

1.) The ability to create private groups (essential for a real platform
to work in the wild).

2.) Facebook, Twitter & Google login, to take care of authentication re:
Claudio's suggestion.