Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

msramalho/feup-mfes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alloy4fun

Web app for editing, sharing and interpreting Alloy models in your browser, in real time. Build Status

Originally developed at U. Minho and Haslab. Improved by Faculty of Engineering of the University do Porto. This repo was developed with the help of @Dannyps and refers to the v1.0.0 version of alloy4fun, so it is not expected to updated, the live repo can be found here. A complete list of changes done by @FEUP team can be found in the report.

LIVE DEMO: http://alloy4fun.di.uminho.pt (still not updated to the latest version last time we checked)

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 statick 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"