A music shop based on the chinook database example.

Related tags

E-commerce chinook
Overview

LTW Example

Based on a simplified version of the Chinook Database:

You can see previous versions of the example by changing branches.

Step 1: Create the Database

To create the database, we need to run the following command:

sqlite3 database.db < database.sql

Step 2: Draw Mockups

Draw some initial mockups. Don't lose too much time with these:

Step 3: HTML in PHP files

Step 4: Create template files

Create a templates folder that will contain several template files.

Each template file will have functions that will be able to draw parts of the HTML:

Step 5: Style folder

Create a css folder that will contain all files related to style of the web page.

Step 6: Documents folder

Create a docs folder that will contain all files related to the documentation.

Step 7: Connect to the database

Create a database folder that will contain all database pertinent files:

Step 8: Use classes

Transform all data access functions into classes:

Each class has one or more functions to get data from the database.

Step 9: Log In / Log out Actions

  • Start a session on every page using session_start().
  • Create a class to get customer data: database/customer.class.php.
  • Create the action_login.php page that:
    • Receives a username and password, verifies if they exist in the database.
    • If they do, saves the customer data to the session.
    • Redirects the user back to the previous page.
  • Show a logout form if the user is logged in.
  • Create the action_login.php page that destroys the session.

Step 10: Edit Profile

  • Add a new profile.php page that shows a form to edit the profile of the current user.
  • Make sure it does not show if no user is logged in.
  • Add a link from the logout form to the new page.
  • Add a new action_edit_profile.php action page that receives the first and last name and saves them to the profile of the current user.
  • Make sure nothing happens if no user is logged in.
  • Add a function to save customer data.
  • Create a template to edit a profile.

Step 11: Responsive

  • Add responsive viewport to HTML head.
  • Set maximum width of body.
  • Add a media query for smaller screens.

Step 12: Ajax Search

  • Added am api_artists.php page that returns a list of artists with a name starting with a specific string in JSON format.
  • Added a function to get artists starting with a specific string from the database.
  • Added a search input box to search artists.
  • Added some CSS to format the search input box.
  • Added a new JavaScript file and included it from the header template.
  • Added an event listener to the search input that fires every time the input changes and:
    • Gets the 'api_artists.php' page using Ajax (with fetch), sending the text in the input.
    • Uses the returned results to update the list of artists.
You might also like...
Shopware 6 is an open source ecommerce platform based on a quite modern technology stack that is powered by Symfony and Vue.js.
Shopware 6 is an open source ecommerce platform based on a quite modern technology stack that is powered by Symfony and Vue.js.

Shopware 6 Realize your ideas - fast and without friction. Shopware 6 is an open source ecommerce platform based on a quite modern technology stack th

The Laravel eCommerce DHL Shipping module module calculates the shipping rates based on DHL API for product shipping.

Introduction DHL Shipping Add-on provides DHL Shipping methods for shipping the product. It packs in lots of demanding features that allows your busin

AbanteCart is a free PHP based eCommerce solution for merchants to provide ability creating online business and sell products online quick and efficient.

AbanteCart is a free PHP based eCommerce solution for merchants to provide ability creating online business and sell products online quick and efficient. AbanteCart application is built and supported by experienced enthusiasts that are passionate about their work and contribution to rapidly evolving eCommerce industry. AbanteCart is more than just a shopping cart, it is rapidly growing eCommerce platform

Roach-example-project - Example project to demonstrate how to use RoachPHP in a Laravel project.

Example repository to illustrate how to use roach-php/laravel in a Laravel app. Check app/Spiders/FussballdatenSpider.php for an example spider that c

Ampache is a web based audio/video streaming application and file manager allowing you to access your music & videos from anywhere, using almost any internet enabled device.
Ampache is a web based audio/video streaming application and file manager allowing you to access your music & videos from anywhere, using almost any internet enabled device.

Ampache is a web based audio/video streaming application and file manager allowing you to access your music & videos from anywhere, using almost any internet enabled device.

Modern CMS with shop features based on fullstack symfony and sylius components

The enhavo CMS is a open source PHP project on top of the fullstack Symfony framework and uses awesome Sylius components to serve a very flexible soft

Simple PHP shop CMS based on Laravel 5.1
Simple PHP shop CMS based on Laravel 5.1

LaraShop LaraShop is a simple SHOP CMS based on Laravel framework. Temporarily available at russian language, in planned english. Screenshots Features

Integrated online shop based on Laravel LTS and the Aimeos e-commerce framework
Integrated online shop based on Laravel LTS and the Aimeos e-commerce framework

⭐ Star us on GitHub — it motivates us a lot! 😀 Aimeos Laravel ecommerce platform Aimeos is THE professional, full-featured and high performance e-com

🐦 A personal music streaming server that works.
🐦 A personal music streaming server that works.

koel Intro Koel (also stylized as koel, with a lowercase k) is a simple web-based personal audio streaming service written in Vue on the client side a

🐦 A personal music streaming server that works.
🐦 A personal music streaming server that works.

koel Intro Koel (also stylized as koel, with a lowercase k) is a simple web-based personal audio streaming service written in Vue on the client side a

This is a Task Manager system for managing your task. You can categorize your tasks and upload music to the project And a whole host of other features

taskManager Login and register Each user can have their own task Categorize tasks by creating folders Edit and Delete Folders Search for Tasks Show nu

This plugin allow you play music from resources pack in minecraft

Music Player for PocketMine-MP Commands music-start songname music-stop songname IMPORTANT! You must add music resources pack to PocketMine resources

Search music with voice

Configuration: Open the index.php file and paste the bot token: define('API_KEY', 'TOKEN'); Login to Ahangify and create an account Open the login.php

Music website developed as a final group project for our Webpage Development class.

double-drummer Music listening website developed as final group project for our Webpage Development course. All parts that disclosed any information r

🐦 A personal music streaming server that works.
🐦 A personal music streaming server that works.

koel Intro Koel (also stylized as koel, with a lowercase k) is a simple web-based personal audio streaming service written in Vue on the client side a

BicBucStriim streams books, digital books. It fills a gap in the functionality of current NAS devices that provide access to music, videos and photos

BicBucStriim streams books, digital books. It fills a gap in the functionality of current NAS devices that provide access to music, videos and photos -- but not books. BicBucStriim fills this gap and provides web-based access to your e-book collection.

Musicoker is a music player made by Laravel & Reactjs
Musicoker is a music player made by Laravel & Reactjs

Musicoker | Music Player Music player created with Laravel 8 and React 17.0.2 ReactJs Laravel MySQL Used Packages: Sanctum Getid3 Bootstrap React Rout

A powerful music API framework to accelerate your development
A powerful music API framework to accelerate your development

🍰 Wow, such a powerful music API framework Introduction A powerful music API framework to accelerate your development Elegant - Easy to use, a standa

Generates a static website of metal music events in Leipzig

About EN: This projects generates a static website of metal music events in Leipzig (Ger). DE: Dieses Projekt erstellt einen Webkalender zu diversen M

Owner
André Restivo
André Restivo
Full stack shop app with Symfony

A progressive PHP framework for building efficient and scalable server-side applications. Description A fullstack shop app with Symfony framework and

F43Z 6 Feb 20, 2022
Lakasir is a free, open source and online Point Of Sale Software designed for small shop or retail

Lakasir is a free, open source and online Point Of Sale Software designed for small shop or retail. It is built with modern technologies such as Laravel, VueJS, Bootstrap 4, RESTful API etc.

Lakasir 234 Dec 31, 2022
Shoperz - Free Open Source Web Shop

Shoperz Shoperz - Free Open Source Web Shop Version 1.0.1 Next update will be added: [+] Function change password [+] Function Change page Name [+] Fu

null 1 Nov 19, 2021
My Shop E-commerce Backend API Service

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Dzulfikar Sauki Akmal 7 Dec 30, 2022
Bootsrap Responsive Multi-Vendor, MultiLanguage Online Shop Platform

Shopping Cart Solution - CodeIgniter and Bootstrap Bootsrap Responsive Multi-Vendor, MultiLanguage Online Shop Platform Current versions: Codeigniter

Kiril Kirkov 1k Dec 30, 2022
Bootsrap Responsive Multi-Vendor, MultiLanguage Online Shop Platform

Shopping Cart Solution - CodeIgniter and Bootstrap Bootsrap Responsive Multi-Vendor, MultiLanguage Online Shop Platform Current versions: Codeigniter

Egan 2 Oct 23, 2022
Example of Pre-Loader Implementation for Magento 2

Example of preloader Implements optimistic preloader for configurable product data without taking into account simple product status for: Price of con

EcomDev B.V. 10 Dec 12, 2021
A free shopping cart system. OpenCart is an open source PHP-based online e-commerce solution.

OpenCart is a free open source ecommerce platform for online merchants. OpenCart provides a professional and reliable foundation from which to build a successful online store.

OpenCart 6.6k Dec 31, 2022
A robust session-based shopping bag for Laravel

Shopping Bag A robust session-based shopping bag for Laravel Go to documentation Documentation Documentation for Shopping Bag can be found in the docs

Laraware 30 Dec 13, 2021
A free open source e-commerce platform for online merchants based on customised version of Laravel.

A free open source e-commerce platform for online merchants based on customised version of Laravel.

Ace Vinayak 58 Oct 19, 2022