MoFaCTS is a Meteor.js driven, responsive implementation of the FaCT System designed for use by mobile participants.
Please see the docs subdirectory for a complete description of deployment and production setup.
Follow these instructions to get a local copy of Mofacts up and running on your machine.
Before you begin, you will need the following installed:
- Node.js: Version
12.x - npm: Version
6.x - Meteor.js: Version
1.12
We strongly recommend using nvm (Node Version Manager) to manage your Node.js and npm versions to avoid conflicts.
-
Clone the Repository Clone this repository to your local machine.
git clone https://github.com/memphis-iis/mofacts.git cd mofacts/mofacts/ -
Set Up Node.js Environment If you are using
nvm, run the following commands to install and use the correct Node.js version specified in the project's.nvmrcfile.nvm install 12 nvm use 12
-
Install Meteor.js Install the specific version of Meteor required for this project.
curl https://install.meteor.com/\?release\=1.12 | sh
-
Create Configuration File Create your own settings file by copying the example file. You will need to edit settings.json with your local configuration details (e.g., admin/teacher emails, symspell settings, feedback cache locations).
cp example.settings.json settings.json
-
Install Dependencies Install all of the required npm packages.
npm install
-
Run the Application You can now start the Meteor development server.
meteor run --settings settings.json
You can deploy MoFaCTS and its dependencies easily using Docker Compose.
- Docker and Docker Compose installed on your system.
- A valid
settings.jsonfile and any required assets in a directory (e.g.,/mofactsAssets).
- Place your
settings.jsonand any other required files in a directory on your host (e.g.,/mofactsAssets). - Edit the
docker-compose.ymlfile if you need to change asset or data locations.
From the directory containing your docker-compose.yml file, run:
docker compose up -dThis will start:
- MoFaCTS (using the prebuilt image
iisdevs/mofacts-mini:main) - MongoDB (data persisted in a Docker volume)
- Syllables service (using
iisdevs/mofacts-syllables)
- The MoFaCTS app will be available at http://localhost:3000.
- The syllables service will be available at port 4567 if needed.
To stop the services:
docker compose downThis will stop and remove the containers, but the MongoDB data will persist in the named Docker volume.
- The
MONGO_URLand other environment variables are set automatically in the compose file. - For production, you may want to adjust resource limits or use external MongoDB.
- To update to the latest image, run
docker compose pullbefore starting. - If you want to use a different image tag (e.g.,
staging), edit theimage:line in the compose file.
version: '3.2'
services:
mofacts:
image: iisdevs/mofacts-mini:main
volumes:
- type: bind
source: /mofactsAssets
target: /mofactsAssets
bind:
propagation: shared
build:
context: ../../
dockerfile: Dockerfile
ports:
- '3000:3000'
depends_on:
- mongo
- syllables
environment:
ROOT_URL: ${APP_ROOT_URL:-http://localhost}
MONGO_URL: mongodb://mongo:27017/MoFACT
PORT: 3000
METEOR_SETTINGS_WORKAROUND: '/mofactsAssets/settings.json'
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
mongo:
image: mongo:latest
command:
- --storageEngine=wiredTiger
volumes:
- data:/data/db
syllables:
image: iisdevs/mofacts-syllables
build:
context: ../../syllables_subsystem
dockerfile: Dockerfile
ports:
- '4567:4567'
volumes:
data: