This project is a spin off from HSL Map publisher, most of the logic used in this project was originally made for the Publisher. This project has been drifting away from the Publisher project, so we decided to make this project in to a whole separate repository.
Install dependencies:
yarn
Install pdftk
Start development server:
yarn start:hot
- Write CSS styles @ 72 dpi (i.e. 72 pixels will be 25.4 mm)
- Add components to
renderQueuefor async tasks (PDF is generated whenrenderQueueis empty) - Use SVG files with unique IDs and no style tags (Illustrator exports)
Server and REST API for printing components to PDF files and managing their metadata in a Postgres database.
Start Postgres:
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres
IMPORTANT:
Manually add a default row to the routepath_import_config table:
INSERT INTO "public"."routepath_import_config" ("name", "target_date", "status", "created_at", "updated_at") VALUES ('default', '2019-07-02', 'READY', DEFAULT, DEFAULT)
Start server:
PG_CONNECTION_STRING=postgres://postgres:postgres@localhost:5432/postgres yarn server
As soon as it is started, run the "Päivitä" function of the linjakarttageneraattori poikkileikkauspäivä to generate an actual poikkileikkauspäivä.
Start a Postgres Docker container:
docker run -d --name routemap-postgres -e POSTGRES_PASSWORD=postgres postgres
IMPORTANT:
Manually add a default row to the routepath_import_config table:
INSERT INTO "public"."routepath_import_config" ("name", "target_date", "status", "created_at", "updated_at") VALUES ('default', '2019-07-02', 'READY', DEFAULT, DEFAULT)
Build and start the container:
docker build -t hsl-routemap-server .
docker run -d -p 4000:4000 -v $(pwd)/output:/output -v $(pwd)/fonts:/fonts --link routemap-postgres -e "PG_CONNECTION_STRING=postgres://postgres:postgres@routemap-postgres:5432/postgres" -e "PG_JORE_CONNECTION_STRING=placeholder" -e "PG_JORE_CONNECTION_STRING_i2=placeholder" --shm-size=1G hsl-routemap-server
As soon as it is started, run the "Päivitä" function of the linjakarttageneraattori poikkileikkauspäivä to generate an actual poikkileikkauspäivä.
where fonts is a directory containing Gotham Rounded and Gotham XNarrow OpenType fonts.