Start here → foam-foundation.github.io/foam3 — guides, tutorials, demos and videos.
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. Or DeepWiki.
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.
FOAM has no runtime dependencies, but does have build dependencies:
- git
- npm
- nodejs (version >= 16)
- maven
- java (version >= 21)
Once dependencies are installed, update FOAM's javascript dependencies: From the root of the FOAM repository, execute:
./build.sh --install
sudo chown -R $USER /opt
See INSTALL.md for more detailed installation notes.
PythonJob allows long-running Python processes (e.g. ML training) to run as
tracked server-side jobs with live output streaming in the browser. It requires:
- uv — Python environment and package manager
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
To verify all AI/Python prerequisites are in place:
./build.sh check-ai
./build.sh -Jdemo
- visit: http://localhost:8080
- login with username
adminand passwordadmin
./build.sh
- -h - help, show all options
- -c - clean
- -d - debug mode allowing connection by a remote debugger
- -j - delete runtime journals (use with caution)
- -Jpom1,pom2,...,pomN - where pomN,... are found relative to the deployment folder.
- -a - build and deploy from a single Java jar file.
NOTE: this will create a parent directory above foam3/
./build.sh -T+setup/Project --appName:Example --package:com.foamdev --adminPassword:badpassword
cd ..
./build.sh
- visit: http:/localhost:8080 and login with admin / badpassword
The project also includes a Dockerfile and a docker-compose.yml. The
image builds the app and runs it from the JARs, with journals, logs and
documents in named volumes:
docker compose up --build
JOURNALS=production docker compose up --build adds deployment journal sets
to the build (docker is always included), and JAVA_OPTS sizes the heap.
To build and deploy to a remote linux instance
- build:
./build.sh -ck[Jpom...] - deploy:
./build.sh -TStandard,RemoteInstall,Java --user:foam user-id:3636 --remote-hostname:hostname - visit: http://hostname:8080
All code should follow the style guide.
To run all, Java and Javacript, tests from the command-line, run:
./build.sh --run-tests
To run individual tests from the command-line, run:
./build.sh --run-tests:testName1,testName2,...testNameN
- Short Intro
- Medium Intro
- Long Intro
- Reactive Programming in FOAM
- UNIX and Google
- Olympic Medals Demo
- Turtle Graphics
The full set of guides is published at foam-foundation.github.io/foam3/guides.
Launch FOAM
To run CORE, the FOAM Java Application Server, run:
./build.sh -Jdemo
- visit: http://localhost:8080
- login with username
adminand passwordadmin
- An Example FOAM Project which shows how to consume/use FOAM from an external repository.
- Another example FOAM Project building on the above with more models and example data.
The following course is not directly about FOAM, but covers material essential for understanding FOAM's design: