I've been experimenting with the folder structure a bit and here's what I've come up with:
[attachment:55389b042bfae]
This would be flarum/flarum, the skeleton repo. It's not functional at the moment, just theoretical. I'll go through what I'm thinking folder-by-folder.
assets contains JavaScript + CSS files which have been compiled (by PHP) from the source files in system/js, system/less, and any files registered by extensions. It also contains avatars and other file uploads.
config.php contains the forum's configuration settings - the minimum amount needed to connect to the database. The rest of the config settings are stored in the database's config table.
extensions is where user-installed extensions go (each one in its own subfolder).
index.php is the main entry point. It simply includes system/bootstrap.php and runs the returned app.
system is where all the Flarum stuff lives. The idea is to completely separate it from the forum-instance-specific files to make manual upgrades painless. You'll simply be able to overwrite the system folder with a new version, run an upgrade script, and you'll be good to go.
bootstrap.php is a custom script which sets up the framework. I'm thinking we could convert Flarum into a Lumen application?
extensions is where default extensions go. By storing them in here, they will get upgraded alongside Flarum.
js contains the forum/admin JavaScript apps.
less contains the forum/admin app LESS files.
src contains the PHP code that sets up the forum/admin app routes/actions.
storage contains temporary framework stuff like caches, sessions, compiled views.
vagrant contains vagrant scripts.
During development, studio contains Flarum's core/API repo(s). Otherwise, they are in vendor along with all the other composer deps.
Very keen to hear some thoughts on this! A couple of areas for discussion:
Integration
Say I have a Laravel app set up for my website and I want to integrate Flarum. How do I do that? The simplest way would be to just drop this whole thing into a subfolder in Laravel's public directory.
I know that's not the kind of integration some people will be expecting (the "install a composer package" kind)... I'm not sure if it will matter though, as long as we provide an extension/APIs to integrate with an external database/authentication mechanism?
I guess the other option would be to separate the front-end into its own repo, and then the skeleton would pull in flarum/core and flarum/frontend or whatever, and then set up directory paths etc. That way an existing Laravel app could pull in those packages too and set up its own directory paths. Not sure if it's worth the extra complexity though.
Distribution/Installation
I'm thinking we will write a build script which clones the skeleton repo, pulls in default extensions, does a composer install, and gets rid of unnecessary source files (uncompiled JS files in system/js, vagrant stuff, studio, etc.) The resulting package is what will be downloaded by the install script.