CodeIgniter Forums
Code Suggestions? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Code Suggestions? (/thread-55135.html)



Code Suggestions? - El Forum - 10-11-2012

[eluser]NotDior[/eluser]
As I'm a lone developer and have no one else to bounce ideas off, I'm posting this here to see what other's thoughts on this might be.


Earlier this year the company I work for did a community initiative/website to help people get into better shape (think Biggest Loser for a town). What I had to build was a login interface, a way to track weight and steps. Fairly simple. As I built it I of course found ways that I'd like to improve upon the next iteration which I was lead to believe would be 2013. Well that's not the case. It's coming up by mid November. There are a few changes being requested, that are not really that big, but with what I want to do and they want to do, it does add up to a fairly large change. The kicker in this is that at the end of version 1 they told the community they could continue to use the site. So they (the designers and organizers) solution to the upcoming re-launch of this initiative is to copy things over to a new site and then copy again in early January when they begin the 2013 campaign. I instantly cringed at the idea of maintaining 3 different code bases that do 3 different things with possibly 3 different login accounts.

So what I'm looking for advice on is how to move forward with this without building three different applications or at least have a plan to combine into 1 in the end. The biggest thing that I want to change is to move towards using Ion_auth, or another authorization type of system rather than my hacked together thing.

Thanks in advance for any thoughts.


Code Suggestions? - El Forum - 10-11-2012

[eluser]Aken[/eluser]
First, sit down with whomever you need to and create a plan. This is the most important thing you can do to prevent problems in the future. Figure out exactly what you're going to do for the next phase: what to add, drop, change, fix, etc. Try your damnedest to never deviate from this list, or things will take longer and longer to get done. If this involves doing different stages of features released at different times, then fine. But have a PLAN.

Second, make sure you have a development environment that is completely separate from the current website, where you can work on the new version of the website. Copy everything as it stands and start from there. Learn about how you can change config values based on environment (the user guide explains this), which will allow you to integrate the new site without having to change a ton of details. Then I'm sure you'll want to continuously update your dev environment with data from the live one, so make sure you allow yourself to do this, either by not changing the DB much, or by creating a script that allows you to import data.

You may need to consider how you will integrate existing data if you do need to change things. For instance, Ion Auth might use a different DB setup than what you're currently running for users and sessions. If that's the case, you'll obviously need to port that data to its correct format, which may involve a SQL or PHP import of some sort.

Third, test. Maybe create a password-protected subdomain on your production server and try to test as much as possible, to make sure you don't run into bugs that are specific to your production environment. Try to discover as much as possible before releasing the code publicly.


Code Suggestions? - El Forum - 10-12-2012

[eluser]skunkbad[/eluser]
It sounds like your database would still remain somewhat the same, and if that's the case, I'd leave everything all in one application. Through routing and separate controllers, there's no reason why you couldn't just use a single authentication solution and have what appears to be 3 different websites all in one. Community Auth is set up to do this for i18n. Think about requests that come into the server for the three websites. If they all point to the same application, and if you code properly, you only need one app.

Also, not to toot my own horn or anything, but because Community Auth has so much done in terms of basic user management, there's really not a whole lot of work left to do to turn it into what you need. You'd probably spend more time re-styling the app than actual dev work.