Genesis is a CLI tool built by Calima for their own workflow. It's a CLI tool that provides an elegant and automated starting point for your project, as well as providing different modules that can be installed in your application to make development easier and faster.
- PHP8.1+ is required
Genesis can be installed with Composer by running the following command:
composer global require calima-solutions/calima-genesis
If you get an error, try running
composer global update
and then try to install again.
To update the CLI tool, just run genesis self-update
and it will download a newer version if your local copy is not updated.
Once Genesis is installed, you can log in with the credentials provided by Calima using the following command:
genesis authenticate
You will be prompted for your email and password, and a token will be stored in your computer for faster access.
Genesis provides a quick starting point for both back-end and front-end projects right from the CLI. Just run genesis start <project>
and follow the wizard to create the project with Calima standards.
Run genesis start laravel
and Genesis will guide you through the process. The following elements are optional and you will be prompted during the installation:
- Filament: An admin panel based on the TALL Stack
- Breeze: Provides authentication and installs TailwindCSS
- Actions: A package that uses a new way of organising the logic of your Laravel applications by focusing on the actions your application provide
Apart from this, this command will install the following elements:
- Pint: Code formatter following Laravel standards
- Laravel Log Viewer: A beautiful log viewer, already protected so it can only be seen by Calima employees
- Larastan: Static code analysis for Laravel
- Pull Request template: a PR template following the standard in Calima
Run genesis start ionic
and Genesis will guide you through the process. The following elements are optional and you will be prompted during the installation:
- Tailwind: CSS Framework for fast prototyping
- API Service: Provides a starting point for using an API in your app
Genesis is not only a great tool for starting a project, but also to use it when a project is already running. Custom commands automate some actions that are common during our daily work:
- Installation of useful packages
- Execution of tests
- Linting the code
- And many more things coming
To list the available commands, execute the following line on the CLI:
genesis commands
Once you find the command you were looking for, you can execute it like this:
genesis run <signature>
For example, if I wanted to run install:tailwind-angular
on my Ionic app, I would run:
genesis run install:tailwind-angular
This command would install TailwindCSS with the Typography and Forms packages, create the tailwind.config.js
file with a primary and secondary colors and add the @tailwind
calls on the CSS file.
Modules are Genesis' way of sharing code between projects. When we create an integration or a tool, we can convert it to a module and it can be used by all our Calima colleagues in their projects.
Each module can have different flavors for each technology or integration type. For example, if we were building a module for a blogging system it could have the following flavors:
- Blade
- Inertia Vue
- Inertia React
- Livewire
- Filament panel
- API
Although it would be ideal, not every module will have all the flavors available. Genesis provides a quick access to all the modules and their flavors.
Run genesis modules
to print a list of the available modules on the console. The columns Module ID and Versions are specially important, as they are the ones used to install a module afterwards.
To install a module, you can execute the following command:
genesis module {identifier?} {flavor?}
If you already know the identifier and flavor you want to install, you can directly add it to the command. If you don't know either, you can just run genesis module
and the CLI will help you with some autocompletion.
The process of creating modules is still pending to be documented, although the requirements for a module to be accepted are defined in the following lines.
- Flavors should be as small as possible (ej. one module for the migrations and models, another one for the admin panel, another one for Blade views, another one for API...) so they can be stacked
- The module code should be transferred to
calima-solutions
GitHub account so that Genesis has access - The module should be placed inside a brand-new project so we're sure it can run isolated
- Back-end code must be tested with Unit / Feature tests where possible, and tests must be passing. If tests cannot be provided, the README should provide information on how to test it
- It should have a README.md file explaining how enough documentation on how it can be used