Codebase structure

Within your GitHub customer repository, you'll find the below codebase structure:

  • <customer> folder
  • <customer>_<project> folder(s)
  • paas folder
  • files needed for your project

Let's go through what you'll find in each:
<customer> folder
This is a dedicated directory for all your projects. If you want to share code between your projects (see the sharing code article for more information), you can add it here.

<customer>_<project> folder(s)
This directory is for a project. If your customer ID is demo and you have a project called swiss, this directory would be called demo_swiss. All your project code (unless you're sharing code between multiple projects) should reside in this directory.

Within this folder, you'll find the following directories (some of them are optional):

+ bin/        # Executable scripts shipped with the project
+ config/         # Application configuration
+ src/            # Source files
    + php/          # Custom PHP code
    + js/           # Custom JavaScript code
        + tastic/       # This is where you put source code of your Frontastic components
     + scss         # Put your SCSS here
+ test/           # Test files
     + php          # PHP tests, execute with `ant test` in Frontastic sandbox
     + js             # JavaScript tests, execute with `ant test` in Frontastic sandbox
     + ...
+ public/         # Public web folder, maybe containing generated assets
+ templates/  # HTML template files, usually exactly 1
+ build.xml   # Build file for local and continuous integration
+ environment    # Global configuration (configuration, ...)
+ environment.local    # Local configuration overwrites (generated by Ansible)

These directories contain your own code. There are small exceptions of files which are generated by Frontastic (clearly mentioned at the top of the file) and some configuration files (for example, package.json and yarn.lock) which require special handling. But besides these, you're basically free to do whatever you want in these directories.

Each of the mentioned directories contains the same source code directory structure under src/. In your project directories, you can place your source code files there and they'll be picked up by the system:

  • src/js/ contains all JavaScript code
  • src/scss/ holds the SCSS code
  • src/layout/ contain static assets that are required by SCSS or JS
  • src/php/ is the home to all PHP files

paas folder
This is where our platform code lives. It's for your personal reference and to give you an insight into updates we're performing in this code. Feel free to browse these directories and get inspiration, but don't change any code here.