New App: jetskiregistry.com

I am seriously going jetski crazy over here.

As a member of the JS300, 550, and 650 FaceBook groups,  I am very excited that many people are joining the groups, sharing stories, helping troubleshoot issues, and teaching novices about jetskis.   Two weeks ago one of the admins of the JS300 group mentioned the idea of making a jetski registry.  I commented and offered my resources for hosting and building the app.    Last week we got on the phone to discuss our ideas for the registry and together we picked out jetskiregistry.com.

Today I found a template:  (here) and quickly made a repository: (here) and setup hosting for jetskiregistry.com on my cpanel server.   I adjusted the template a bit, removing the default text, changing some things around slightly.  I then got onto my stock.adobe.com account and started looking for jetski icons and graphics.  I found one I liked and modified the existing templates main graphic with the jetski graphic.  Next I registered my facebook app (used to login/connect later) and created all the metatags I wanted to have in the application.  I used the facebook debugger tool to test that all tag data was passing correctly.  Next I started on the Register Your JetSki form html.

Once I had the page working like I wanted I created the database with tables for jetskis, users, jetskis_likes, jetskis_comments, jetskis_links, jetskits_tags which I will use later as I further expand the applications abilities.    I then started updating the template for post validation, post handling, and database insertion.  I got the jquery working for the Register Your JetSki button.  Next I created the RESTful /api/ to handle a single action registerJetski with the post form data.   While creating this application I also updated the server to php 5.6 and created the insert using the mysqli interface for prepared queries.   I struggled a bit getting the new mysqli properly setup for capturing mysql errors but once I was able to see errors adjusting the code was a bit of trial and error.

For this project I am continuing my theme of losing the old ways and using new ways.  I spent some time working in Google Cloud and OpenShift.  My intention was to roll this application out with ruby on rails for “free”.   However, with quite a few build, and access issues on both of those platforms I chose not too.  I am needing this project to be low impact on my time so I went the self hosted route.    Since I am still using LAMP, part of this will be not exposing php in the application at all.   That means that 100% of the page interaction will be handled by jquery and the /api/ without any links or source code back to a .php file.  This also means the main application index will remain index.html so I will have to avoid needing to do server side logic within the template.  At current time, the only 2 necessary php files are non repo file settings.php for the db credentials and /api/ folders index.php.

Day 2:

Today I am going to work on Viewing the jetski data in the JetSki Registry.  Before I get started on making jetskiregistry.com/jetskis/ work I took a moment to create a bit of php code that will prevent a user from accessing any index.php directly.

if($_SERVER[‘REQUEST_URI’]!=’/api/’) { header(“Location: /”); }

Since my one page application will never use .php in the html markup,  I want to make sure no one can figure out php exists by being clever and trying /api/index.php.  Anyone trying to access the main page index.php, or any of the subfolder’s index.php will also get a 404 header and redirect  immediately back to the root domain.  Neat.

To get /jetskis/ working I created an .htaccess line to redirect that url request back to index.html.  I then wrote some javascript and jquery that would recognize if the window.location.pathname was /jetskis/.  If the request is /jetskis/ an ajax call to /api/ for getJetskis returns html markup into the existing page.   The rest of the one page application will continue to operate an exist as normal.   I have just created another “page” on my website without creating another page.  Next I needed to add a timestamp column to the jetskis database table.  I want to display the most recently added jetskis by timestamp DESC.   With the url working, jquery working, and the api working, it is now time to focus on improving the markup and displaying the full view for a jetski row.

With this now working to show 10 jetskis I am done for the day.    Next I need to go ahead and build a dynamic grid view for mobile.  The giant tableset only looks good on larger browsers.  Once I have the view looking better then I will focus on Search, showing more than 10 (Load More), and jetski Photos.

Day 3:

I spent just a small amount of time today working on the mobile grid jetski view and adding full screen modal to view info for each jetski.  I also spent some time adding FaceBook Connecct & Login to the code base.  I was able to copy most of this from previous project and get the fb app connected, but I must convert all of the php functions to prepared statements in order to insert the user.    I did not get finished with all of the deeper integration for login/logout so will pick up next time.

Day 4:

I have not had much time to mess with this project.  I have been doing other stuff.  During this time the hosting has moved off a cpanel server to just a simple digital ocean box.  Today I added just some basic field requirements for registering a jetski,  got facebook login working, got the facebook image working, and got the fb user id added to the database when registering a jetski.   I am choosing to foregore the normal register a user process and will only allow facebook login until this project needs full user services.

Quick ToDo List:

 

  1. Search JetSki Registry
  2. Additional JetSki Register Features
    1. Add Photos
    2. Add Links
    3. Add Tags
    4. View / Edit / Delete Your Jetskis
  3. Expanding the JetSki Application Abilities
    1. Current Location for GPS Map of Skis?
    2. Previous Owners Chronology?
    3. Report a Stolen Ski?
    4. Status:  running, not running, parts ski, destroyed ?