TytoAlba's avatar

Embedding app within a client website

Not sure this is the right forum, but appreciate if there is anyone with experience who can offer advice or point me in sensible places to look for help.

I've built a simple Laravel (Laravel/Interia/Vue/PgSQL) analysis app that links together data sources and maps for several specific industries. It will be a paid subscription service for businesses.

I'm a relatively inexpeprienced developer, but got everything built in no small part because of my learning from Laracasts. However, I've no real experience about deployment.

The plan is for a standalone website, but I've got a client who is interested in embedding it in their own wordpress site. I'm finding lots of conflicting advice, from lots of random websearches from sources I know nothing about, so very confused about how it could be achieved. Suggestions include embedding as an iframe or setting up as a plugin but not sure if that applies to a entire site to be served out or I need to change to how the app works. Sure there are others options too. Can anyone suggest any sensible ways to achieve this, or point me in the right direction about how to find out.

Initially, there would be no data shared between the two sites, it would just show my site through theirs and allow users to interact with the maps/toggle data sources etc.

Longer term, I'm wondering if its possible to for them (or other clients) to include their own datasets throughy some local api feed, without me having to worry about storing/controlling condidential info - it would all be handled on their end with me providing the functionality to glue it together with other data and interpret but not save anything outside their domain. Its likely that this use case would be as an internal tool for staff rather than for them to share e.g. Add in their own customer data to view alongside other data. Any advice appreciated, especially when linked to initial query, if it there is a sensible way to approach for early deployment with room for future enhancement if and when the app develops.

0 likes
2 replies
LaryAI's avatar
Level 58

To embed your Laravel app within a client's WordPress site, you have a few options:

  1. Embedding as an iframe: You can embed your Laravel app within the client's WordPress site using an iframe. This allows you to display your app within a specific section of their website. To do this, you can create a new page template in WordPress and add an iframe tag with the URL of your Laravel app. Here's an example:
<iframe src="https://your-laravel-app-url.com" width="100%" height="600"></iframe>
  1. Setting up as a plugin: Another option is to convert your Laravel app into a WordPress plugin. This would require rewriting your app to work within the WordPress ecosystem. You can create custom post types, taxonomies, and templates to integrate your app seamlessly into the client's WordPress site. This approach provides more flexibility and control over the integration but requires more development effort.

  2. Headless CMS approach: Instead of embedding your Laravel app directly within the WordPress site, you can build your app as a headless CMS. This means separating the frontend (Vue.js) from the backend (Laravel) and using APIs to communicate between them. You can then integrate the frontend into the WordPress site using WordPress REST API or GraphQL. This approach allows for more flexibility and scalability in the long term.

Regarding the future enhancement of allowing clients to include their own datasets, you can create an API endpoint in your Laravel app that allows clients to send their data securely. You can authenticate the requests and handle the data on their end without storing or controlling confidential information. This way, clients can include their own datasets without compromising security.

Remember to consider security measures when integrating your app into the client's website, such as implementing authentication and authorization mechanisms to ensure only authorized users can access the embedded app.

I hope this helps! Let me know if you have any further questions.

sahil1711's avatar

Damn, i was now working on something very similar @tytoalba . Wonder whether you able to solve this ? I am creating an iframe which could be embedded in notion.

Please or to participate in this conversation.