Hajk
A modern, full-featured OpenLayers based map viewer and editor
Install / Use
/learn @hajkmap/HajkREADME
Want to contribute?
Please refer to CONTRIBUTING.md.
New to Hajk and not a developer?
If you are a new user of Hajk, please visit our welcome page (Swedish only).
Looking for support?
You can easily reach out to our community using the Discussions on GitHub.
Live examples
The official, automatic build of the latest version can be found here: https://hajk-demo.netlify.app/.
For some real-life examples, see the following solutions:
- Halmstad municipality's map
- Kungsbacka municipality's map
- The City of Gothenburg's map
- The Gothenburg Region's map
- Varberg municipality's map
- Uddevalla municipality's map
Community extensions
Community extensions are additions developed by the community outside the scope of the core Hajk distribution. These can include anything from rewrites in other programming languages to customized integrations with specific business systems.
For a list of community extensions, please refer to this page.
Quick start (for admins)
Please refer to Hajk's official installation guide.
Quick start (for developers)
Note that Hajk consists of 3 applications: Client UI (which is the web map front end), Admin UI (which basically is a frontend for Client UI's configuration files) and a Backend service (the server application that provides the REST API consumed by the two UI applications).
Clone the repo
Clone the repository: git clone https://github.com/hajkmap/Hajk.git.
Get the Backend up and running
- In
hajkrepo dir, go toapps/backendand install dependencies:
cd apps/backend
npm install
- Review the settings in
.env. It's fine to leave the defaults. Note whichPORTis specified, by default it is3002. - Start the backend in development mode:
npm run dev
- Verify that the server is up and running by navigating to
http://localhost:3002. There's also a nice API explorer available onhttp://localhost:3002/api-explorer/.
Alternative approach: NodeJS backend in Docker
See Docker README for more information.
Launch the Client app
Now when Backend is up and running, it's time to start the Client UI (and optionally Admin UI).
- You must tell the Client app the location of the running Backend. The configuration is made by editing
apps/client/public/appConfig.json. Make sure thatmapserviceBaseis a valid URL to a running instance of the Backend (if you're using the NodeJS application and your Backend is running on port 3002, you should setmapserviceBaseto"http://localhost:3002/api/v2". - The client application resides inside
apps/client. Go there (apps/client) and install the dependencies and start by typing:npm i && npm start. - Verify that Client is running on
http://localhost:3000.
Launch the (optional) Admin app
This process is similar to the Client app.
- Set the correct URL to Backend by editing
apps/admin/public/config.json.
Map operations have moved to mapconfig so"url_map", "url_map_list", "url_map_create", "url_map_delete"needs to point toward"http://localhost:3002/api/v2/mapconfig...", the rest is the same as forclient/ - The admin application is located in
apps/admin. To get it running docd apps/admin && npm i && npm start. - Verify that Admin is running on
http://localhost:3001.
Deploying
The provided NodeJS backend comes with a built-in, optional static files server that allows you to deploy the Client and Admin applications through the Hajk's backend application (hence leverage the optional Active Directory connection to restrict access to e.g. the Admin UI app). For details, see this section in Backend's README.
