Web application for editing, sharing and interpreting Alloy models in your browser, in real time.
Alloy4Fun is live at http://alloy4fun.inesctec.pt, and you can get started with these examples.
ABOUT: Alloy4Fun is being developed using:
- Meteor framework which is a full-stack JavaScript platform for developing modern web and mobile applications.
- Docker is used to ensure a simple and ubiquitous development environment.
- Travis CI is used for continuous integration through the .travis.yml file.
You can contribute by looking at the issues section.
INFO: The application contains three main services/containers:
api
- where a Java web service is used to interact with the alloytools APImongo
- the instance of mongodb that has data persistance outside dockermeteor
- the webapp that interacts with the other services
SETUP: To start the application in your development environment:
- Install docker, npm, ...
- clone the repo
cp .env.example .env
and edit it if necessarydocker-compose up
(pass-d
for detached mode)
READY: You can now:
- visit the application at localhost:3010
- access the database with a mongo client such as Robo3T at localhost:27017
- use the webservice available at localhost:8081
Since the meteor instance running inside docker is static and has to be built everytime a change is made (docker-compose build meteor
), it is not very good for development.
To have real-time updates while you develop meteor you can run it on your computer (after cd meteor
) with npm start
.
Since the API is essentially an Alloy4Fun webservice a local jar file is used for stability purposes the lib folder structure is required for maven to detect the local repository.
To run the api isolated do cd api
and then docker build -t alloy4fun-api . && docker run -p 8080:8080 alloy4fun-api
for now it can be accessed at http://localhost:8080/
You can also run it outside docker, just take a look at its Dockerfile, essentially you need:
mvn clean install
java -Djava.net.preferIPv4Stack=true -jar /home/target/alloy4fun-api-swarm.jar
The database is saved to a volume in data/db/
and backups can be made by copying this folder elsewhere.
Meteor will run locally on port 3000 and on port 3010 in docker so that there is no interference between both instances.
Unit tests are enabled on both client and server code, with the appropriate chromedriver packages needed for integration and acceptance tests.
To run the tests just do npm test
Linter is also installed and configured but not included in the CI pipeline, to run the linter you can do npm run lint
inside the meteor
folder. To run linter without the --fix
option do eslint .
.
To include the linter in the CI pipeline (first make sure all linter errors are fixed) and then add the following to the package.json scripts
: "pretest": "npm run lint --silent"
- Data from the 19/29 formal methods course at Universidade do Minho (as reported in the ABZ'20 submission).
Alloy4fun has been developed by INESC TEC with members from: