A "virtual assistant" providing services like a private driver, personal shopping and exclusive deals. For this iOS app I built the back end, JSON API and all integrations with external parties.
The JSON API
To connect the iOS app and back end with each other, I designed a JSON API. It is important to think this through very well, you really do not want to have to implement "breaking changes" afterwards, even if you're using a versioned API.
I started with the specification, using the OpenAPI specification, also known as "Swagger". A lot of tools are available to easily generate documentation or testing tools based on your swagger file. On top of that, the swagger format is based on a JSON scheme, so if you're using an IDE with Language Server capabilities, you have intelligent context aware linting and autosuggest at your disposal.
Authentication and authorisation
The API needed to be entirely stateless, including the authentication. For this I used Laravel Sanctum, which made life a bit easier. It offers functionality to generate API tokens, optionally with custom scopes or permissions, and it includes middleware to validate requests, in this case using a Bearer Authorization header.
Subscriptions: Stripe and Apple Subscriptions
We wanted to use Stripe for Payments for subscriptions and other products/services. I have had very good experiences implementing this payment provider before. However, Apple requires that app based subscriptions must use the Apple Subscription service. Mainly because they can skim 30 percent of the revenue. We managed to circumvent this partly by doing subscription payments using a website.
That meant of course we had to implement two distinct payment flows, for the same subscriptions. That made it more complicated to use something like Laravel Cashier. In the end I decided to implement it myself, providing us with more flexibility, that did not take too much time, and it turned out to be educating and fun.
Chats with Slack integration
The core of the app consists of a chat interface, where subscribers can chat with different "virtual assistants" to arrange things like travel bookings or transport. These chats start with an automated chat bot asking a set of starter questions. When all answers have been validated, real people enter the chat, using a newly generated Slack channel. Using the Slack API and event webhooks I built a transparent bridge between the iOS app and Slack, to move all messages, emoji and uploaded files back and forth.
Content Management: Laravel Nova
Every web developer has gone through the "initation rite" to build their own content management systems, including me. I did not want to repeat this, as there are many excellent out of the box available, like Laravel Nova. With this you can create a very usable CMS in no time. Nova certainly has certain limitations, but with some creative thinking it's almost always possible to build something that does the job.
Do you have a project or job where you could use my help?
Contact me, and we can discuss your requirements and wishes!