How to Create a Web Service: Start to Finish – New on Premium
plus

How to Create a Web Service: Start to Finish – New on Premium

Download Source Files

There’s no two ways about it; putting together a website is hard! You need to know a myriad of programming languages (HTML, PHP, CSS, AJAX, Javascript, MySQL, just to name a few). You also must understand how to combine these tools into one cohesive whole, which is hopefully more than the sum of its parts. These days, we use frameworks, boilerplates and generators, but do you actually – when you get right down to it – know how to build a website from scratch?

Become a Premium member to read this tutorial/screencast, as well as hundreds of other advanced tutorials and screencasts from the Tuts+ network.

This tutorial is meant for those who can write a PHP function, know what jQuery is, can handle their CSS well, but would like some insider info on how a web service is built from scratch. How should I organize my files, where should I keep my functions, how should I start planning the thing, how should I connect to the database, how should I handle AJAX calls and how should I manage my 404 pages are just some of the questions I try to shed some light on here.


Introduction

The service we will be creating is called Bonsai Writer, a tool which will convert plain text into HTML. It is aimed mostly at writers but it can also be used as a note stash for more general use.

Wireframe

Become a Premium member to continue reading this tutorial, as well as hundreds of other advanced tutorials and screencasts from the Tuts+ network.

Tags: Premium
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.vision-ps.de irfan

    is there any demo

    • Tio el

      I agree. There should be a demo, i would like to see what this service looks like running

  • http://www.raid-craft.de chieftrain

    demo for what? its a tutorial is about learning the basics for planing a web service. Take it or leave it ;)

  • http://github.com/ifightcrime Nick

    that’s not a web service!

  • Drew

    Awesome! Is there supposed to be a .htaccess file in the source?

    • Brad

      I was wondering the same, if I use the htaccess file made up of only whats in the tut I get a page full of errors. If I dont I only get one error from the index page

  • http://www.welancers.com Aslam Doctor

    Is this available on tutsplus marketplace ? I would like to purchase it from there :)

    • Dieter

      Yes, pls put it on marketplace.

    • Matthew Votsikas

      I agree, rarely are there premium posts that interest me enough to pay for them on a regular basis. I would like to see this one without having to sign up to premium.

    • http://digitalbart.com Bart

      Please add thanks

    • http://photodune.net?ref=kokakoala Koka Koala

      Pleeeeeas! …

      • simon

        Yep, Tuts+ Marketplace please.

    • Mabel

      Agreed!

  • ingo fahrentholz

    demo?

  • http://www.y8zone.com/ Y8

    I was also having problem on how to interpret my designs to designer cause I’ve been planning on having my own design but don’t know if they can understand what I will be dictating to them.

  • HeatoN

    Sounds charming…It seems like it’s exactly what I was looking for…

  • eratox

    Awesome! Just what i needed. +1 for the Pulp Fiction quote.

  • Shane O’neil

    None of the “programming languages” you mentioned are even programming languages. HTML is a markup language, PHP is a scripting language, CSS is a style sheet language, AJAX isn’t even a language at all, Javascript is a scripting language, and MySQL is a relational database utilizing a superset of SQL — a query language.

    • Tom Bakker

      Who cares? You get the point right?

    • http://danielpataki.com Daniel

      Shane, you are completely right, excuse the oversight on my part. Programming language is used so widely now (incorrectly) that I have taken on this bad habit myself!

  • http://www.msguy.com Ravi

    Good One. But Web Services are old now. WCF Services are new. I saw an example of creating a WCF Service to query database from silverlight. Here is the video
    http://www.msguy.com/2011/10/silverlight-calling-wcf-service-to.html?utm_source=BP_recent

  • mxl

    Screencast…where? Maybe I’m blind or something but I was only able to download the html page.

  • http://danielpataki.com Daniel

    Hi Guys,

    Daniel (the author) here. Sorry about the htaccess file, it doesn’t carry through well with zip files. Take a look at the htaccess file at http://bonsaiwriter.com/htaccess.zip

  • Gold_Dust

    Man make a vide tutorial out of this

  • eek

    I’m not quiet sure if that what I think it is.
    I’m developing a new web-service firm, is that article is for the steps for creating a good web-site, a good online service, not quiet sure?

  • Christian

    Hey guys whats up with you?
    Has anybody of you looked at the source code?
    Have you ever heard of OOP, Design-Pattern, MVC or something like Global State.
    Whats up with all the things we use for years in professional PHP development.

    I am sorry to say this, but its a total mess.
    You should never ever use something like this in a pruduction environment.

    Just me two cents.

    • http://danielpataki.com Daniel

      Hi Christian,

      It’s Daniel, the author here. I completely agree with you, it is not intended to be used as a fully functioning web service. The easiest way to learn OOP is to learn procedural first. Also as I said in the article, this is basically an advanced wireframe.

      Whenever I start a project I create a site like this. Doing this full on with OOP takes much more time and planning but I can band something like this out in a day or so.

      As I said in the article its not just the lack of OOP that’s the problem but security and many other things are not properly implemented. This was not the point however.

      I found that when I started out in programmin that making the jump from being able to work with preset functions in WordPress and being able to actually create something on your own is the hardest. This is meant as kind of the first step in that direction.

  • Koka Koala

    i can’t find it on tuts+ marktplace :(

  • http://sutekisushi.com sushi

    where is the tuts?

  • Tio el

    Why isnt there a link to the tuts+ page for this tute?