Web Development Workflow
Posted on April 21st, 2008 at 21:04 in Code, Linux, My World
Lately I’ve been working on some web projects, nothing major, one of which is the template for this blog. One thing that always bugs me is the workflow for web development. What is the best workflow for such projects, that require server side testing ?
How to develop a Wordpress theme without major hassle ? Or a php website for that matter ?
Option 1
Deploy a local http server, and test it as you code it on your local machine.
Downsides
- Requires deployment of local http server and mysql server and wordpress/custom stuff.
Upsides
- Fast code/test/fix cycle.
- If you screw up, just reinstall or star over.
- Does not bother visitor on production sites.
Option 2
Code directly on the server. Through ssh.
Downsides
- Remote work is usually slugish.
- Requires exporting the X windows for minimal usefulness.
- Too much work to get into a usable state.
- Direct work on the database/project/software.
Upsides
- Direct work on the database/project/software.
- Already deployed server/php/mysql/wordpress whatever software.
But I recently found a third option that seems viable.
Option 3
Mount the remote working directory through sshfs.
Downsides
- Remote work can be slugish.
- Direct work on the database/project/software.
Upsides
- Direct work on the database/project/software.
- Simple deployment. Just mount the damn thing and be on your way.
- Take advantage of your desktop/development environment.
This is the latest and greatest solution so far. But this still doesn’t sound like perfect, because if I want to code a wordpress theme/template I have to enable it and work on my production website, which hinders both development and visitors.
Has anyone got a great solution for this ? A great workflow ? Or am I just being lazy and should install everything locally ?

There are other options to consider. For a regular php development a light weight web server like lighthttpd. For python/rails web development there are other options as well. As for the database, if you do not code for a specific database engine, you can develop in a sqlite3 database an deploy in a mysql or postgre (DBI should, theoretically, by your friend here).
As for the workflow, if you develop locally you can use a SCM like git or svn and perform commits/chekouts in a dev branch. You can also deploy through ftp if you are into that. But since all development is local in practice the server side testing will only be integration testing.
In the remote development universe, you can use a separate installation for dev purposes only. Keep in mind here that i do not know the inner working os a Wordpress install or how easy is to support multiple sites/blogs in it.
My workflow is simple. Light weight server, a development database (copy of the original), git for versioning and a separate copy of the site (usually in my user directory and not in the root of the server)
Hope it helps.
Besides your obvious laziness :>
I think option 3 is the best as long as you have two instances of your project (say: default + devel) because when you are finnish you just need to rename
? It makes your life much easier
BTW: have you tried moving your PHP projects to cakePHP
I don’t understand a couple of points:
Option 2 - “Too much work to get into a usable state.” - what do you mean by that ?
Option 3 - “Take advantage of your desktop/development environment.” - if you install vim on your server, you’ll have a complete dev environment
More seriously, I think 2 and 3 are more or less equivalent. In 2 you have to fuss about with X, in 3 you have to fuss with sshfs. Sluggishness will be similar.
I believe it all boils down to how slow the connection is. If it were good enough I would use option 2 (or 3 - matter of taste). If not I would go for 1.
BTW: I know you know Python. How about giving Django a try ?
It’s nice to see old friends commenting in Alfredo’s blog, but what about you two (Rafael and Inacio) starting your own blogs
?
Master plan: start planet HNG :>
I hate blogs
@Rafael
That mostly applies to general php. I’m also interested in Wordpress templates, since this still needs a lot of work as you can see. But useful nonetheless. I also use git for a lot of things. Quite useful.
@Diogo Gomes
Laziness is good. It makes you rest.
cakePHP ? Will have a look. Thanks.
@Nuno Inacio
Option 2 takes more time because I have my desktop customized for development, but not the server. By the way, I use gvim for most of my editing/coding, so it implies ssh -X. Connection is over 802.11g, so its not very responsive. Wifi sucks.
Have to give django a change… let’s see.
@all
I’ve been cutting down on the laziness. I’m always going about with my GTD. Will give more info on that later.
PS: I like blogs.
Hi again.
Aren’t you being excessively picky ? In my home’s wifi connection I cannot notice any lag at all. Only difference is a much lower sustained throughput (e.g. copying large amounts of data).
I’m with Inacio. Matos, you’re too picky
[...] my previous post on Web Development Workflow, I decided to be done with my procrastination and setup a local workflow, which keeps me location [...]