thinkWhere / DMIS

Disaster Management Information Service
4 stars 1 forks source link

DMIS

Disaster Management Information Service

Getting Started

The DMIS application is split into a client and server structure. The client can be run independently of the server code to make front-end development easier.

Dependencies

Python 3.6

You need to have Python 3.6 installed in your development environment. Python 3 install instructions are here

NodeJS

You must have nodejs installed to develop and run the app, locally. Get install from here

Verify that you are running at least node 6.9.x and npm 3.x.x by running node -v and npm -v in a terminal/console window. Older versions produce errors, but newer versions are fine.

Getting Started with Server Development

All server development is done with Python

Environment vars:

To avoid saving credentials in the repository, the following environment variables must be set up locally or on the deployment environment:

DB migrations

We use Flask-Migrate to create the database from the migrations directory. Create the database as follows:

python manage.py db upgrade

Create migration scripts when DB models have been updated as follows:

python manage.py db migrate

Set-up development environment

To develop on the application:

Running locally

Getting Started with Client Development

Set-Up

From the command line navigate to the root client directory and run npm install:

cd client
npm install

Running the app

DMIS Angular Client

This project was generated with Angular CLI version 1.1.1.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

Testing the app

TODO

Dev Ops

The DMIS app is deployed to AWS within a Docker container. It is possible to run and test the app locally within a docker container, as follows: