Projects A donation app built and shipped on a startup budget

A donation app built and shipped on a startup budget

A single-page donation app with a live payment gateway, built to work now on a limited budget, not to be a perfect first version.

A donation app built and shipped on a startup budget, screenshot
The gallery shows the two-screen flow: selecting a cause, then personalising and previewing the email before donating.
How long
2018
My role
Software architechtureDevelopment, Testing, Support
Kind of project
New systemMedium project

What the business needed.

The client wanted a simple app where people could choose a cause to support, personalise a message, and complete a donation with a real payment gateway, styled as plainly and simply as possible. The budget was limited, and it needed to actually work and start generating revenue, not just look good.

What I did.

I built a single-page JavaScript app with its own self-contained state, so it tracks login sessions and screen-to-screen data without depending on a particular back end. The app has two screens: selecting a cause and logging in, then composing and previewing a personalised email with the selected causes before donating. Behind it, I built a lightweight WordPress-based back end to manage causes, orders, transactions and users, and to send the personalised emails, connected to the SnapScan payment API to generate QR codes and process transactions. I set up the hosting, SSL and domain myself. The trickiest part was making a JavaScript, browser-based app log in securely against a server-rendered WordPress back end, which I solved with a custom cookie-based authentication flow over an encrypted connection.

What they got.

A working, stable donation app that the client used to start generating revenue for their new venture, on the budget available.

For your technical person

Stack. Vanilla JavaScript (ES5/ES6) single-page app, compiled with WebPack and Babel to keep it small and working in most browsers, styled with Bootstrap and kept wireframe-plain, as the client asked. Headless WordPress CMS back end with a custom plugin in PHP and MySQL. SnapScan payment API, and ZURB Foundation for Emails for the email templates.

Decoupled by design. The app kept its own self-contained state for login sessions and the data passed between screens, so it never depended on the back end. The back end could later be swapped out without rebuilding the app, and the app could be dropped onto another website and still use the same back end.

Logging in from the browser. WordPress expects logins to happen server-side, through its own login pages and a page reload, and I was told a JavaScript app in the browser couldn't log in to it. The way through was WordPress's cookies: it needs one session cookie for the front end and a second one for the back end, each holding the user name, a secret key hash and a timestamp. I built a private login endpoint, locked down with CORS, on a server behind SSL and a firewall I set up. The browser sent the username and password over the encrypted connection; the server checked them; on success it issued both cookies, tied to the username and a session timestamp; and the browser stored them and was logged in to WordPress. Further security steps are left out here on purpose.

Orders and payments. The back end called SnapScan to generate the payment QR codes. When SnapScan reported a payment as successful or failed, the whole order was saved as a WordPress custom post with every transaction detail, a reference code, who placed it and which causes they picked. Keeping the full order meant emails that got stuck or failed could be reissued later, with a bit of extra functionality added. A copy of each transaction, its email content and its selected causes was stored as well.

Emails that fit the choice. The app sent the message and chosen causes to the back end as JSON, and the plugin built the email from a responsive template every time. People picked different numbers of causes, two, three or six, so the template adjusted its layout to whatever it received.

Hosting. A VPS for both the app and the CMS, with SSL, domain and firewall set up, plus a small showcase website for the app. Delivered 2018 as an MVP, on the client's budget.

Running into the same problem? Tell me about yours.

+27 87 150 9305

Monday to Friday, 09:00 to 20:00 SAST. Or email info@antondevilliers.com.

Tell me the problem

Step 1 of 3. Pick what’s closest. You can explain in your own words next.

I reply myself, usually the same working day. The first conversation is free, and you’ll know the price of every piece before it starts. How a project works · Privacy

WhatsApp