Jump to content

better understanding of LAMP Stack through Reverse-Engineering Application


Recommended Posts

Hi all,


I apologize if this is not very well thought out as I'm still new to PHP, the LAMP Stack and web development.  I have a very general idea of how everything fits together but it's still very foggy for me. Most of the books I read focus on coding examples in PHP and some SQL but I'm looking to learn about how everything fits in together before coding.


I'd like to reverse engineer an application to get a better feel for how everything fits together.


I've downloaded an open source application called Time Trex but I'm already stuck. I'm even more lost now as it seems by browsing other projects that there's different structures or strategies to setting up the directory for websites.


In the case of Tim Trex :

After installed, I looked at the shortcut icon on my desktop and it showed  http://localhost:8085 . After double click, I am directed to the login page.

Right clicking on the page in Mozilla to show the page source came up with view-source:http://localhost:8085/interface/html5/#!m=Login . I traced it as far as C:\TimeTrex\timetrex\interface\html5  but where does the rest of the path:  #!m=Login come from? Also, how do I determine why this page was first to show? Are there specific files or folders I should be paying attention to?






Link to post
Share on other sites

Frankly, I doubt that it's a good idea to “disassemble” a full-blown web application in the hopes of learning web development from it.


Modern applications often hide the inner workings behind a thick layer of fancy techniques (URL rewrites, asynchronous requests etc.), making it very difficult to understand what's going on. Even actual programmers would struggle with this, and the learning value is very low. In the end, you may know a bit about HTML5 and hashbang URLs (the #!m=Login stuff), but that doesn't really get you any closer to becoming a developer.


The best approach is still learning-by-doing. Write your own application, preferably one that's actually useful to you. This allows you to learn the techniques in a much more practical and pragmatic way. Instead of wondering what the hell hashbang URLs are for, you'll be faced with concrete problems and concrete solutions.

Link to post
Share on other sites

I have to agree with Jacques here.  If you are already lost, that's not a good sign.  It is also a private project as far as I can see.  Sure you can try and pick it apart, but there are scores of projects that are open source, and hosted on github or bitbucket, and which actually encourage you to participate.  I'm not saying Time trex is badly constructed -- I haven't looked at it, but I've seen plenty of well known projects that are a complete mess and chock full of really bad ideas that would be harmful to emulate.


I'm not saying you should be an alarmist, and can take this with a grain of salt, but just for example:  http://www.webmonkey.com/2011/02/gawker-learns-the-hard-way-why-hash-bang-urls-are-evil/


Is Time trex really going to be a great app for you to learn the basics from when it is likely chock full of javascript, which is a challenging language itself.


I think you'll learn a lot more trying to build something with one of the modern full stack PHP frameworks like symfony2 or laravel, or there's even the well known CMS Drupal which just released version 8.0 that is the culmination of a multi-year effort to rebuild it on symfony2 components.


The modern state of the art for php uses composer and PSR-0 component libraries.  If you want to actually learn professional level PHP development you don't want to learn off a project that is 5+ years old.


Yes, the web has a lot of moving parts and there's a tremendous amount you need to learn, from the basics of TCP/IP to HTTP to HTML, the DOM, to CSS, javascript, javascript libraries and frameworks, Ajax, Databases/Datastores, basic web security and cryptography and on and on.  It's a huge challenge and a lot to take on while simultaneously trying to get down the basics of programming.  


If you have a project of your own, your desire to build that project will require you to acquire an adequate understanding of whatever things you need to accomplish that tasks, and this will lead to additional study topics.

Link to post
Share on other sites

Thanks for all your suggestions. I've built desktop applications in Access VBA (front end) and Sql Server (backend) but I know that web development is more complicated.


I went after Time Trex as I'm trying to learn some of the time sheet functuionality. Currently, I have a small project where someone built a log-in form, a time sheet, and a database for me.

Looking in the folder I see there is structure. However, I don't even know where to begin to understand how all the folders and files fit together. I want to understand the workflow of this application. Should I be paying attention to a particular file? Any suggestions on how to dissect this small application?



Link to post
Share on other sites
  • 3 weeks later...

I understand that you have a small time tracking app, but that is not going to jibe with Time trex other than they both offer some level of time tracking.  


If what you are saying is that you are trying to understand the time tracking app you had built, then we would need to know more about that specific application.  There isn't a universal way these things work. 


If the app was built with a specific framework, then there are frequently tell tale signs of that, but we can't guess.


Obviously you want to start with an index.php assuming that exists.  What does that include/require and where does it go from there.  Are there rewrite rules that come with it?


Most well built web apps have some form of MVC pattern, so there's typically a controller, with separate db model classes and views/templates that are loaded as needed by the controller.

Link to post
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.