Thursday, March 21, 2019

LAMP Stack Introduction

Abstract :  LAMP (Linux OS,  Apache Web Sever, MySQL Database, PHP Programming Language) is collection of software that work together to provide the backend web server service to a web browser client front end. The LAMP backend web server service uses Apache that can handle complex transactions such as talking to a MySQL database.




Initial Problem and UX Requirements (What):

Craigslist List is a web site where users can browse or search for goods or services to buy or sell. Basic requirements are:

Browse:

  • For Sale : browse things to buy 
  • Services : browse services to rent 
  • Location : localize browse things to buy or services to a region


Post:

  • For Sale : offer things to sell
  • Services : offer services to rent out





Screen Shot 2016-05-03 at 10.55.22 AM.png





Initial Problem and UX Requirements (How):


Once the initial UX requirements is done, it is time to create the specification architecture. Here is the initial web front-end (client) and back-end (server). The red part is the data model and flow. The blue part is the control.



lampp_project.JPG



Front End / Client  (HTML,CSS, JS)


In the screenshot below, you can see a LAMP stack running. The hosting OS is Windows 8. The guest OS is Ubuntu Linux. Ubuntu is running on Windows 8 via VMWare Workstation 12 Player (free). In Ubuntu, the LAMP software was installed - with includes Apache web server, MySQL database server, and PHP.  The client is a web browser, being served by the Apache web browser. The project is located in my home directory (~albert/lamp_class_project).


The starting client web page site is cll.html. There are two major functionalities implemented. One is the browse section such as Books, Lessons, Part-Time, Stockholm. The section functionality is New Post.





finalproj1.png


Server / Back End (PHP, MySQL)

In the HTML, when the  user clicks on a category to browse (say books), the category is linked to a PHP file. The PHP file will execute and it will open a connection to MySQL, submit a MySQL query, then print/echo the results (which will be rendered by HTML where the books link was clicked).



Screen Shot 2016-05-03 at 11.56.21 AM.png


Data Model and Database :


A simple naming convention helps to differentiate between tuple (row), attribute (column), and relation (table). Below, I created a database called "dbHW3".


Screen Shot 2016-05-03 at 12.05.07 PM.png





Data Pre-Population of Categories, Locations  (MySQL)

Here is a SQL command to pre-populate the Craiglist Lite database.

Screen Shot 2016-05-03 at 12.06.29 PM.png


Results:

We showed how a LAMP stack can be used to create a simple "Craigslist Lite" web site to allow a community to browse or search for goods or services to buy or to sell.

finalproj4.png