Welcome to HandyCAT, a flexible web-based CAT tool for translation process research.
The frontend is built entirely with javascript, using the Angular framework.
To set up your development environment, it's strongly recommended that you use the development stack consisting of:
- bower - for frontend package management
- grunt - for automating the build and deployment, running tests, and providing the development server (using packages from npm)
- npm - for managing the node js dependencies
Make sure you are running a 64-bit version of Linux.
- Install node and npm if you don't already have them:
$ sudo apt-get install nodejs
$ sudo apt-get install npm
$ sudo ln -s /usr/bin/nodejs /usr/bin/node
- Install Chrome if you don't have it already.
- Install git:
sudo apt install git
- Clone (or fork) the repo:
git clone https://github.com/chrishokamp/handycat.git
- Install grunt:
sudo npm install -g grunt
- Install grunt-cli:
sudo npm install -g grunt-cli
- Install bower:
sudo npm install -g bower
- Run
sudo npm install
from the top directory (handycat/
) - Run
bower install
from the top directory (handycat/
) - Build bootstrap ui manually:
$ cd app/bower_components/angular-ui-bootstrap
$ npm install
$ grunt
-
Install redis:
$ sudo add-apt-repository ppa:chris-lea/redis-server
$ sudo apt-get update
$ sudo apt-get install redis-server
- Install the XLIFF creator and vocabulary server microservices
First, install pm2
because it makes things easy
$ sudo npm install -g pm2
Now install the microservice dependencies:
$ cd microservices/vocabulary_server
$ npm install
$ cd ../xliff_creator
$ npm install
- to use the autoreload and watch changes functionalities, you'll need ruby and compass.
- Install Ruby, then do:
$ sudo gem install compass
$ sudo gem install sass
Finally, once you've done all that, you're ready to start developing!
-
start mongodb
sudo mongod --fork --logpath=mongod.log --smallfiles
-
start the microservices
$ cd handycat/
$ pm2 start microservices/vocabulary_server/web.js
$ pm2 start microservices/xliff_creator/web.js
- start HandyCAT with live reload
$ grunt express-server
grunt express-server
will fire up a server which watches all of the files in the repo, and automagically reloads whenever you change something.
Note: the command was previously grunt serve
, but this was changed so that both the server and the UI reload automagically.
- use two spaces to indent javascript
- the project uses sass and makes use of mixins and css variables in the app/styles/ directory
- you need at least sass 3.3 -- do
sass -v
to check your version,gem install sass
to install/update
In order to implement new features in HandyCAT, you may need to implement new backend services as well. These should
go in the microservices/
directory. The urls to the microservice should then be proxied throught the express server.
-
The command
grunt handycat_builds
will build the client application intohandycat_builds/
-
To deploy the application to a public server, copy the
handycat_builds/
directory to your server, and change the environment to "production" by uncommenting this line- you can put everything together by doing:
tar czf handycat_build.tar.gz handycat_builds
- if you need to change the port, one way is just to change the hardcoded port number here
Some parts of the application rely upon the language tags in the XLIFF being in a format that we understand. HandyCAT adheres to the XLIFF 2.0 requirements for the srcLang
(required) and trgLang
(optional) attributes, and assumes that language codes are in a format like this.