Skip to content

dawid-drelichowski/movie-info

Repository files navigation

Web movie search engine Build Status tested with jest

movie-info-pwa.firebaseapp.com - simple Movie DB API and React based movie search engine.

Requirements

  • Node.js version 6.0.0 or higher.
  • Movie DB API key. How to apply for an API key? Answer can be found here in "How do I apply for an API key?" section
  • Optionally Yarn as alternative to NPM package manager.

Installation

Copy config.json.dist to config.json file.
Put the Movie DB API key under movieDb.apiKey property in config.json file.
Depending on preferred package manager execute yarn install or npm install command.
There is no build assets version attached with this repository. To build them run npm run build or yarn run build.

Usage

Run public/index.html in favorite browser. Consider only last two versions of major browsers are supported.

Tests

Based on Jest and Enzyme.

Command: npm test or yarn test

Development

To rebuild assets every time they change execute npm run build:dev or yarn run build:dev.
There is a better way: npm run watch or yarn run watch command will continue running in terminal and watch all relevant files for changes.
Webpack will then automatically recompile assets when it detects a change.
It's possible to use Webpack DevServer. To start it use npm run start or yarn run start
To specify a port number to listen for requests on, modify webpack.config.babel.js
Default server port is 3000.

Minified (so called "production") version of assets can be build with npm run build or yarn run build.

NPM scripts

Available NPM or Yarn scripts:

  • npm run build or yarn build combine related scripts/styles and minimizes them with Webpack.
  • npm run build:dev or yarn build:dev combine related scripts/styles with Webpack.
  • npm start or yarn start runs Webpack DevServer.
  • npm run lint or yarn lint runs ESLint source code check.
  • npm test or yarn test runs tests.
  • npm run watch or yarn watch runs combination of related scripts/styles in Webpack's watch mode.