A full real CI example website (see story inside) |
[eluser]gullah[/eluser]
My brother and I spent many months designing and coding our website Unravel The Music. We decided that it is now effectively worthless because the API we used for gathering lyrics was recently sued and shutdown for copyright infringement. We weren't really aware that this was a major risk for us and one that we were really willing to take on. We therefore decided that since this is a hobby site and we are unable to afford licensing for lyrics the site is essentially valueless and we are looking for something else to put our time into (if you have any ideas or support we'd love to hear it). Since we no longer really plan on pursuing this website any longer I wanted to offer up to the community many examples of codeigniter code. While some of them may not be "best practice" I feel they still get the job done well. So, if you want to see examples of the following things plus much much more check out the source, let us know how we did, what you think and anything else on your mind. User activity feed Journals Blog Most disccused lists User Karma system Multiple APIs Memcached integration Searching Cataloging User profiles AJAX and jQuery examples File uploading (thumbing and resizing) Comment voting Threaded comments Artist/Album/Song Tagging Amazon integration Issue Reporting Power User management console Admin console We could try to set it up as a music blog and spotlight interview site but there are just so many of them already we don't see how we can be competitive as we can't be dedicated writers and we are both in school and working. Therefore I hope you learn something from our work. So please any comments, tips, concerns or whatever, just leave them below. Please note if you are looking at songs/view the lyrics section has been intentionally crippled to not work. http://www.unravelthemusic.com/unravelthemusic.com.zip www.unravelthemusic.com Edit: I’ve actually decided to start a simple wordpress blog to share and explain some of the code in a much more structured format rather than a source code dump. Hope you all enjoy it. http://unravelthecode.wordpress.com/ Edit2: Thanks Snaver for putting the code up on BitBucket. BitBucket
[eluser]jedd[/eluser]
Hey .. sad story, but I really applaud your decision to give this to the world. Thank you so very much (even if you share the same concern as the rest of us with regards 'not quite best practice' ![]() Couple of hints. application/config/database.php - might want to change your password at your end now. ![]() Consider publishing this to something like [url="http://github.com"]git hub[/url] so it gets a bit more exposure / people can contribute code / make it more easily explored. I see that there's no .svn or .git sub-directory, so I'm guessing you weren't developing this with a cvs? Finally, there's no licence (or even license) file in sight - you should probably specify one somewhere. I'd go for GPLv2 (or later) but I'm a GPL fanboy - you should, in any case, consider your position on the licensing front.
[eluser]NateL[/eluser]
Wow! browsing thru the code right now. I certainly appreciate this ;-) :-)
[eluser]gullah[/eluser]
Yowza forgot about the database password... Thanks for pointing it out. and for the curious I did change it if you got it.
[eluser]jedd[/eluser]
That kind of thing has bitten me in the past when wrapping up things for public consumption. I don't imagine anyone around here would try to do anything unpleasant with it, so don't panic on that front. But I have to ask .. what's with the hatred of whitespace (empty lines between blocks of code, say) and comments? (Hey, if I didn't, someone else would ![]()
[eluser]gullah[/eluser]
You have to understand, this was just me working on anything in controllers, models or view files. I never intended on anyone else seeing the code so I just tried to write code that made sense without needing comments. If you have questions on what something does I'd be happy to explain it.
[eluser]jedd[/eluser]
It's just that this is a truly mammoth library of work - I'm sure it was a very painful decision to 'let it go' - and I'm both amazed and impressed that you could track everything in a project of this size in your head without using tools like phpdoc, or a software version tracker, etc. (It's one of those regrettable insights that makes me feel old and dumb.) I, too, am digging through the contents at the moment .. and (to use the young person's vernacular) it's, like, wow, like, this is just massive. There's the thick end of 10,000 lines of code in here - and for a 'conventional' PHP suite that figure would be broken down into about 6k lines of code, and 4k lines of comments. With this code, it feels closer to 9:1.
[eluser]Dam1an[/eluser]
Wow! It's great of you to share this after the sad story. Gives people another big scale application to look through I just ran CLOC on it (Count Llines Of Code) and it said (just for the PHP as it seems to be ignoring HTML, CSS and JS today :S) Code: 17814 Comments: 2467 Blank lines: 3014 I've not started looking through the code yet, and based on the size, it may take me a while lol But yeah, I'm too impressed you managed to keep track of whats what without using PHPDoc, Version control etc
[eluser]überfuzz[/eluser]
Tough luck... I hope you learned your lesson though. Be very cautious whenever your about to use any information that any one in the record industry could see as their own. Any even more, that you cherish learning how to make such a nice site...
[eluser]jedd[/eluser]
[quote author="Dam1an" date="1252898214"] Code: 17814 Comments: 2467 Blank lines: 3014 [/quote] I think your cloc is running slow. ![]() Not sure what scope you were limiting yourself to there, but just looking at the controller (less the admin sub-dir) collection: Code: $ cd controllers So .. 154 functions spread over 5,500 lines, with 248 lines of comments, 5 blocks of comments, and 239 blank lines (dos format, so I had to mung that a bit) Seriously, that's making my nose bleed just thinking about trying to track all that in my head, over a period of several months!, and while I was doing something else (school) that required non-trivial amounts of my time and concentration. |
Welcome Guest, Not a member yet? Register Sign In |