Skip to content

menkuichan/data-worker

Repository files navigation

data-worker

data-worker is a application for working with data from TMDb and putting it to database.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Download Node.js not lower than version 8.10, Yarn, Docker and MongoDB Docker image.

Clone

Clone this repo to your local machine using https://github.com/menkuichan/data-worker.git

Run database

Run your docker image with MongoDB.

docker run --name some-mongo -d mongo:tag

... where some-mongo is the name you want to assign to your container and tag is the tag specifying the MongoDB version you want.

... or run the make utility in the project directory.

make run-mongo

Declare environment variables in .env file

Create and add application configuration to .env file in the root of the project:

APP_PORT=3000
TMDB_API_KEY=YOURSECRETAPIKEY
DB_URI=mongodb://localhost:27017/super-enigma-db
TMDB_BASE_URL=https://api.themoviedb.org/3/

You should to register for an API key, click the API link from within your account settings page.

Installation

Use the package manager Yarn to install all the dependencies of data-worker.

yarn install

Available Scripts

In the project directory, you can run:

yarn start

Runs the app.

The app will reload if you make changes to the code.

Run Docker container with project and MongoDB

First, make sure that MongoDB is running. Then you need to build a docker image.

make build-image

In the end, run the docker container with server.

docker run -P -d --rm --env TMDB_API_KEY=YOURSECRETAPIKEY --name service-name --link db-name:db image-uri:image-version

... where service-name is the server name, db-name is the database name and so on.

... or run the following command:

make run-service

Stop Docker container with project and MongoDB

To stop the service use:

docker stop service-name

... or:

make stop-service

And to stop Docker container with MongoDB use:

docker stop some-mongo

... or:

make stop-mongo

Build With

  • Node.js - is a JavaScript runtime built on Chrome's V8 JavaScript engine.
  • MongoDB - is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.

License

License

MIT license

About

Node.js app for working with data

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors