Skip to content

haslab/Alloy4Fun

 
 

Repository files navigation

Alloy4fun

Web application for editing, sharing and interpreting Alloy models in your browser, in real time.

Build Status

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.

Contributing and Development Guidelines

You can contribute by looking at the issues section.

INFO: The application contains three main services/containers:

  1. api - where a Java web service is used to interact with the alloytools API
  2. mongo - the instance of mongodb that has data persistance outside docker
  3. meteor - the webapp that interacts with the other services

SETUP: To start the application in your development environment:

  1. Install docker, npm, ...
  2. clone the repo
  3. cp .env.example .env and edit it if necessary
  4. docker-compose up (pass -d for detached mode)

READY: You can now:

Meteor Development with real-time updates

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.

API

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:

  1. mvn clean install
  2. java -Djava.net.preferIPv4Stack=true -jar /home/target/alloy4fun-api-swarm.jar

Database

The database is saved to a volume in data/db/ and backups can be made by copying this folder elsewhere.

Meteor

Meteor will run locally on port 3000 and on port 3010 in docker so that there is no interference between both instances.

Testing

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

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"

Datasets

  • Data from the 19/29 formal methods course at Universidade do Minho (as reported in the ABZ'20 submission).

Team

Alloy4fun has been developed by INESC TEC with members from:

About

A webapp for developing and sharing Alloy models

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 63.3%
  • CSS 18.6%
  • Java 8.9%
  • HTML 8.9%
  • Dockerfile 0.3%