views:

70

answers:

3

As a programmer used to developing native applications, I'm expanding my horizons and developing my first web app. I'm intermediate to expert with Linux and C, intermediate with Python and HTML and beginner to intermediate with MySQL and Java.

I'm developing a web app that is more or less a resource allocator for a friend of mine. To put it simply, I want this program to help him manage jobs, assigning technicians and equipment. The main screen will be an embedded Google Calendar frame that can be updated dynamically via. their API. Now, certain jobs require technicians to hold certain certificates, and equipment must be calibrated on a specific schedule. I would also like to track extra data, such as phone numbers, e-mail addresses, job information, etc. To top it all off, I want it to look nice!

I've spent quite some time familiarizing myself with PHP, JavaScript and the DOM and I've developed some functionality and a neat UI. So far I've been coding server-side w/ PHP to deliver dynamic HTML via. MySQL and then JavaScript to manipulate the DOM. I have tables for technicians, certificates, jobs, phone numbers, etc.

My questions are:

  1. Is there anything missing to my general approach for developing a web app? (Server-side scripting interacts with database to produce dynamic HTML which is then manipulated client-side via. the DOM/client-side scripting).

  2. I chose PHP because it is commonly associated with web development. What are the alternatives? As a beginner I would like to know the "best" server-side language to learn (and I am up for a challenge), or at least be aware of the alternatives.

  3. As far as client-side goes it seems that JavaScript is IT. Is it?

  4. I've heard alot about AJAX but know little to nothing at all about it. Is it an alternative to generating HTML server-side via. a database? What is it/advantages/disadvantages.

  5. I've read that frames are being deprecated. Should I move away from frames and more towards DOM manipulation?

  6. If this application is to be available over the internet I will need to setup a login system of some sort. What are common ways of setting up authentication using hosted or private services?
  7. (Getting a little off topic) Any free hosting suggestions? I'm a student, and hosting the server myself would be unreliable for my friend.
  8. I would really love to implement as much of this project via. Python as possible. What can Python do in terms of programming for the browser and what would it require?

EDIT: Sorry for the long post, any answers are appreciated!

+2  A: 

Is there anything missing to my general approach for developing a web app? (Server-side scripting interacts with database to produce dynamic HTML which is then manipulated client-side via. the DOM/client-side scripting).

You'll need a scheduler like cron to enforce things on the server side beyond the calendar. A calendar is great for recording the events (such as maintenance of equipment or calls for engineers) but in order to enforce this you may want to put calls on hold for an engineer if their equipment has missed a maintenance, etc.

I chose PHP because it is commonly associated with web development. What are the alternatives? As a beginner I would like to know the "best" server-side language to learn (and I am up for a challenge), or at least be aware of the alternatives.

There are many alternatives, Pylons or Google App Engine may be good alternatives for you from a Python background.

As far as client-side goes it seems that JavaScript is IT. Is it?

There is Flash, Silverlight, etc. jQuery (a JavaScript framework) seems to be a popular choice.

I've heard alot about AJAX but know little to nothing at all about it. Is it an alternative to generating HTML server-side via. a database? What is it/advantages/disadvantages.

AJAX boils down to dynamically updating the page viewed instead of making a new page every time.

I've read that frames are being deprecated. Should I move away from frames and more towards DOM manipulation?

It depends if you are moving to AJAX or not really. iframes are likely to remain, even if traditional frames are removed from browsers.

If this application is to be available over the internet I will need to setup a login system of some sort. What are common ways of setting up authentication using hosted or private services?

OpenID seems to be popular and with the availability of libraries it should remove much of the effort required in maintaining your own authentication.

(Getting a little off topic) Any free hosting suggestions? I'm a student, and hosting the server myself would be unreliable for my friend.

Google App Engine is free for up to 5 million page views a month (approx). If you set up billing for $0 a day you'll get even more resources for free.

I would really love to implement as much of this project via. Python as possible. What can Python do in terms of programming for the browser and what would it require?

If you are coding for use Internet Explorer you can call Python using an activex object, but then things get messy.

As an added bonus Google App Engine support schedules, has built in libraries for talking to Google Calendar, supports OpenID (referred to as Federated Login) and provides free hosting for smaller use.

The type of application you are describing is generally called 'Field Service'. Other things you may want to look at are ViaPost for sending out paperwork, Lone Worker for ensuring the safety of engineers on site (may be a regulation), schedulers (there are many patterns and systems including some that use triangulation to make engineers more effective) and automated voice systems (some of them have an API) combined with vehicle tracking to inform clients that the engineer will be late (this can be automated).

You may also consider using mobile devices for dynamic call dispatching, collecting client signatures and printing off paperwork at site.

Metalshark
+2  A: 
  1. Is there anything missing to my general approach for developing a web app? (Server-side scripting interacts with database to produce dynamic HTML which is then manipulated client-side via. the DOM/client-side scripting).

No - that's the usual setup. Actually, client-side scripting is quite often missing, and web-page is completely refreshed on any interaction. Your description is perfectly fine.

  1. I chose PHP because it is commonly associated with web development. What are the alternatives? As a beginner I would like to know the "best" server-side language to learn (and I am up for a challenge), or at least be aware of the alternatives.

This is a debatable topic, subject to different tastes, thus usually more suited to community wiki; besides, there's bunch of such questions already.

Very quickly, PHP is most common because it is the easiest to configure, but it has bunch of cruft. Perl is old-school, and rather unreadable. Python and Ruby are currently the hottest, owing to amazing dynamic frameworks (CherryPy and Django vs. Sinatra and Rails), but the rivalry is strong, and everyone has picked a side. I'll tell you Ruby is nicer to work with, but someone else will say the same for Python. However, configuring them is a bit more difficult (i.e. not usually standard option on majority of hosting providers).

  1. As far as client-side goes it seems that JavaScript is IT. Is it?

That's it, if you're talking about HTML. The alternatives died off.

  1. I've heard alot about AJAX but know little to nothing at all about it. Is it an alternative to generating HTML server-side via. a database? What is it/advantages/disadvantages.

AJAX is a fancy name for making a HTTP request from JavaScript without reloading the page. The requested content can be executable JS, or parsable XML, or ready-to-insert HTML... and it is the only method to get some data client-side without refreshing the whole page.

  1. I've read that frames are being deprecated. Should I move away from frames and more towards DOM manipulation?

An emphatic yes. However, iframes have their (limited) uses. You most likely do not need them.

  1. If this application is to be available over the internet I will need to setup a login system of some sort. What are common ways of setting up authentication using hosted or private services?

Username + encrypted password in database, when user enters username + password, encrypt password and check both against the database. If successful, record username in session.

Another way is OpenID, but it requires a third-party OpenID provider.

  1. (Getting a little off topic) Any free hosting suggestions? I'm a student, and hosting the server myself would be unreliable for my friend.

Not too knowledgeable. I know about comyr (general purpose) and heroku (Ruby), both free for non-commercial use, AFAICR, but a bit of research can get you more.

  1. I would really love to implement as much of this project via. Python as possible. What can Python do in terms of programming for the browser and what would it require?

It can do everything in terms of server-side programming, just like any other Turing-complete language. It can do it pretty easily, being a dynamic language with lots of nice libraries targeted for web development. It will not do anything at all for the browser, though. Check out CherryPy for lightweight, and Django for heavyweight web app framework.

But I thought you chose PHP?...

Amadan
+1  A: 

I'd like to suggest ditching PHP as soon as possible. Searching 'php wtf' here should be illuminating. While it is possible to write secure, safe, reliable applications in PHP, I think it is despite the best efforts of the PHP team to make The Most Exciting And Surprisin Language EVAR. With lots of funny side-effects. And pretend-security-options. If most of what PHP looks like is appealing to you, I think I'd suggest using Perl instead. It should be much less surprising.

So, with my rant against PHP out of the way, you have a LOT of much better options. Python has Django, Zope, and Twisted Matrix. They each solve different problems, allowing you to write applications at different levels: Django imposes some Model-View-Controller structure on your code, Zope is a much larger CMS framework, and Twisted Matrix provides a lot of super-keen programming primitives if you want to write things pretty close to the wire. (You're something like five lines of code away from a very-simple-yet-neat web server with Twisted that runs your application code..)

If you really want to learn another language in the process, Ruby on Rails is getting a lot of the hype, and for mostly good reasons. I've really enjoyed coding Ruby on Rails, the imposed structure is fantastic for anything beyond trivial applications, and it mostly gets out of your way with reasonable assumptions.

Perl is 'the old standby'. I'd take it over PHP any day, but I can't stand Perl's OO or modules system. So it's hard for me to really endorse it.

I'd like to suggest against Flash and Silverlight on the client-side: First, Flash is a giant resource hog and security disaster, and Silverlight, while probably better than Flash on both fronts, is even less portable than Flash. (I strongly recommend trying your site on a handful of mobile browsers; it doesn't have to look pretty, but everything ought to work. :)

sarnold