Quick Start
This guide walks you through creating a simple module in Fullfinity, showing what each file
contains. (If you just want the structure generated for you, run
fullfinity -c /app/config.yaml new library inside the container — see Developing Modules — then
fill in the files below.)
Modules you build live under modules/.
Create a Module
Section titled “Create a Module”1. Create Module Directory
Section titled “1. Create Module Directory”mkdir -p modules/library/modelsmkdir -p modules/library/viewsmkdir -p modules/library/securitytouch modules/library/__init__.pytouch modules/library/models/__init__.py2. Create Module Manifest
Section titled “2. Create Module Manifest”Create modules/library/manifest.yaml:
name: Libraryidentifier: libraryversion: '1.0'requires_engine: 1publisher: Your Companycategory: module_category_toolsdescription: Manage books and authorsdependencies: - coreicon: Bookcolor: "#4A90D9"publisher, requires_engine (the engine major version the module targets), category and
icon are required keys: the manifest gate (check --only manifests) rejects a manifest
without them.
3. Define Models
Section titled “3. Define Models”Create modules/library/models/author.py:
from fullfinity.engine.base import *
class Author(Model): _verbose_name = "Author"
name = Char(max_length=255, required=True, description="Author Name") email = Char(max_length=255, description="Email") bio = Text(description="Biography") active = Boolean(default=True)Create modules/library/models/book.py:
from fullfinity.engine.base import *
class Book(Model): _verbose_name = "Book" # Availability is a condition, not a workflow: a returned book is lent again, so # no status freezes the record. _controlled_edits = []
name = Char(max_length=255, required=True, description="Book Title") isbn = Char(max_length=20, index=True, description="ISBN") author = ManyToOne("Author", related_name="books", on_delete="RESTRICT", description="Author") published_date = Date(description="Publication Date") currency = ManyToOne( "Currency", related_name="books", on_delete="RESTRICT", required=True, default=lambda self: get_user_company_currency(self), description="Currency", ) price = Monetary(currency_field="currency", description="Price") status = Selection( choices=["Available", "Borrowed", "Reserved"], default="Available", description="Status" )A Monetary names the field holding its currency (currency_field); check --only currency
rejects one that doesn’t. get_user_company_currency defaults it to the current company’s currency.
Register both model files in modules/library/models/__init__.py — a model file is only imported (and its model registered) if it is listed here:
from . import authorfrom . import book4. Create Views
Section titled “4. Create Views”Create modules/library/views/author_views.yaml:
- data_type: UiView name: author_list_view identifier: author_list_view type: List model: Author arch: - content: - type: field name: name - type: field name: email - type: field name: active- data_type: UiView name: author_form_view identifier: author_form_view type: Form model: Author arch: - type: row content: - type: column span: 6 content: - type: field name: name properties: size: lg - type: field name: email - type: row content: - type: column span: 12 content: - type: field name: bio properties: widget: RichTextEditorCreate modules/library/views/book_views.yaml:
- data_type: UiView name: book_list_view identifier: book_list_view type: List model: Book arch: - content: - type: field name: name - type: field name: author - type: field name: isbn - type: field name: status properties: colors: Available: green Borrowed: orange Reserved: blue- data_type: UiView name: book_form_view identifier: book_form_view type: Form model: Book arch: - type: statusbar name: status properties: colors: Available: green Borrowed: orange Reserved: blue - type: row content: - type: column span: 6 content: - type: field name: name properties: size: lg - type: field name: author - type: field name: isbn - type: column span: 6 content: - type: field name: published_date - type: field name: price - type: field name: currencyA field with no widget: gets its type’s default (a text input, a record picker, a date
picker, an amount in its currency, a badge for a status in a list); name a widget only to
choose something else.
5. Create Actions and Menus
Section titled “5. Create Actions and Menus”Create modules/library/views/actions.yaml:
- data_type: WindowAction name: Authors identifier: authors_action model: Author modes: List, Form views: - - set - - author_list_view - author_form_view- data_type: WindowAction name: Books identifier: books_action model: Book modes: List, Form views: - - set - - book_list_view - book_form_viewCreate modules/library/views/menus.yaml:
- data_type: UiMenu name: Library identifier: library_menu sequence: 20 icon: Book- data_type: UiMenu name: Authors identifier: authors_menu parent: library_menu action: authors_action sequence: 10- data_type: UiMenu name: Books identifier: books_menu parent: library_menu action: books_action sequence: 206. Create Security Rules
Section titled “6. Create Security Rules”Create modules/library/security/security.yaml:
- data_type: Group name: Librarian identifier: library_librarian category: Library- data_type: ModelAccess name: Author Access identifier: author_access model: Author read_perm: true write_perm: true create_perm: true delete_perm: true group: library_librarian- data_type: ModelAccess name: Book Access identifier: book_access model: Book read_perm: true write_perm: true create_perm: true delete_perm: true group: library_librarian7. Install the Module
Section titled “7. Install the Module”From the CLI:
docker compose exec fullfinity fullfinity -c /app/config.yaml -db dev --init library --init-onlyOr from the UI: open Apps, find “Library”, and click Install (restart the server first if it was already running).
8. Use Your Module
Section titled “8. Use Your Module”After installation:
- A “Library” menu appears in the sidebar
- You can create Authors and Books
- The records are available through the generic data API, keyed by model name — e.g.
POST /api/query/AuthorandPOST /api/query/Bookto list records,POST /api/create/Bookto create one. See the API Overview for the full endpoint set.
Next Steps
Section titled “Next Steps”- Creating Modules - Deep dive into module development
- Field Types - Learn all available field types
- Views - Create rich user interfaces