edit

Skytells Framework Architecture

Lets learn Skytells Framework's Architecture step by step.


At a Glance

Understanding Skytells Framework's Architecture is too easy.
When you download a 3.x release, the architecture will look like this.

Now lets take a look of the Framework's Architecture at a glance.

1
2
3
4
5
[+] Application
[+] Core
 -  skytells
 -  index.php
 -  .htaccess

Now you've (2) directories and (3) main files.

Name TYPE PURPOSE
Application DIR The Application dir is the main directory which contains everything used on your web application.
Core DIR The Core dir is the main system dir, which powers the framework functionality.
skytells CLI The skytells is an extentionless php file responsible for performing CLI commands.
index.php FILE The index.php file is responsible for booting the framework's functionality.
.htaccess FILE This file responsible for powering the framework with Mode_Rewrite apache module

Important Notice

Please do not rename the mentioned directories, this may effect the framework to stop performing its functionality.

Now, We've understood the main directories for the framework,
Lets move on to learn more about how Skytells Works..

Application Flow Chart

The following graphic illustrates how data flows throughout the system:

alt tag

Skytells FW Application flow

  1. The index.php serves as the front controller, initializing the base resources needed to run Skytells.
  2. The Router examines the HTTP request to determine what should be done with it.
  3. If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
  4. Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security.
  5. The Controller loads the model, core libraries, helpers, and any other resources needed to process the specific request.
  6. The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so that on subsequent requests it can be served.

Application Structure

As the name indicates the Application folder contains all the code of your application that you are building; This is the folder where you will develop your project.
The Application folder contains several other folders, which are explained below :

1
2
3
4
5
[-] Application
    [+] Misc
    [+] Public
    [+] Resources
    [+] Storage

Now you've (3) directories are stored inside Application directory.

Name TYPE PURPOSE
Misc DIR This directory contains settings, hooks, libraries, helpers, handlers..etc
Public DIR The public directory contains all your public files, its also houses your assets such as images, JavaScript, and CSS.
Resources DIR Contains the Controllers, Models & ORMs, Views.
Storage DIR Contains Caches, Logs, Uploads ..etc

Lets move on and take a look what's inside Misc directory.

Misc Structure

The Application/Misc folder contains several other folders, which are explained below :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
[-] Application
    [-] Misc
        [+] Config
        [+] Helpers
        [+] Handlers
        [+] Hooks
        [+] Libraries
        [+] Packages
        [+] Providers
        [+] Phrases
         - Settings.php
    [+] Public     
    [+] Resources
    [+] Storage

Lets understand Misc dir step by step.

Name TYPE PURPOSE
Config DIR This folder contains various files to configure the application. With the help of Misc/Settings.php file, user can configure the application. Using database.php file, user can configure the database of the application.
Helpers DIR In this folder, you can put helpers & functions of your application.
Handlers DIR In this folder, you can put Handlers classes of your application.
Hooks DIR The files in this folder provide a means to tap into and modify the inner workings of the framework without hacking the core files.
Libraries DIR This folder contains files of the libraries developed for your application.
Packages DIR In this folder, Skytells using it to put its packages using CLI.
Providers DIR This folder contains two sub dirs, which contains all your Providers, Contracts and Services
Phrases DIR In this folder, You can add phrases to the built-in language engine.
Settings.php FILE The main php configuration file of the framework's core and features.

How easy is that?

Now you've understood the Structure of Misc dir!

Now lets move on to learn more about Application/Resources folder


Resources Structure

The Application/Resources folder contains several other folders, which are explained below :

1
2
3
4
5
6
7
8
9
[-] Application
    [+] Misc
    [+] Public
    [-] Resources
        [+] Controllers
        [+] Languages
        [+] Models
        [+] Views
    [+] Storage

Lets understand Resources dir step by step.

Name TYPE PURPOSE
Controllers DIR Well, This is the location where all of your controllers must be stored on, Including the child controllers, note that this dir contains sub-dir Aliases used for storing the controller aliases.
Languages DIR This dir used for storing languages data used by Skytells Translator engine.
Models DIR Well, of course all database belonging are stored here, including models, ORMs
Views DIR This dir used for storing your UI/Views files & templates.

Now lets move on to learn more about Application/Resources/Controllers folder

Controllers Aliases

Well, Skytells Framework supports HMVC system, So you may use a child-controllers or Aliases to be accessed via the parent controller.

Did you know

That Skytells Framework supports HMVC System which allows you to build a dynamic web application with less usage of resources ?

The Application/Resources/Controllers/ folder contains several other folders, which are explained below :

1
2
3
4
5
6
7
8
[-] Application
    [+] Misc
    [+] Public
    [-] Resources
        [-] Controllers
            [-] Aliases
                - Home.php <---- Controller (B) Extended from Controller (A)
             - Home.php    <---- Controller (A) - This is the main controller  
Name TYPE PURPOSE
Aliases DIR This Sub-dir Aliases used for storing the controller aliases, for example you have controller (A) and you want to extend (B) from (A), So the controller (B) will be defined as the child controller and stored here.

Models Eloquents

The Application/Resources/Models/ folder contains several other folders, which are explained below :

1
2
3
4
5
6
7
8
[-] Application
    [+] Misc
    [+] Public
    [-] Resources
        [-] Models
            [-] Eloquents
                - Users.php <---- ORM Class
             - HomeModel.php    <---- Model
Name TYPE PURPOSE
Eloquents DIR This Sub-dir Eloquents used for storing ORM files assigned with an database so the system will seed the classes across the model system.

Storage Structure

The Application/Storage folder contains several other folders, which are explained below :

1
2
3
4
5
6
7
[-] Application
    [+] Misc
    [+] Public
    [+] Resources
    [+] Storage
        [+] Cache
        [+] Logs
Name TYPE PURPOSE
Cache DIR This dir including its sub dirs are used to store the system & app cache, which works on FileCache driver and Oxygen Template Engine.
Logs DIR If Skytells is set to development mode, the logs will be stored here.

Now, You're fully understood the Application Structure!