coupon-booked

A neat way to send gifts to your loved ones.

Stars
0

Instead of a teddy bear or a gift card, my girlfriend wanted an unconventional gift a few Christmases ago. She wanted me to put my programming skills to use and create something for her. After making her an app, it was suggested that I expand the idea to make it accessible to others. Hence, Coupon Booked.

Setup (web)

Obviously, the first step is to upload the files to a directory on your website. First, you should probably replace the .png files with an applicable image. An important thing to note is that apple-touch-icon does not support transparency, so you must use an image without any or use an online converter to make your image conform to Apple's standards.

You need to install the Nexmo PHP library via Composer for text notification support. I didn't have access to Composer on my web hosting, so I followed this guide here to manually add the library to my server.

Setup (app)

First step is to install the required libraries by running npm install from inside the /app directory.

To build the app for Android, run the following from the app folder:

npm run build

Information

I use an SQL server to store nearly all my data for the site at this time. Auth0 and OneSignal store their parts of the data, but everything I generate in JSON is stringified and stored in neatly organized tables for easy access from PHP. The tables are able to be viewed manually through phpMyAdmin, which is occasionally necessary for debugging.

The SQL server is two hours behind my timezone, putting it in Pacific Daylight Time. I'm using GoDaddy because it's easily configurable for a beginner, but it's rather expensive, so I'm considering switching to another platform. I just need to find something that has a small learning curve and is easily scalable, rather than paying a lot up front with room to grow.

The app is reduced to approximately 10mb once deployed to Android, thanks to most of the Node modules only being required for the build process.

The Android folder contains icons a res folder that has to be manually deposited into platforms/android/app/src to replace the default icons to display my logo as the notification icon for OneSignal. This folder needs to be updated and the new content dragged into the folder if the logo changes. The images were generated by placing the icon.png from the main app folder into Android Asset Studio, as the directions on the OneSignal icon page recommended.

Ideas/TODOs

  • Add instructions for a local server for non-live testing
    • I started this project before I learned the right way to develop bigger applications,
      so there have been a lot of bad practices in the process. So far I can only test my changes
      in production because of the project's design, and it is about time I go back and renovate.
  • Switch over to entirely text-based notifications
  • From createShareCode.php: Create a 'clone' feature to send the same book
    to multiple people.
  • From createShareCode.php: must have requried ID (sender/receiver) to manipulate book?
    Except for my master ID; how to protect? Env file?
  • From sentBooks.js plusButton:
    • Reset scrollbar to the top of the page to prevent the weird bugs
  • From sentBooks.js showCouponEditPage:
    • Reset scrollbar to the top of the page to prevent the weird bugs
  • From sentBooks.js createSentCouponElements:
    • Implement way to rearrange organization of coupons; also change
      display options like default, alphabetical, count remaining, etc.
    • Should changing display preference permenantly update the order?
    • Option to hide coupons with 0 count; display 3 to a row
  • From sentBooks.js imageUploadListeners:
    • Fix cropper destroying quality on large images
    • Can try this
      or this
    • Add our images to Dropbox or something to display
  • From sentBooks.js addListeners:
    • Come up with a better function name
  • From sentBooks.js displaySentBook:
    • Can have miniPreview bold display with image and title and everything, then as you scroll
      down it collapses to a fixed nav with image on left and title right and on click
      it scrolls back up to the big info.
  • From sentBooks.js deleteBook:
    • Ensure display is refreshed once deletion is completed
  • From sentBooks.js createBook:
    • Option to update sender name before sharing; allows
      for another level of personalization with nicknames.
  • From sentBooks.js updateBook:
    • Think of a good way to resolve bugs for users; some log data saved?
    • IDEA: Have a 'report bug' thing somewhere that includes logs in report; send it where?
      • Theoretically could be one SQL table for bug logs and one for security violations
    • IDEA: Something in error messages about 'sorry for the inconvenience'?
      • Would make them awfully long but seems like a professional thing to do.
  • From sentBooks.js bookFormIsValid:
    • For the desc.length case
    • Give an indication of characters used out of total allowed, like a textArea. Switch?
  • From shareCode.php: Switch to having icons in different folders for different OS
  • From App.js: see if I can get rid of all the unused page parameters
  • From App.js: remove all calls and depencies to/on darkModeSupport
  • From App.js routes:
    • Add route to URL or something so browser back button naviation works
    • Try something like this
  • From App.js /create:
    • When back button is clicked after editing retrieved template,
      still make sure they want to discard changes
    • Either add a similar variable to /dashboard or implement some kind of
      caching mechanism so users don't have to wait every time for the
      templates to be retrieved
  • From sentBook.php:
    • Try to speed up the menu animation, and probably replace the hamburger
      icon with ellipses or something.
    • Cycle through an array of coupon names for examples; appropriate to template?
      • Could be paired arrays to have description matched with name, or objects & pull fields
  • From helperFunctions.js reorganizeBooks:
    • Actually implement this feature and get it working