oussjarrousse / uwazi

Uwazi is a web-based, open-source solution for building and sharing document collections

Home Page:http://www.uwazi.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uwazi Logo

devDependency Status dependency Status Uwazi CI Maintainability Test Coverage

Uwazi is a flexible database application to capture and organise collections of information with a particular focus on document management. HURIDOCS started Uwazi and is supporting dozens of human rights organisations globally to use the tool.

Uwazi | HURIDOCS

Read the user guide

Installation guide

Dependencies

Before anything else you will need to install the application dependencies:

and change some global settings:

$ npm config set scripts-prepend-node-path auto

Production

Install/upgrade procedure

  1. Download and unpack the latest stable code for production installs.
  2. Shutdown Uwazi if it is already running.
  3. $ cd uwazi.
  4. $ yarn install will download all node modules, it may take a while.
  5. $ yarn blank-state important note: the first time you run Uwazi, you will need to initialize the database with its default blank values. Do not run this command if you are upgrading existing projects as it will erase the entire database. Note that from this point on you need ElasticSearch and MongoDB running.
  6. $ ./install.sh [destination_path] if no destination_path is provided it will default to ./prod.
  7. Start the server with $ node [destination_path]/server.js.

By default, Uwazi runs on localhost on the port 3000, so point your browser to http://localhost:3000 and authenticate yourself with the default username "admin" and password "change this password now".

It is advisable to create your own system service configuration. Check out the user guide for more configuration options.

Development

If you want to use the latest development code:

$ git clone https://github.com/huridocs/uwazi.git
$ cd uwazi
$ yarn install
$ yarn blank-state

If you want to download the Uwazi repository and also download the included git submodules, such as the uwazi-fixtures, which is used for running the end-to-end testing:

$ git clone --recurse-submodules https://github.com/huridocs/uwazi.git
$ cd uwazi
$ yarn install

If the main Uwazi repository had already been cloned/downloaded and now you want to load its sub-modules, you can run

$ git submodule update --init

There may be an issue with pngquant not running correctly. If you encounter this issue, you are probably missing library libpng-dev. Please run:

$ sudo rm -rf node_modules
$ sudo apt-get install libpng-dev
$ yarn install

Development Run

$ yarn hot

This will launch a webpack server and nodemon app server for hot reloading any changes you make.

Webpack server

$ yarn webpack-server

This will launch a webpack server. You can also pass --analyzeto get a detailed info of the webpack build.

Testing

Unit and Integration tests

We test using the JEST framework (built on top of Jasmine). To run the unit and integration tests, execute

$ yarn test

This will run the entire test suite, both on server and client apps.

If the API tests timeout, the issue might be with mongodb-memory-server. See nodkz/mongodb-memory-server#204. Memory server explicitly depends on a version of MongoDB that depends on libcurl3, but Debian 10 and other OS's come with libcurl4 installed instead.

To fix this, update node_modules/mongodb-memory-server-core/lib/util/MongoBinary.js#70. Set exports.LATEST_VERSION = '4.3.3' or a similar new version.

End to End (e2e)

For End-to-End testing, we have a full set of fixtures that test the overall functionality. Be advised that, for the time being, these tests are run ON THE SAME DATABASE as the default database (uwazi_developmet), so running these tests will DELETE any exisisting data and replace it with the testing fixtures. DO NOT RUN ON PRODUCTION ENVIRONMENTS!

Running end to end tests require a running Uwazi app.

Running tests with Nightmare

$ yarn hot

On a different console tab, run

$ yarn e2e

Running tests with Puppeteer

$ DATABASE_NAME=uwazi_e2e INDEX_NAME=uwazi_e2e yarn hot

On a different console tab, run

$ yarn e2e-puppeteer

Note that if you already have an instance running, this will likely throw an error of ports already been used. Only one instance of Uwazi may be run in a the same port at the same time.

E2E Tests depend on electron. If something appears to not be working, please run node_modules/electron/dist/electron --help to check for problems.

Default login

The application's default log in is admin / change this password now

Note the subtle nudge ;)

Docker

Infrastructure dependencies (ElasticSearch, ICU Analysis Plugin and MongoDB) can be installed via Docker Compose. ElasticSearch container will claim 2Gb of memory so be sure your Docker Engine is alloted at least 3Gb of memory (for Mac and Windows users).

$ docker-compose up -d

About

Uwazi is a web-based, open-source solution for building and sharing document collections

http://www.uwazi.io

License:MIT License


Languages

Language:JavaScript 63.7%Language:TypeScript 31.8%Language:SCSS 4.2%Language:Shell 0.1%Language:HTML 0.1%Language:Dockerfile 0.0%Language:CSS 0.0%