Skip to content

TaiBIF/camera-trap-api-2020

Repository files navigation

camera-trap-api

Setup the develop environment with docker-compose

docker-compose for development contains:

  • server
  • redis
  • mongo
  • mongo-express (mongo client)

1. perpare env

create .env file

$ cp dotenv.sample .env

2. docker build

$ docker-compose build

3. run service

$ docker-compose up

Setup the develop environment with npm

1. Clone repository

# host
$ git clone [email protected]:TaiBIF/camera-trap-api.git
$ cd camera-trap-api
$ npm install

2. Install redis server

We use a task queue based on redis.

$ brew install redis

3. Install libraries

We use gm, so that we need install graphicsmagick or imagemagick.

$ brew install graphicsmagick

4. Running it locally

$ npm start

Commands

Create collections and indexes of all models.

$ node . -c

Insert database default data.

Don't run this command twice.

$ node . -i

Create MediaConvert job template.

Please remove the old template by yourself.

$ node . -m

Update annotation time of all projects.

Update 'latestAnnotationTime' and 'oldestAnnotationTime' of all projects.

$ node . -u

Branching strategy

  1. master: main development branch. No CI workflow connected.
  2. dev: Merge into master when ready.
  3. feature/[title]: feature working branch. Will merge into dev when complete. Should be deleted once merged into dev.
  4. prod: production version.

Local Develop By Docker

start container

docker-compose up

Note

Releases

No releases published

Packages

No packages published