# Set Up Codebase

Please see the following Ansible playbooks:

1 - dovoticaansibleplaybooks/applications/www.dovotica.com/production.yml
2 - dovoticaansibleplaybooks/applications/app.dovotica.com/production.yml
3 - dovoticaansibleplaybooks/applications/api.dovotica.com/production.yml

Please, follow the order as per above list for the correct deployment of the codebase because playbooks 2 and 3 do not deploy codebases but virtualhosts, SSL certs, etc.

## Architecture

This app is built on top of the Laravel Framework, configured as Team Version of the Laravel Jetstream package. The UX is powered by Laravel Livewire.

This app is devided up into three systems or "Portals" also known as "Environments":

- Guest Portal, sitting on the www. subdomain. This is the marketing SEO/SEM optimized "frontend".
- Auth Portal, sitting on the app. subdomain. Only registered users can access, but registration is open to the world.
- API, por programmatic use of resources and tools. Registered users can get an API key in order to make REST requests.

In order to do something of value for the users, abstracting out the Laravel's MVC and Team features, each portal system is organized using the following artifact types:

- The Mainframe
- ACL Policies
- Navigation
- Modules
- Themes
- Panels

### The Mainframe

The Mainframe concept consists of an object that "knows" where each extension such as artifacts (Modules, embedded integrations, etc., similar to "Components" in Joomla!) and fixtures (Panels, navigation menues, etc. similar to "Modules" in Joomla!) sit at, and the interplay among them. 

This is accomplished by coupling together (via a mainframes table ID) the Environment with the Extension that does something of value for the user. 

The scope of actions available for the user is set on the Mainframe object's ACL column.

Once the User starts up the app's workflow by requesting any given route, the routing system leverages the Controller method in order to string up together the response:

- A Navigation Link needs to pull the Mainframe object in order to know which Module is passed down to Laravel's view. This object is normally instantiated on the Controller's method that is listening to the route requested by the user.
- A Module uses the Mainframe Object to know what data is going to be manipulated.
- Panels use the Mainframe Object to know what data is going to be displayed.

### ACL Access Control Lists

### Guest Portal

TODO

### Auth Portal

TODO

### API

TODO
