A neat way to send gifts to your loved ones.
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.
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.
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
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.
createShareCode.php
: Create a 'clone' feature to send the same bookcreateShareCode.php
: must have requried ID (sender/receiver) to manipulate book?sentBooks.js
plusButton:
sentBooks.js
showCouponEditPage:
sentBooks.js
createSentCouponElements:
sentBooks.js
imageUploadListeners:
sentBooks.js
addListeners:
sentBooks.js
displaySentBook:
sentBooks.js
deleteBook:
sentBooks.js
createBook:
sentBooks.js
updateBook:
sentBooks.js
bookFormIsValid:
shareCode.php
: Switch to having icons in different folders for different OSApp.js
: see if I can get rid of all the unused page parametersApp.js
: remove all calls and depencies to/on darkModeSupportApp.js
routes:
App.js
/create:
sentBook.php
:
helperFunctions.js
reorganizeBooks: