Installation
Installing with Docker
/
will always refer to the repo’s root directory
-
Clone the repo
git clone https://github.com/NASA-AMMOS/MMGIS
-
From within
/
npm install
Building
To build the Docker image, run: docker build -t <image tag> .
Preparing
.env
- Copy
/sample.env
to.env
cp sample.env .env
-
Open
.env
and update the following:DB_NAME=<name> DB_USER=<user> DB_PASS=<password>
From the install example:
DB_NAME=db DB_USER=postgres DB_PASS=<POSTGRES_PASSWORD (see below)>
- Set all the ENV variables in
.env
. More information about the ENVs can be found here.- If using the postgis/postgres image from within the docker-compose.yml, set the ENV
DB_NAME
to the name of the service (in this casedb
)
- If using the postgis/postgres image from within the docker-compose.yml, set the ENV
docker-compose.yml
This repo contains a /docker-compose.sample.yml
file that defines a service for the application and a PostgreSQL database with PostGIS installed
- Copy this file to a
docker-compose.yml
. - In the
db
service indocker-compose.yml
, set thePOSTGRES_PASSWORD
environment variable and use this for MMGIS’sDB_PASS
ENV value. - Fill out the other
environment
variables within thedocker-compose.yml
as well. - To run MMGIS in a container, you need to create a directory on the host machine and map this to a directory in the container.
- On the host machine, create a
Missions
directory and copy the contents of./Missions
to your directory. - Via the docker-compose.yml, map this directory to
/usr/src/app/Missions
in the container. For example, if the host directory is./Missions
, the volume mapping would be- ./Missions:/usr/src/app/Missions
- On the host machine, create a
- Note, the
/docker-compose.sample.yml
includes optional STAC and TiTiler services. If any of them are unwanted, they can be removed from the docker-compose-yml and their respective.env
variableWITH_{service}
can be set to false.
Running
Run: docker-compose up -d
First Time UI Setup
-
Setup the admin account:
- In your browser, navigate to
http://localhost:8888/configure
- Sign up for an Administrator account (The Administrator account is always the first user in the database and you are only prompted to create an Administrator account if there are no other users)
- In your browser, navigate to
-
Now sign in with you Administrator credentials
-
Click
NEW MISSION
Enter a new mission name and clickMAKE MISSION
Optional: (Use the mission name"Test"
(case-sensitive) to make the sample mission)
Navigate to http://localhost:8888
.
See the configuration documentation for more information on how to use the configure page to customize and add data to MMGIS.
Installing Without Docker
System Requirements
-
Install the latest version of Node.js v20.11.1+.
- Install PostgreSQL v16+. Detailed install instructions for all platforms.
- Install PostGIS 3+. From the above install, you can use the ‘Application Stack Builder’ to install PostGIS or the default PostGIS install instructions for all platforms.
- Make a new PostgreSQL database and remember the user, password and database name. Use ‘psql’ or the ‘SQL Shell’ to log into Postgres. It will prompt you for the username and password made during the install.
Python Environment
- Install micromamba 2+
Windows:
- In powershell run:
Invoke-Expression ((Invoke-WebRequest -Uri https://micro.mamba.pm/install.ps1).Content)
- Initialize the shell with:
micromamba shell init --shell cmd.exe --root-prefix=your\path\to\mamba
- In a command window in the MMGIS root directory run:
micromamba env create -y --name mmgis --file=python-environment.yml
- If you encounter an error like:
..\mamba\condabin\micromamba"' is not recognized as an internal or external command, operable program or batch file.
, then copy themamba.bat
file in that directory tomicromamba.bat
- If you encounter an error like:
- Confirm the installation and initialization went well with:
micromamba run -n mmgis gdalinfo --version
- Activate the environment before running
npm start
micromamba activate mmgis
Legacy (without micromamba):
- GDAL 3.4+ with Python bindings (Windows users may find these helpful)
- Python >=3.10 and <3.13
- From root MMGIS directory:
python -m pip install -r python-requirements.txt
- Ensure your
PROJ_LIB
system ENV points to the proj.db install through python. - Note: MMGIS expects and uses the command
python
only and notpython3
or variations.
- In powershell run:
Setup
/
will always refer to the repo’s root directory
-
Clone the repo
git clone https://github.com/NASA-AMMOS/MMGIS
-
From within
/
npm install
-
Copy
/sample.env
to.env
cp sample.env .env
-
Open
.env
and update the following:DB_NAME=<name> DB_USER=<user> DB_PASS=<password>
From the install example:
DB_NAME=mmgis DB_USER=postgres DB_PASS=<password>
-
Run
npm run build
to bundle up the code (first time or if there are any changes) -
Go into /configure and run
npm install
followed bynpm run build
to build the beta configuration site. -
Go back to the root
/
directory -
Run
micromamba activate mmgis
orpython -m pip install -r python-requirements.txt
(if not using python environments) -
If using adjacent-servers (titiler, stac, …) make
.env
files from the samples within the/adjacent-servers/{servers}/
directory. -
Run
npm run start:prod
-
Setup the admin account:
- In your browser, navigate to
http://localhost:8888/configure
- Sign up for an Administrator account (The Administrator account is always the first user in the database and you are only prompted to create an Administrator account if there are no other users)
- In your browser, navigate to
-
Now sign in with you Administrator credentials
-
Click
NEW MISSION
Enter a new mission name and clickMAKE MISSION
(Use the mission name"Test"
(case-sensitive) to make the sample mission)
Go to http://localhost:8888
to see the Test
mission
Note: The development environment (npm start
) and only the development environment uses two port numbers 8888
and 8889
(by default) — the latter for the main site and the former for the ancillary pages (such as /configure
and /docs
)
Scripts
Production
-
Run
npm run build
to bundle up the code (first time or if there are any changes) -
Run
npm run start:prod
Development
- Run
npm start
Test
- Run
npm run test
Note: Jest has just been added in v2.0.0 and test suites are still very limited