Skip to content

Structure Folder

M ABD AZIZ ALFIAN edited this page Oct 24, 2018 · 6 revisions

About Structure Folder System

Folder system is inside src folder

  • src/
    • api/
      • htaccess
      • index.php (Call the app)
    • app/
      • app.php (Setup app before running)
      • dependencies.php (Registering the dependencies)
      • index.php (Default forbidden page)
      • middleware.php (middleware as variable on the fly)
    • classes/
      • middleware/
        • ApiKey.php (For handling authentication api key)
        • index.php (Default forbidden page)
        • ValidateParam.php (For handling validation in body form request)
        • ValidateParamJSON.php (For handling validation in JSON request)
        • ValidateParamURL.php (For handling validation in query parameter url)
      • Auth.php (For handling authentication)
      • BaseConverter.php (For encryption)
      • Cors.php (For accessing web resources)
      • CustomHandlers.php (For handle message)
      • index.php (Default forbidden page)
      • JSON.php (For handle JSON in better way)
      • LazyPDO.php (For create database connection)
      • Logs.php (For handle Log Server)
      • Mailer.php (For sending mail)
      • Pagination.php (For pagination json response)
      • ParallelRequest.php (For send request in parallel/non blocking)
      • SimpleCache.php (For handle cache server side)
      • UniversalCache.php (For handle cache with json format key-value only)
      • Upload.php (For user upload and management file)
      • User.php (For user management)
      • Validation.php (For validation)
    • logs/
      • app.log (Log data will stored in here)
      • index.php (Default forbidden page)
    • modules
      • backup/ (Default module backup for database)
      • flexibleconfig/ (Default module flexibleconfig for extend the app config)
      • packager/ (Default module packager for app management)
      • pages/ (Default module package for pages management)
      • index.php (Default forbidden page)
    • routers/
      • index.php (Default forbidden page)
      • index.router.php
      • logs.router.php
      • mail.router.php
      • maintenance.router.php
      • test.router.php (For tester only)
      • user.router.php

api/

Here is the place to run your application as public place

app/

Here is the place for reslim framework.
Connection database and other dependencies are here.

classes/

reSlim core classes are here.

classes/middleware

reSlim middleware classes are here.

logs/

Default log will be place in here.
You can add your custom log in your any container or router.

modules/{your-module}

You have to create new folder for each different app or module project.

How to create new reSlim modules?
You can learn from documentation here >> Tutorial Create Module.
Or learn directly from this very simple project on Github.com.

routers/

All the files with the routes. Each file contents the routes of an specific functionality.
It is very important that the names of the files inside this folder follow this pattern: name.router.php