diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9592c38f11e83b636c03d4d96c745c3904d97960..6b46b33713c380d60b97395c30ec6bc596724032 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ build: ci_frontend: stage: ci script: - - ./ci_frontend.sh + - docker-compose run --rm --entrypoint="npm run test-ci" mc_frontend > ci_frontend.log artifacts: paths: - ci_frontend.log diff --git a/CHANGELOG b/CHANGELOG index 70d5187bb3c7db45bcc4a7f0571ae7272043c106..690f65391bc5d4a32389a274ff99245be0715350 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,261 +1,10 @@ -08d2554 (HEAD -> develop, origin/master, origin/develop, origin/HEAD, master) put test Mocks in their own file -5ed1fc3 improved performance of frequency analysis and introduced new unit tests -36bd443 CI: combined badge tasks -151073f CI: updated regex for coverage parsing -8ca7f32 CI: added installation of dependencies -fc520c6 updated CI to work with gitlab-runner -564875d updated CI config -66c787a fixed python version for CI -c0bde97 fixed pip installation on CI server -723c6ea reintroducing CI -f98c223 included text complexity information into the rawTextAPI, while leaving it also as its own, independent API for target querying of certain measures -836c747 added frequency analysis API to provide more support for matching exercises -9d31295 excluded cached json files from source code repository -ad9dd0a Merge branch 'develop' of https://scm.cms.hu-berlin.de/callidus/mc_backend into develop -3ae5638 optimized database access to prevent idle transactions -993698f Lexical density measure added to the text complexity api -bf45368 Small code fixing on the Text Complexity API -e8f1ea9 fixed a bug in the subgraph API -fe83d3d mark words exercises now have the maximum number of correct solutions in their description -23adc81 raw text basis for CONLLU annotation data is now uniform (whitespace always stripped) -560a5c3 fixed POS counting measure in text complexity -aa5bc49 Merge branch 'develop' of https://scm.cms.hu-berlin.de/callidus/mc_backend into develop -e046ed2 extended subgraph API for more flexible retrieval of smaller graphs from a larger one -857f1fa fixing code to integrate text complexity api -af033c2 started integrating text complexity with main application -2796afd Merge branch 'develop' of https://scm.cms.hu-berlin.de/callidus/mc_backend into develop -f7643c5 simplified and cleaner database access, session are now ended on quitting the application -228de51 Merge branch 'master' of https://scm.cms.hu-berlin.de/callidus/mc_backend -b7a7169 AQL queries -b60ca29 Merge branch 'develop' -314e2f0 fix corrupted exercise data -f4341c8 Merge branch 'develop' -9539ad3 fixed logging and the response type of the vocabulary check API -f382908 Merge branch 'develop' -136b80a adjust rawTextAPI to the new AnnisResponse model -bf33414 Merge branch 'develop' -9c9a059 exercise API now supports querying of single old exercises, in conjunction with an exercise repository (exerciseList API) -89e3352 Merge branch 'develop' -4c42c43 fixed URNs for vocabulary check / subgraph data -dcc8bfd Merge branch 'develop' -5d3102b file API can now generate PDF and DOCX from HTML -b10fdf6 Merge branch 'develop' -f96aeaa refactoring of all imports so the backend can be used without docker more easily -a8245ce Merge branch 'develop' -185c432 reff and texts/annotations are now more precisely identifiable by CTS URN -923f648 Merge branch 'develop' -c06a1ae static exercise API now also gives URN and lemmata, but crawls only solutions instead of the whole exercise -cea2076 Merge branch 'develop' -63ffe39 added file export (PDF, DOCX) for the mark words exercise -33a627b Merge branch 'develop' -2facd85 Merge branch 'develop' of https://scm.cms.hu-berlin.de/callidus/mc_backend into develop -589f9b6 introducing new exercise type: Mark Words -f7c5c1a Merge branch 'develop' of https://scm.cms.hu-berlin.de/callidus/mc_backend into develop -7b758c0 Text Complexity Revision and Expansion -7098da5 Merge branch 'develop' -e5f68e8 introducing the Static Exercises API which offers deep links to exercises for various Latin words -e42626f Merge branch 'develop' -0c46b8d fixed logging for docker -544f3fa Merge branch 'develop' -9e547b7 added whitespace before cloze exercise gaps -02e86b3 updated unit tests and fixed a minor issue in the text complexity API -3b0f797 added text complexity initialization -7a86145 Merge branch 'develop' of https://scm.cms.hu-berlin.de/callidus/mc_backend into develop -039f30a Introducing the Text Complexity API -4c18575 Merge branch 'develop' -fed041a fixed file permissions for learning results -4570e88 Merge branch 'develop' -5311d44 fixes for file API (request parsing locations) and file directories -34dbe7a Merge branch 'develop' -ff83e2f fix for the arguments of the file API -6b15a21 Merge branch 'develop' -fffe4d5 file API now accepts POST requests to save learning results -04695b1 Merge branch 'develop' -c6188b5 added more file permissions to the temporary export files so Docker can handle them more easily -904374e Merge branch 'develop' -6d9911f added UDPipe binary for windows -0cca892 Merge branch 'develop' -50247f1 fixed a bug where exercises for textbooks with vocabulary filters were not loaded due to a mismatch in the solution architecture -9fe94a4 Merge branch 'develop' -796f307 introduced recovery after database connection failures, e.g. due to broken SSL connections -5718f7d Merge branch 'develop' -2bdb366 fix PyCharm debugging for Docker -88d6ae3 Merge branch 'develop' -4f0e4a8 Merge branch 'develop' of https://scm.cms.hu-berlin.de/callidus/mc_backend into develop -be0005f introduced tags for Moodle XML and fixed database migration with Docker -0c9ca73 Merge branch 'develop' into 'master' -42cdc17 Proper Nouns are now recognized as a match in the Vocabulary API -cb811be KWIC API now builds SVG data from ANNIS graphs -f3d49ed fix a bug in the valid reff cache where it would use the raw CTS URN as a file name instead of a disk URN -7e9eb60 improved docker setup by separating the Corpus Storage Manager from the main application -39dbb37 introducing Docker and a fix to CSM initialization -4d5adf4 improved CSM initialization -628b727 small fix to custom corpus handling -8600b3f introducing H5P API and KWIC API -3c865a5 introducing vocabulary checks for the PROIEL treebank -040a9ba improved vocabulary check -a64226f exported files now do not have additional whitespace before punctuation signs anymore -76c65c5 small fix to vocabulary API where errors occurred in custom corpora if the desired sentence range was bigger than the actual sub-graph -d385130 file API now supports restricting solutions to certain indices (e.g. only known vocabulary) -601c4dc fix to config checks -06ab42e rollback to threads instead of processes -a2d9d7b further fix for migration script -51b9a7f further fixes for migration script -75da7d7 quick fix for the migration script -1e4c1ee hotfix for custom corpus processing -f0054e8 quick fix for selecting sentence sub-graphs of custom corpora -3c2846d small fix for exercise export of custom corpora -7ac8ce6 improved corpus update mechanism -288fbcb added the PROIEL treebank texts and annotations to the corpus -49ee733 fixed graph cache for sub-corpora -ae43147 fixed text generation for sub-graphs -98570dc improved corpus retrieval performance (more caching) -9d8f8d0 rawTextAPI now supports getting smaller parts of CTS corpora, even if those parts do not match the usual citation boundaries -d8854b5 small fixes to CSM detection and the respective corpus handling -5508209 fixed corpus access from inside and outside of CSM -6200323 quick fix for vocabulary filter, added VIVA vocabulary -bc01cfd introducing the vocabulary filter -f005634 fix for missing cache directory -1bf0011 small fix for the custom corpus initialization -23503d2 small fix to file write operations -2e96c92 corpora and validReff are now cached on disk -4aefe3c ANNIS now delivers arbitrary numbers of results all in one go -289e06f fixed root dependency search and text annotations consistency -0398d7b small fix for adding corpora -f4e3678 exercises now support multiple search values for the same phenomenon -bcaa586 Merge branch 'master' into develop -9ecfe75 added sudo and pwd to CI script -764c9ca added tags to the CI config -f7ae850 introducing CI -da03e6c added the matching exercise type and added CONLL annotations to the exercise database model -f13bece backup save -456937f fixed upgrade script for the database -7bacd0a exercises can now be exported to .DOCX, database needs to be adapted for that -f429b7c added query feature for dependencies and lemma search -c580e06 exercises now support AQL queries for all the POS tags according to the UD schema -f1864a0 database initialization is now exclusively performed by the Corpus Storage Manager thread -4b97dca major restructuring to make the app distributable as a wheel with setuptools; VScode config may need some small fixes to file paths -1a70b54 update interval for corpus age check is now customizable -f795634 trying to prevent flush errors during corpus list updates -2094195 database access is now (partially) handled by multithreading instead of multiprocessing, because HTTP requests do not seem to work in a multiprocessing environment -671c5e6 fixed flush errors in the corpus service when accessing the database -9bc2a8a fixed I/O error for trying to print in background processes -ec4362c fixed concurrency issues with the corpus service and its database access -018ba3e improved error handling for database errors due to concurrency -8bb5556 small fix to the citation level handling -d237c48 the validReff API now sends only the directly relevant citations (without nesting) -5147860 Merge branch 'master' into develop -4172267 added support for the VIVA textbook, and non-CTS corpora in general -4aafba5 Less verbose logging to keep the logfile smaller -1ef726e quick fix for the file API -c7d6ba4 (origin/feature/graphannis-exercise) Merge branch 'master' into develop -174a1af fixed logging -8828c8a Merge branch 'develop' of https://scm.cms.hu-berlin.de/callidus/mc-backend into develop -1782b1f corpus storage manager now runs in an external process so it can always serve the same instance -6c6dec1 Set venv environment for VS Code -175bec4 Set venv environment for VS Code -47c800b replaced ujson package with rapidjson -70fae52 improved speed of JSON serialization during exercise generation -770e117 Merge branch 'master' into develop -7e62225 fixed recursion error in the exercise API -207a0bf Remove the app.db -e126770 improved file handling, is now cross-platform -4a7f096 changed gunicorn async workers from aiohttp to eventlet -815b9fa changed gunicorn config to use async workers -6c9457f trying to fix intermittent CORS issues -9e74d09 fixed request args for file api -89f6780 fixed requirements -50131b6 fixed PDF export in file API -9b48359 fixed gitignore for files -b1f6a22 Revert "added PDF export to the file API" -98ce220 added PDF export to the file API -7e9ea0a improved temp file handling and added general feedback parameter exercise generation -8e1da84 fixed CORS issues, improved XML for exercise generation (more customization possible) -2dc4abb fixed CORS for file API -63a66d6 modified exercise API to contain url for file download, added Exercise table in the database, added file download API -f1b40ec reinforced CORS for post requests to the exercise API -6c231ff fixed ordering links in the exercise API -c1494c7 tidy up unit tests -99fa4de the application now always uses the same instance of the graph store object, with a customizable location on disk -3afe1b6 fixed request parsing and added unit tests for exercise API -4117c7f Merge branch 'feature/graphannis-exercise' -d4a7586 added annotation service -40a8ed4 exercise API now looks for raw text in the body -251be8c update -c6779f7 reformatted blank lines -02ef657 requirements now include conllu and networkx -9715b9f updated readme -eca859f Merge branch 'feature/graphannis-exercise' of https://scm.cms.hu-berlin.de/callidus/mc-backend into feature/graphannis-exercise -8ea5597 Merge branch 'master' of https://scm.cms.hu-berlin.de/callidus/mc-backend -78664ca updated git clone url -22bec95 remember solution -07f5e76 add also the dependency edges as pointing relations -79220ce Use "title" instead of textname -d8f8e2b Replace the token value and remove the lemma for matches -e7c0f5e Return the subgraph as node link JSON data -7518e2d Map all fields, not only pos and lemma -9b7a8ca Clean up current state by putting some functionality into extra functions -098bf5a Map tokens with their lemma and pos -40bd75c Parse CONLL with https://github.com/EmilStenstrom/conllu -bc8959c Begin to parse CONLL -70909ca Nicer debugger params -156759b Add VS Code debug config -79bd944 Add some example code -7477937 Ignore app.db and .env file -437325b fixed new raw text API -bacb56e gunicorn now has autoreload on source code change -7628b5c added raw text retrieval API -5fd6e36 updated readme & config -9afc9df updated readme -9d78b1d updated readme -b2455c9 added mock data for exercise generation -dca331d updated config handling -ad8b2a2 fixed log file pointer -2c261d8 added new logging mechanism for gunicorn -cec641c removed print statement from production context -0bcd268 relocated database initialization so it only happens when the main script is called directly -987da6c added columns for citation levels -e4dfe64 added migration script -ca937ca added citation level foreign keys in corpus table -c4458de added citationlevel table -d9afc39 added code documentation -d21a1bb increased gunicorn worker count -14da52a added logging to gunicorn -abb17a6 added gunicorn config -df78de8 updated instructions and corpus URN -a129d74 added some debug info -6cd0741 moved host IP handling to .env -7feb49c fixed host name handling -770d1cb moved host name to .env -ad9e612 updated git URL -7baee25 added timestamp to logging -b8e6869 fixed error logging -719d6f9 added blinker dependency -7333350 added exception handler -89fdb4a added logging -73e64ef changed API response to "real" JSON wrapped in a Flask Response -afe070d now allowing CORS -9a28f6d initial commit with updated readme -98f8826 update -8f76619 Merge branch 'master' of https://scm.cms.hu-berlin.de/callidus/backend -9761ec3 update -1ee1f9b update -4a8bad0 update -eac85ec update -a16b70a update -b68889f update -0f33d9b update -f1bd5ec update -f22d2eb Merge branch 'master' of https://bitbucket.org/burrocar/mcserver -37a8545 update -ae1f9ad .env deleted online with Bitbucket -2dd17f6 update -38fbeb3 update -6cc7a5c update -2821544 env -6fbbc1e rewrite -1a169c5 update -60696ed update -922102e upd -d1d37bb Update README.md -33e3c66 Add new file +cda4d52 (HEAD -> master, tag: 1.9.3, origin/master, origin/HEAD) added code coverage configuration file +a2fa2be (tag: 1.9.2) simplified CI for the backend +34029c7 (tag: 1.9.1) added missing dependencies (coverage & psycopg2) +e6c8016 (tag: 1.9.0) added missing dependency (gunicorn) +72aa622 (tag: 1.8.9) removed port forwarding for the database (docker) container +143e218 (tag: 1.8.8) combined CI for backend and frontend +d7f3841 (tag: 1.8.7) simplified frontend CI +4d2247e (tag: 1.8.6) enable CI for frontend +150d280 (tag: 1.8.5) merge source code for frontend and backend +5f8b59f (tag: 1.8.4) Initial commit diff --git a/README.md b/README.md index e99fea8f7a2a2441ad5c51ecc4c25d39a2a9cfab..5201b7d6ef56c56903de3c73b0190dee2140b9c6 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,34 @@ [![pipeline status](https://scm.cms.hu-berlin.de/callidus/machina-callida/badges/master/pipeline.svg)](https://scm.cms.hu-berlin.de/callidus/machina-callida/-/commits/master) [![coverage report](https://scm.cms.hu-berlin.de/callidus/machina-callida/badges/master/coverage.svg)](https://scm.cms.hu-berlin.de/callidus/machina-callida/-/commits/master) # Machina Callida -Installation +## Installation +### Docker +1. Install Docker (https://docs.docker.com/v17.12/install/) and Docker-Compose (https://docs.docker.com/compose/install/). +2. Clone the repository: + `git clone https://scm.cms.hu-berlin.de/callidus/machina-callida.git`. +3. Move to the newly created folder: + `cd machina-callida`. +4. Run `docker-compose build`. +5. Run `docker-compose up -d`. -... -Docker: -When using the application for the first time, please wait until the mc_frontend container has finished compiling the application. After that, you may access the application at http://localhost:8100. -... \ No newline at end of file + When using the application for the first time, it may take a few minutes until the container "mc_frontend" has finished compiling the application. +6. Visit http://localhost:8100. + +### Command line +For installation via command line, see the respective subdirectories (`mc_frontend` and `mc_backend`). + +## Debugging +### Access to the Docker container +Use `docker-compose down` to stop and remove the currently running containers. + +To access a running container directly, get the container ID via `docker ps` and connect via `docker exec -it CONTAINER_ID bash`. Or, for root access, use: `docker exec -u 0 -it CONTAINER_ID bash` + +Alternatively, you can use `ssh root@localhost -p 8022 -o "UserKnownHostsFile /dev/null"` to connect to the container via SSH. Password is "root". + +To snapshot a running container, use `docker commit CONTAINER_ID`. It returns a snapshot ID, which you can access via `docker run -it SNAPSHOT_ID`. + +---------------------------------------------------------------- + +## Documentation +### Changelog +To update the changelog, use: `git log --oneline --decorate --color > CHANGELOG` diff --git a/ci_frontend.sh b/ci_frontend.sh deleted file mode 100755 index 8804eaba57fbfa566cb94720d702618f7a1d70ba..0000000000000000000000000000000000000000 --- a/ci_frontend.sh +++ /dev/null @@ -1 +0,0 @@ -docker-compose run --rm --entrypoint="npm run test-ci" mc_frontend > ci_frontend.log diff --git a/mc_backend/README.md b/mc_backend/README.md index 784264cacbc5437eabba34a1ad39d5cff41aa0b8..55fd9674cf36b569edae8e3446d51f40cf7d4f3e 100644 --- a/mc_backend/README.md +++ b/mc_backend/README.md @@ -1,19 +1,7 @@ -[![pipeline status](https://scm.cms.hu-berlin.de/callidus/mc-backend/badges/master/pipeline.svg)](https://scm.cms.hu-berlin.de/callidus/mc-backend/commits/master) -[![coverage report](https://scm.cms.hu-berlin.de/callidus/mc-backend/badges/master/coverage.svg?job=coverage)](https://scm.cms.hu-berlin.de/callidus/mc-backend/commits/master) - -# Installation instructions -## Docker -1. Install Docker (https://docs.docker.com/v17.12/install/) and Docker-Compose (https://docs.docker.com/compose/install/) -2. Clone the repo: - `git clone https://scm.cms.hu-berlin.de/callidus/mc_backend.git` -3. Move to the newly created folder: - `cd mc_backend` -4. Run `docker-compose build` -5. Run `docker-compose up -d` - -## No Docker -1. Set up a PostgreSQL database manually. If necessary, adjust the URI your .env file. -2. Run `python app.py` and `python run_csm.py` as separate processes. +# Installing the backend via command line +1. Set up a PostgreSQL database manually (https://www.postgresql.org/download/). If necessary, adjust the URI in your .env file located at `mcserver/.env`. +2. Run `pip install -r requirements.txt`. +3. Run `python app.py` and `python run_csm.py` as separate processes. ## Endpoints The default starting point for the API will be at http://localhost:5000/mc/api/v1.0/corpora . @@ -21,14 +9,14 @@ The default starting point for the API will be at http://localhost:5000/mc/api/v ---------------------------------------------------------------- # Configuration -For general configuration, use the file "mcserver/config.py". +For general configuration, use the file `mcserver/config.py`. To customize sensitive parts of your configuration, create a ".env" file in the directory "mcserver". A basic .env file may look like this: ``` DATABASE_URL_PROD=postgresql://postgres@db:5432/ DATABASE_URL=postgresql://postgres@db:5432/ -\# Change this to "production" for public use +# Change this to "production" for public use FLASK_ENV_VARIABLE=development -\# for Windows, use 127.0.0.1 instead +# for Windows, use 127.0.0.1 instead HOST_IP=0.0.0.0 RUST_BACKTRACE=1 OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES @@ -56,24 +44,6 @@ If it does nothing or fails, make sure that the environment variable FLASK_APP i ---------------------------------------------------------------- -# Debugging -## Access to the Docker container -Use `docker-compose down` to stop and remove the currently running containers. - -Use `ssh root@localhost -p 8022 -o "UserKnownHostsFile /dev/null"` to connect to the container via SSH. Password is "root". -Alternatively, get the container ID via `docker ps` and connect via `docker exec -it CONTAINER_ID bash`. Or, for root access, use: `docker exec -u 0 -it CONTAINER_ID bash` - -To snapshot a running container, use `docker commit CONTAINER_ID`. It returns a snapshot ID, which you can access via `docker run -it SNAPSHOT_ID`. - ----------------------------------------------------------------- - # Testing To check the coverage of the current tests, run `coverage run --rcfile=.coveragerc tests.py && coverage combine && coverage report -m`. - ----------------------------------------------------------------- - -# Documentation -## Changelog -To update the changelog, use: `git log --oneline --decorate --color > CHANGELOG` - diff --git a/mc_backend/mcserver/config.py b/mc_backend/mcserver/config.py index cae4d2be419314f740ffc49403e309a500508ad4..46208f0a635fe6420ac02c8e50a9060d8ad08a51 100644 --- a/mc_backend/mcserver/config.py +++ b/mc_backend/mcserver/config.py @@ -113,7 +113,7 @@ class Config(object): # END endpoints SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL") or "sqlite:///" + os.path.join(basedir, "app.db") SQLALCHEMY_TRACK_MODIFICATIONS = False - STATIC_EXERCISES_REPOSITORY_URL = "https://scm.cms.hu-berlin.de/callidus/mc_frontend/-/archive/master/mc_frontend-master.zip?path=src%2Fassets%2Fh5p" + STATIC_EXERCISES_REPOSITORY_URL = "https://scm.cms.hu-berlin.de/callidus/machina-callida/-/archive/master/machina-callida-master.zip?path=mc_frontend%2Fsrc%2Fassets%2Fh5p" STOP_WORDS_LATIN_PATH = os.path.join(CACHE_DIRECTORY, "stop_words_latin.json") STOP_WORDS_URL = "https://raw.githubusercontent.com/aurelberra/stopwords/master/stopwords_latin.json" TEST_FLAG = "-test" diff --git a/mc_backend/tests.py b/mc_backend/tests.py index 3cfc5e18c7dd8bdb27890871cb91eff526ad8fab..d8e7350e6d270fe8b9f541c658b88fa5df29619f 100644 --- a/mc_backend/tests.py +++ b/mc_backend/tests.py @@ -362,8 +362,7 @@ class McTestCase(unittest.TestCase): self.assertEqual(response.status_code, 404) TestingConfig.SIMULATE_EMPTY_GRAPH = False - @patch('mcserver.app.api.staticExercisesAPI.requests.get', side_effect=mocked_requests_get) - def test_api_static_exercises_get(self, mock_get: MagicMock): + def test_api_static_exercises_get(self): """ Retrieves static exercises from the frontend and publishes deep URLs for each one of them. """ exercises: List[Tuple[str, str, str]] = [ (Config.H5P_FILL_BLANKS,) + Mocks.h5p_json_fill_blanks_1, diff --git a/mc_frontend/README.md b/mc_frontend/README.md index 270de27f6c6cd923b50be8921da420f83a94b94d..0bff1ae573f0ba03acafc94b1bdaa5f108597ec3 100644 --- a/mc_frontend/README.md +++ b/mc_frontend/README.md @@ -1,18 +1,6 @@ -[![pipeline status](https://scm.cms.hu-berlin.de/callidus/mc_frontend/badges/master/pipeline.svg)](https://scm.cms.hu-berlin.de/callidus/mc_frontend/-/commits/master) -[![coverage report](https://scm.cms.hu-berlin.de/callidus/mc_frontend/badges/master/coverage.svg)](https://scm.cms.hu-berlin.de/callidus/mc_frontend/-/commits/master) -# Installation -## via Docker: -1. Install Docker (https://docs.docker.com/v17.12/install/) and Docker-Compose (https://docs.docker.com/compose/install/) -2. Clone the repo: - `git clone https://scm.cms.hu-berlin.de/callidus/mc_frontend.git` -3. Move to the newly created folder: - `cd mc_frontend` -4. Make sure to assign at least 4GB RAM (Memory) to the Docker engine, otherwise the build will fail. -5. Run `docker-compose build`. -6. Run `docker-compose up -d` and enjoy! -## via Command Line: -1. Clone the repo: `git clone https://scm.cms.hu-berlin.de/callidus/mc_frontend.git` -2. Move to the newly created folder: `cd mc_frontend` +# Installing the frontend via command line +1. Clone the repo: `git clone https://scm.cms.hu-berlin.de/callidus/machina-callida.git` +2. Move to the newly created folder: `cd machina-callida/mc_frontend` 3. Run `npm install` 4. Run `npm install -g @angular/cli` (you may need `sudo`). 5. Check that the Angular command line interface is installed by running `ng --version`. It should print the version of the Angular CLI. @@ -23,10 +11,6 @@ If you already ran `npm install` and the CLI still complains about missing depen To build the application for production environments, use: `ionic cordova build browser --prod --release --max-old-space-size=4096` and serve the content of the `platforms/browser/www` folder, e.g. with Nginx. # Development To add new pages to the application, use: `ionic generate page PAGE_NAME`. -# Access to the Docker container -Use `docker-compose down` to stop and remove the currently running containers. -To access a running container directly, get the container ID via `docker ps` and connect via `docker exec -it CONTAINER_ID bash`. Or, for root access, use: `docker exec -u 0 -it CONTAINER_ID bash` -To snapshot a running container, use `docker commit CONTAINER_ID`. It returns a snapshot ID, which you can access via `docker run -it SNAPSHOT_ID`. # Configuration ## Backend URL To change the URL for the backend, use the `ionic.config.json` file (proxies > proxyUrl). By default, the system assumes that backend and frontend are installed on the same machine. diff --git a/mc_frontend/nginx.conf b/mc_frontend/nginx.conf index 0a47102f2fe70edd74a2b41bcf640803af7c340f..e0600b0f1b87f1cd7591582056f2e644c440121e 100644 --- a/mc_frontend/nginx.conf +++ b/mc_frontend/nginx.conf @@ -31,7 +31,6 @@ http { location / { root /usr/share/nginx/html; - # /home/mc/mc_frontend/platforms/browser/www; index index.html index.htm; # enable CORS so the cordova files (config.xml) can be accessed from other domains add_header Access-Control-Allow-Origin *; diff --git a/mc_frontend/src/app/doc-software/doc-software.page.html b/mc_frontend/src/app/doc-software/doc-software.page.html index 6db091345b387d60795f0359fd5e4c5e98b11c8b..5d3b02d858bbdbf2c39bf82ff77ce108907a2388 100644 --- a/mc_frontend/src/app/doc-software/doc-software.page.html +++ b/mc_frontend/src/app/doc-software/doc-software.page.html @@ -28,12 +28,9 @@ diff --git a/mc_frontend/src/app/doc-software/doc-software.page.ts b/mc_frontend/src/app/doc-software/doc-software.page.ts index 095fb9511dc4ff3c9a6d3c2abda99a9b76008327..ba9ebe2922817fa5cf3b2a0dafecf2d57b4cfb43 100644 --- a/mc_frontend/src/app/doc-software/doc-software.page.ts +++ b/mc_frontend/src/app/doc-software/doc-software.page.ts @@ -3,6 +3,7 @@ import {HelperService} from 'src/app/helper.service'; import {NavController} from '@ionic/angular'; import {HttpClient} from '@angular/common/http'; import {TranslateService} from '@ngx-translate/core'; +import configMC from 'src/configMC'; @Component({ selector: 'app-doc-software', @@ -11,7 +12,8 @@ import {TranslateService} from '@ngx-translate/core'; }) export class DocSoftwarePage { - devIndices: number[] = [...Array(13).keys()]; + public configMC = configMC; + public devIndices: number[] = [...Array(13).keys()]; constructor(public navCtrl: NavController, public http: HttpClient, diff --git a/mc_frontend/src/app/sources/sources.page.html b/mc_frontend/src/app/sources/sources.page.html index 11d0798858aa8b99f130ca792133c4792e076fbd..02fd6741cd0452888b34ce85396afb011aa1ff6a 100644 --- a/mc_frontend/src/app/sources/sources.page.html +++ b/mc_frontend/src/app/sources/sources.page.html @@ -26,24 +26,15 @@

Software-Entwicklung

-
Machina Callida - Backend
+
Machina Callida

Die im Rahmen des Callidus-Projektes entwickelte Software - Machina Callida - ist ein Open Source-Projekt. Der Code ist bei GitLab zu finden.
- Backend -

-
-
- -
Machina Callida - Frontend
-
- - -

- Das Frontend ist ebenfalls bei GitLab zu finden.
- Frontend + + {{'SOURCE_CODE' | translate}} +

@@ -113,7 +104,8 @@ -
CoNLL-U Viewer
+
CoNLL-U Viewer
+

Copyright Bilder

@@ -123,7 +115,8 @@
-
Icon made by Freepik
+
Icon made by Freepik +
from www.flaticon.com is licensed by CC 3.0 BY
diff --git a/mc_frontend/src/app/sources/sources.page.ts b/mc_frontend/src/app/sources/sources.page.ts index bdae6e7ccf586b810e5d08ab0d5717b3bece0fd9..a8cf04759d72e7b134e985bd5ece71682cb71272 100644 --- a/mc_frontend/src/app/sources/sources.page.ts +++ b/mc_frontend/src/app/sources/sources.page.ts @@ -3,6 +3,7 @@ import {HelperService} from 'src/app/helper.service'; import {NavController} from '@ionic/angular'; import {HttpClient} from '@angular/common/http'; import {TranslateService} from '@ngx-translate/core'; +import configMC from 'src/configMC'; @Component({ selector: 'app-sources', @@ -12,6 +13,8 @@ import {TranslateService} from '@ngx-translate/core'; export class SourcesPage { + public configMC = configMC; + constructor(public navCtrl: NavController, public http: HttpClient, public translate: TranslateService, diff --git a/mc_frontend/src/assets/i18n/de.json b/mc_frontend/src/assets/i18n/de.json index acd20548533d86881d7a8acf3d66ee9459671644..5e0233c6846dfb5c9c78b39859ad0ba55b5ffeff 100644 --- a/mc_frontend/src/assets/i18n/de.json +++ b/mc_frontend/src/assets/i18n/de.json @@ -301,6 +301,7 @@ "SORTING_CATEGORY_TYPE_DESCENDING": "Typ (absteigend)", "SORTING_CATEGORY_VOCABULARY_ASCENDING": "Vokabular (aufsteigend)", "SORTING_CATEGORY_VOCABULARY_DESCENDING": "Vokabular (absteigend)", + "SOURCE_CODE": "Quellcode", "SOURCES": "Ressourcen", "START_LEARNING": "Lernmodus", "START_OF_TEXT": "Anfang der Passage", diff --git a/mc_frontend/src/assets/i18n/en.json b/mc_frontend/src/assets/i18n/en.json index 656a5f3a28491333df6751c132f6fecee23b8797..0f49a5312aeb53e880d335a56768eb93d4cb9309 100644 --- a/mc_frontend/src/assets/i18n/en.json +++ b/mc_frontend/src/assets/i18n/en.json @@ -301,6 +301,7 @@ "SORTING_CATEGORY_TYPE_DESCENDING": "Type (descending)", "SORTING_CATEGORY_VOCABULARY_ASCENDING": "Vocabulary (ascending)", "SORTING_CATEGORY_VOCABULARY_DESCENDING": "Vocabulary (descending)", + "SOURCE_CODE": "Source code", "SOURCES": "Sources", "START_LEARNING": "Learning mode", "START_OF_TEXT": "Start of selected text", diff --git a/mc_frontend/src/configMC.ts b/mc_frontend/src/configMC.ts index d0e64164f75a6cff81930b4ae9d8f8ba9c036000..d2ffe29ca1cdb012363af7e5b3dad8a07d2dfe7f 100644 --- a/mc_frontend/src/configMC.ts +++ b/mc_frontend/src/configMC.ts @@ -24,9 +24,8 @@ export default { localStorageKeyCorpora: 'mc/corpora', localStorageKeyH5P: 'mc/h5p', localStorageKeyUpdateInfo: 'mc/updateInfo_v2', - machinaCallidaBackendUrl: 'https://scm.cms.hu-berlin.de/callidus/mc_backend', machinaCallidaConceptUrl: 'https://www.projekte.hu-berlin.de/de/callidus/machina-callida', - machinaCallidaFrontendUrl: 'https://scm.cms.hu-berlin.de/callidus/mc_frontend', + machinaCallidaSourceCodeUrl: 'https://scm.cms.hu-berlin.de/callidus/machina-callida', maxTextLength: 0, menuId: 'mc-menu', pageUrlAuthor: '/author',