Standalone
The FacilMap server runs on Node.js. To run the FacilMap server, the following dependencies are needed:
- You need to have a recent version of Node.js and npm installed.
- You need to create a database on one of the systems supported by Sequelize, it is recommended to use MySQL/MariaDB.
- When creating a MySQL/MariaDB database for FacilMap, make sure to use the
utf8mb4
charset/collation to make sure that characters from all languages can be used on a map. By default, MySQL/MariaDB uses thelatin1
charset, which mostly supports only basic latin characters. When you start the FacilMap server for the first time, the necessary tables are created using the charset of the database. - When using PostgreSQL, the PostGIS extensions must be enabled.
- When creating a MySQL/MariaDB database for FacilMap, make sure to use the
- It is recommended to run FacilMap as an unprivileged user.
Run the latest release
A bundled version of the FacilMap server is published on NPM as facilmap-server. To run it, run the following steps:
- If you don’t have a global NPM prefix set up yet, run
npm config set prefix ~/.local
. This will install npm packages into~/.local/bin
, rather than trying to install them into/usr/local/bin
. - Install facilmap-server by running
npm install -g facilmap-server
- Create a
config.env
file based onconfig.env.example
and to adjust the configuration. - Start the FacilMap server by running
~/.local/bin/facilmap-server dotenv_config_path=config.env
.
FacilMap will need write access to the directory ~/.local/lib/node_modules/.cache/facilmap-server
(or specify another directory in the CACHE_DIR
environment variable). All other files and directories can be read-only. To harden the FacilMap installation, make the whole installation folder owned by root, but create the cache directory and make it owned by the facilmap user.
Run the development version
To run the latest state from the FacilMap repository, run the following steps:
- Make sure that you have a recent version of Node.js, yarn and a database (MariaDB, MySQL, PostgreSQL, SQLite, Microsoft SQL Server) set up. (Note that only MySQL/MariaDB has been tested so far.)
- Clone the FacilMap repository.
- Run
yarn install
in the root folder of this repository to install the dependencies. - Run
yarn build
to create the JS bundles. - Copy
config.env.example
toconfig.env
and adjust the configuration. - Inside the
server
directory, runyarn server
. This will automatically set up the database structure and start the server.
You can also run yarn dev-server
, which will automatically rebuild the frontend bundle when the code is changed. See dev setup for more information.