Archiving documents solution
Please see our Documentation.
-
Python 3.7
-
PostgreSQL 11
-
Redis 4.x (used by Celery for queuing task)
-
Firefox or Chrome (to run functional tests)
-
Node.js LTS
-
Java 8+ (for documents indexing)
-
Black (Python code formatter)
-
Prettier (HTML/JS/CSS/etc code formatter)
-
Under Linux, you may need additional tools to build Python modules which includes C code:
- apt-get install build-essential python3-dev libpq-dev
cd ftl
python -m pip install -r requirements.txt
python -m pip install -r requirements_dev.txt
python -m pip install -r requirements_dev[win|osx].txt
cd ftl/frontend
npm ci
First terminal
cd ftl/frontend
npm run serve
Second terminal
cd ftl
python manage.py runserver
To run local as https (required to test 2fa fido2 devices) use python manage.py runsslserver
instead. You must have DEBUG
and DEV_MODE
set to True
in settings.py
(set them in your settings_local.py
wont work unfortunately) and you may have to use localhost
domain (in place of the usual ip) in order your browser accept to load the app.
Third terminal (Required to process new docs or to run CRONs)
redis-server
Fourth terminal (Required to process new docs)
cd ftl
python -m celery -A ftl worker -l info -Q med,celery,ftl_processing
Fifth terminal (Required to run CRONs)
cd ftl
python -m celery -A ftl beat -l DEBUG --scheduler django_celery_beat.schedulers:DatabaseScheduler
black is required for all Python files. There is a hard check on the CI for this and it will fail if the Python code is not properly formatted. Please refer to the official site for setup.
# reformat all Python files
cd ftl
python -m black .
Prettier is required for all files in the frontend
app. There is also a hard check on the CI
for this. Please refer to the official site for setup.
# reformat all js files (run at project root)
npx prettier@2.0.5 --write .
Default formatter of IntellJ/PyCharm. Not checked in CI.
To run functional tests: make sure your settings.DEFAULT_TEST_BROWSER
is properly set, download the proper webdriver for your version of Chrome or Firefox, make sure chrome
/firefox
and chromedriver
/geckodriver
are registered in your OS path (or alternatively set absolute path for them in settings BROWSER_BINARY_PATH
, DEFAULT_CHROMEDRIVER_PATH
/DEFAULT_GECKODRIVER_PATH
).
Run all tests
python manage.py test
# Run all tests excepted slow ones (all functional tests are tagged as `slow`)
python manage.py test --exclude-tag=slow
Run tests for a specific module
python manage.py test ftests # run only functional tests
python manage.py test core # run unit tests of core module
Run tests with coverage report
# run tests with coverage inspection enable (i.e. replace `python` by `python -m coverage run`)
python -m coverage run manage.py test
# combine different coverage files to `.coverage`
python -m coverage combine
# generate html report at ftl/htmlcov/index.html
python -m coverage html
Run all tests
vue-cli-service test:unit
Or alternatively npx vue-cli-service test:unit
Run tests with coverage report
vue-cli-service test:unit --coverage
# html report generated at ftl/frontend/coverage/lcov-report/index.html
1 - Add missing keys to translate into .po files (or add a new language):
python manage.py makemessages --no-location -l fr --ignore=requirements*.txt,__init__.py,ftest/*
2 - Update existing translations in .po files:
python manage.py makemessages --no-location --all
3 - Update/complete translations in .po files
4 - Compile .mo files:
python manage.py compilemessages
generated .mo files aren't versioned and should be regenerated locally after each .po files update.
To use specific Django settings without modifying main ftl/ftl/settings.py
file, create a ftl/ftl/settings_local.py
file and override desired setting in it.
npm run build
python3 manage.py collectstatic
python manage.py reindex_docs
-
Programming languages:
-
Main technologies used:
- Web framework: Django
- Database: PostgreSQL
- Document storage, django-storages allow to choose between:
- File system
- Google Cloud Storage
- Amazon S3
- Optical Character Recognition, to choose between:
- Document text extraction: Apache Tika
- Documents preview:
- PDF: PDF.js
- Office documents: Only Office
- Search engine: PostgreSQL tsvector
-
UI:
- CSS framework :
- Logo police: Quicksand
- App Icons: Font Awesome
- SVG illustrations: Undraw