Skip to content
/ foam3 Public

FOAM: Feature-Oriented Active Modeller, Version 3 (unstable)

License

Notifications You must be signed in to change notification settings

kgrgreer/foam3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FOAM3

Build fully featured high performance apps in less time using FOAM.

  • Application Speed
  • Application Size
  • Developer Efficiency

"Fast apps Fast"

FOAM3 is the active version of FOAM.

The FOAM1 website still contains many useful demos and videos (but some links may be broken).

Ask questions and get help on the FOAM Discussion Group.

Feature Oriented Active Modeller

FOAM is a modeling tool and class based object system. To use FOAM, you create a model of your class by describing the properties, methods, event topics, listeners, and dependencies of your class. FOAM takes this model and generates a usable JavaScript class along with several companion features such as database support and network marshaling.

While FOAM is written in JavaScript, it can be used to generate code for any language or platform, including Android Java and iOS Swift.

Development

Installing Dependencies

FOAM has no runtime dependencies, but uses a number of third party tools for unit tests, code coverage, and linting. You can install all required tools by doing the following.

  • Install nodejs.

  • Run npm install in the root of the FOAM repository, where package.json is found.

Building Java

NOTE: default configuration is setup for Java 21

If using a version less than 21, change the java: 21 property in the root pom.js.

If deploying with -u or remotely, update the garbage collection configuration in tools/deploy/etc/shrc.local.

Build and run Java webserver

./build.sh [options]

common options:

  • -h - help - show all options
  • -c - clean
  • -d - debug mode allowing connection by a remote debugger
  • -j - delete runtime journals
  • -Jpom1,pom2,...,pomN - where pomN,... are found relative to the deployment folder.
  • -u - build and deploy from a single Java jar file

If building with option -u, then

Remote deployment

To build and deploy to a remote linux instance

  1. build: ./build.sh -uck[Jpom...]
  2. deploy: foam3/tools/bin/install.sh hostname
  3. visit: https://hostname:8443

Style Guide

All code should follow the style guide.

Testing

To run all Java tests from the command-line, run: ./build.sh -ct

To run individual tests from the command-line, run: ./build.sh -cTtestName1,testName2,...testNameN

Documentation

Videos

Guides

Cheatsheets

Tutorials

Demos

NANOS

To run NANOS, the FOAM Java Application Server, run: ./build.sh -Jdemo then connect to http://localhost:8080

Example FOAM Project

An Example FOAM Project which shows how to consume/use FOAM from an external repository.

Design Patterns

The following course is not directly about FOAM, but covers material essential for fully understanding FOAM's design:

Introduction to Design Patterns

Videos: Part 1, Part2, Part 3