Welcome Guest, Not a member yet? Register   Sign In
Best Approche to Web Application
#1

I am trying to build an application with back-end (master admin, admin, members), and front end. whats the best way to make the file structure for this application.
Reply
#2

(This post was last modified: 11-27-2016, 10:30 AM by PaulD.)

I am not saying it is the best way, but I would do this: I would have the public site and members functionality (members admin) on the main install of CI. I would put the master admin parts in a separate install but connected to the same database, in a sub folder called 'admin' or 'manager' or similar. Then all user functionality is contained in one install, but administration activities are coded in another install.

I know a lot of people will say that this can easily be achieved in a single install, and I agree that it can. But I like the separation.

This also means the members functionality can be easily and tightly integrated with the site, so say a member is logged in, the header on the homepage can change etc. It also means you can completely close off site admin parts without affecting the usage of the actual site, or switch off user access but leave the main admin parts functioning.

Finally, it also means I can re-use the admin sections easily between projects, without any affect on the main sites at all.

However, in general, the best solution for you will be heavily dependent on the type of site and the types of admin functions and the project goals as a whole. I doubt there is just one correct or best answer in any situation.
Reply
#3

Hi Paul, thanks for your comment as I'm about to ask this question.


For example:
guest-view
-----------
public index

logged-in
---------
User front end (list own entries with edit button)
User backend (edit form)
System front end (list all entries with edit button)
System backend (edit form)

should i combine both user-admin and system-admin or separate them?
Reply
#4

(11-27-2016, 10:28 AM)PaulD Wrote: I am not saying it is the best way, but I would do this: I would have the public site and members functionality (members admin) on the main install of CI. I would put the master admin parts in a separate install but connected to the same database, in a sub folder called 'admin' or 'manager' or similar. Then all user functionality is contained in one install, but administration activities are coded in another install.

I know a lot of people will say that this can easily be achieved in a single install, and I agree that it can. But I like the separation.

This also means the members functionality can be easily and tightly integrated with the site, so say a member is logged in, the header on the homepage can change etc. It also means you can completely close off site admin parts without affecting the usage of the actual site, or switch off user access but leave the main admin parts functioning.

Finally, it also means I can re-use the admin sections easily between projects, without any affect on the main sites at all.

However, in general, the best solution for you will be heavily dependent on the type of site and the types of admin functions and the project goals as a whole. I doubt there is just one correct or best answer in any situation.

Can you graphically demonstrate? I am quite interested in what you are talking about
Reply
#5

(02-06-2017, 01:27 AM)alenn Wrote: Hi Paul, thanks for your comment as I'm about to ask this question.


For example:
guest-view
-----------
public index

logged-in
---------
User front end (list own entries with edit button)
User backend (edit form)
System front end (list all entries with edit button)
System backend (edit form)

should i combine both user-admin and system-admin or separate them?

Well, again, it really is up to you.

I was saying that I put the system-admin in a separate folder, with a separate CI install. That way it is completely separated from the main site, and I can move it from site to site and re-use it. I can have it's style and design and layout css and html completely unique and different than the main site, and do all the normal database clean ups and checks that I want, and use them again and again.

However, user-admin should be part of the main site. So whatever session flag you have for logged in, can trigger a different menu bar, or a different sub menu, or even just change the 'create account : login' to 'my account: logout' options.

But, the site I have just built I put the system-admin as part of the main site, so the system admin had front end editing on live pages available. There is no "best way". Just whatever is right for your particular circumstance.

In fact, this high level structural design can be the most fun part of a site build. It is at this point you can do anything, and the only constraint is the actual site, who it is for, what it is going to do, and what functions it will perform. The more you can nail that down from the start, the better your structural design and overall approach will be.

However, even if you choose the wrong approach, it is just a bit of a re-hash and additional coding and it can be easily enough corrected. Database mistakes in planning can be much harder to correct.

Best wishes,

Paul.
Reply
#6

@mubahmohamed

By default CodeIgniter supports a single-application skeleton. It provides two possible choices:

- two complete separate sites for the front-end and the administration panel. I don't prefer such a way, because it leads to code duplication and maintenance issues as a result.
- one application that could use a separate directory for the administration part. If you use HMVC, every module could have an administration-specific controller-class and its corresponding views to be placed within admin/ subdirectories - like the old PyroCMC did. Some hacks are needed, for example how separate error404 pages to be shown for the front-end and for the administration to be shown. I used this way in the past, but I abandoned it because of two reasons: the designer has difficulties on orientation within the file structure; not convenient for multi-language sites (a long explanation).

Years ago I saw a multi-site skeleton for CodeIgniter which I liked: Codeigniter Cross Modular Extensions - XHMVC, https://bitbucket.org/xperez/codeigniter...ions-xhmvc, http://www.4amics.com/x.perez/2013/06/xh...xtensions/ The idea is to have a way two sites to share partially common code. For example, most of the models, libraries, helpers, could be accessible in the front-end and administration panel without duplication.

The mentioned solution is old, but I grabbed the idea and implemented it within my starter application https://github.com/ivantcholakov/starter...-edition-4
It has "front" and "admin" applications, under the directory platform/common you will find everything that is shared between the applications - configuration and code. The directory vendor/ (created by Composer) is used by both of the applications too.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB