Skip to content
thommann edited this page Feb 22, 2023 · 14 revisions

PolygonSoftware Flox Wiki

This wiki serves as a baseline of information for developing projects with Flox.

In a first part, it outlines the basic principles and structures of Flox. In its second part, more development-specific information is given, and the code quality guidelines are established.

What is Flox?

Flox is a bootstrap repository intended to provide a solid baseline for starting new projects. It provides a full-stack, basic setup of all relevant services. It includes Terraform files for setting up the related AWS infrastructure, as well as a basic Backend, Frontend, Database, and preconfigured connections between them. Some basic examples for operations and components are included as well.

There are two workflows for Flox projects: the standard workflow, and the minimal workflow. You can find out more about these on their respective Wiki pages.

What is this Wiki for?

This Wiki mostly takes a developer's perspective into consideration. Thus, its primary goal is getting developers started working on new or existing Flox projects quickly. For new developers, it's recommended to read through the wiki in its entirety in order to know the basics about Flox. If you find any mistakes or outdated information, feel free to correct them! 🎉

How is Flox structured?

In terms of code, Flox follows a two-part approach:

  • Basics: fundamental things that will most likely be needed for all projects (e.g. Vue Router, PostgreSQL Database, etc.)
  • Flox Modules: Optional modules with self-contained functionality (e.g. file upload, role management, etc.) that can be dynamically enabled/disabled and configured.

Flox Modules

Enabling/Disabling modules

In flox.config.json, you can enable/disable modules. This has to be done on both backend and frontend! Some modules may only exist on either frontend or backend; you can see the list of available modules in the MODULES.ts file.

// Flox modules to enable
"modules": {
 "auth": true,   // enabled module
 "roles": false,  // disabled module
}

Configuring Flox modules

In flox.config.json, you can configure modules. Note that options will only apply to modules that are enabled. Within moduleOptions, you can then set the module's options according to the defaults described in its config.ts file. You may also omit certain options, which will make them use their default values found in the module's config.ts.

"moduleOptions": {
  "auth": {
    "emailAsUsername": true, // this overwrites the 'false' default value
    // other options will use their default values
  },
  "roles": { 
    "roles": ["ADMIN", "SUPERUSER", "USER"],
  },
},