This guide walks through running AMR GeoMapper on your local machine using the included Express development server.
- Node.js v18 or later
- npm (included with Node.js)
- Clone the repository and install npm the necessary node packages.
git clone <repository-url>
cd AMR-Geo-Mapper
npm install- Start the server locally.
node server.js- In a browser navigate to http://localhost:3000
The repository includes a demo dataset so you can start exploring right away. The demo files are:
| File | Path | Description |
|---|---|---|
| Data file | public/data/demo/bvbrcEcoli_obs.jsonl |
Sample JSONL dataset of E. coli genomes from BV-BRC |
| Configuration | public/config/demo/config-ecoli-obs.json |
Config file that defines filters, chart options, and the data file path |
| Taxonomy tree | public/config/demo/taxon-ecoli-obs.json |
Taxonomy hierarchy for the species selection modal |
The JSONL data file contains one JSON object per line, where each object represents a genome record. Each record contains scalar metadata (country, species, etc.) and an observations array of gene observation objects. See the Data API Reference for the record schema.
By default, public/index.html is already configured to use the demo config and taxonomy files, so no changes are needed to get started.
AMR GeoMapper uses Rollup to bundle all ES modules into a single file. Run:
npm run buildThe wrapper script ./utilities/build does the same thing and can be run from any directory.
Note: Rollup and its plugins are development dependencies, so building requires a full
npm install. If you installed withnpm install --omit=dev, the build tooling will not be present.
This produces two files:
| Output | Description |
|---|---|
public/dist/agm.js |
Unminified ES module bundle |
public/dist/agm.min.js |
Minified ES module bundle (used in production) |
The entry point for the bundle is public/entry.js, which imports the <amr-geo-mapper> and <csv-upload-button> web components.
Note: You must rebuild after any changes to files under
public/.
Development mode (auto-restarts on server file changes):
npm run devStandard mode:
node server.jsBoth start an Express server that:
- Serves static files from
public/ - Exposes a
POST /dataendpoint for querying the JSONL dataset
Open http://localhost:3000 in your browser. You should see the AMR GeoMapper map interface with a taxonomy selection modal.
If the map loads but shows no data, verify:
- The JSONL data file exists at
public/data/demo/bvbrcEcoli_obs.jsonl. - The config file at
public/config/demo/config-ecoli-obs.jsonhasdataAPI.urlset tohttp://localhost:3000/data. - The
config-urlandtaxonomy-infoattributes inpublic/index.htmlpoint to your config and taxonomy files.
The <amr-geo-mapper> web component is configured through two HTML attributes set in public/index.html:
config-url— URL to the JSON configuration file (e.g.,http://localhost:3000/config/demo/config-ecoli-obs.json)taxonomy-info— URL to the taxonomy tree JSON file (e.g.,http://localhost:3000/config/demo/taxon-ecoli-obs.json)
To use a different dataset, create new config and taxonomy files under public/config/ and update these attributes in index.html.
See the Configuration Reference for a full description of all config options.
The project includes a .env file in the root directory with the server port:
PORT=3000
You can change the port by editing this file. It defaults to 3000 if not specified.
- Configuration Reference — customize map options, filters, and chart behavior
- Web Integration — embed AMR GeoMapper in another web project
- Data API Reference — implement a custom backend