Question

We are building a intranet web application in PHP with CakePHP. However we have barely experience with CakePHP Our Intranet will have two user portals.

  1. Employee portal
  2. Client portal

Both portals will use the same data but have their own user interface. Employees can see other data than clients and vice versa.

We want to build a central core for both portals. For example, a single authentication system, a contact form, a notification functionality, same footer information, etc. We want to use this central core as much as possible so we don't have to rewrite code.

Layered App

We use Git to manage our code. We want to make a branch for both portals and one for the shared core.

We hope you can give us some advise about how setting this up with CakePHP.

  • Is building multiple app's a good idea?
  • Or should we just run CakePHP and our core on two web servers? (one for each portal)
  • Or should we use plug-ins for the core functionalities?
  • Or should we use single controllers with multiple views (one for employee and one for client?)
  • Or something totally different?

Thanks for any advice

Was it helpful?

Solution

Eventually, you'll start noticing similarities between the 2 portals, and the code-base. If they are sharing same data, why don't you have a single code-base and have permissions around what users can see based on roles? We had to do this recently when we merged 3 pages into 1. 1 page was for admin, and the other 2 was for other roles. Then users started requesting features on page 2 that page 1 already has etc etc. it became a mess and we decided to consolidate these pages into 1, and have permissions around what each users can see based on their roles. Also read more about helpers as it will come handy, so you dont make your view bloated.

OTHER TIPS

In my experience a portal is typically a very thin layer on top of some CRUD framework. I think the opportunity for code sharing between these two applications is very limited. You can share the authorization and authentication .. and that's about it and I don't know if sharing this part is a good idea (probably not).

If most of your code goes into building the HTML views you'll likely end up with two completely separate views for employee and client.

As Ayo mentioned... the permissions alone will separate the two user groups and you can take advantage of CakePHP's layout or the themes feature to give a totally two different look for each user group.

You may also want to take a look at CakePHP plugins feature. It allows you to easily add new functionalists to an existing app, without messing with the existing code base.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top