You can find Starter application in the Brixy/Examples folder. This is MVC application skeleton prepared for quick start of your new project.
- Copy the Brixy/Examples/Starter folder to your script folder.
- Rename your new Starter folder to the MyApp.
- Rename the MyApp/Starter.jsx file to the MyApp/MyApp.jsx.This is the main script file of the application.
- Open the MyApp/MyApp.jsx file. Correct the path for including the application launcher Brixy/includes/app-launcher.jsxinc.
- Open the MyApp/tests/Tester.jsx file. Correct the path for including the tester launcher Brixy/includes/tester-launcher.jsxinc.
Now run MyApp/MyApp.jsx.
Main script file: MyApp/MyApp.jsx
This script includes and runs the application launcher. Launcher takes care about loading core Brixy libraries and config file.
Config file: MyApp/config.jsxinc
Config loads your own application modules, defines the application itself and its basic units, e.g. services, routes, events, startup route.
Application modules: MyApp/app
This folder contains your own application modules.
This folder contains all model modules.
Controllers: MyApp/app/resultCtrl, MyApp/app/startupCtrl
Each of these folders contains a controller and its views. You will replace Startup controllers with your own.
Unit tests: MyApp/tests
This folder contains test launcher Tester.jsx and folder jobs with test job files.
In most cases you don't need modify the main script file MyApp/MyApp.jsx, except for the correction of the path to app-launcher.jsxinc file. For persistent applications you can insert Extend Script
#targetenginedirective at the beginning of the file.
Create application model classes and modules. Put them into MyApp/app/model folder. Model is the logic core of the application. It holds data, settings, algorithms and other logic parts of the application.
Create unit tests of the model classes. These are the first use cases. Place test jobs into MyApp/tests/jobs folder. MyApp/tests/Tester.jsx script is prepared to execute all test jobs.
Add new model modules as services to the MyApp/config.jsxinc file, so they can be used in the controllers.
Create controllers and its views. Controller communicates with the model and initializes views. Not every controller needs a view. Use dependency injection for passing model modules to the controller. Finally, as a result of its work, controller returns a new request route.
Modify MyApp/config.jsxinc file: add startup controller, add request routes if needed.
Brixy Mixer helps with creating of new source files of all types.
Debugging can be fun with Brixy debug modules: Dump, Call stack, Timer, Summary, System info, error reporting. See Brixy/Examples/Debug tools.
Use Brixy Linker tool to link all source files into one final independent script file.