The FacilMap server is written in node.js (opens new window). 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 (opens new window), it is recommended to use MySQL/MariaDB. When creating a database for FacilMap, make sure to use the
utf8mb4charset/collation to make sure that characters from all languages can be used on a map. By default, MySQL/MariaDB uses the
latin1charset, 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.
- 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 (opens new window). 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
- Install facilmap-server by running
npm install -g facilmap-server
- Create a
config.envfile based on
config.env.example(opens new window) and to adjust the configuration.
- Start the FacilMap server by running
FacilMap will need write access to the directory
~/.local/lib/node_modules/facilmap-server/cache. 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 (opens new window), run the following steps:
- Make sure that you have a recent version of Node.js (opens new window), yarn (opens new window) 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 (opens new window).
yarn installin the root folder of this repository to install the dependencies.
yarn buildto create the JS bundles.
config.envand adjust the configuration.
- Inside the
yarn 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.