Giter Club home page Giter Club logo

job-service's Introduction

NYPL Job Service

Build Status Coverage Status

This package is intended to be used as a Lambda-based Node.js/PHP Job Service using the NYPL PHP Microservice Starter.

This package adheres to PSR-1, PSR-2, and PSR-4 (using the Composer autoloader).

Requirements

Homebrew is highly recommended for PHP:

  • brew install php71
  • brew install php71-redis

Installation

  1. Clone the repo.
  2. Install required dependencies.
    • Run npm install to install Node.js packages.
    • Run composer install to install PHP packages.

Configuration

Various files are used to configure and deploy the Lambda.

  • .env - Lambda configuration common across deployments
  • package.json - See "scripts" section for environment specific configuration
  • ./config/[environment].env - Deployment specific environmental variables

Usage

Process a Lambda Event

To use node-lambda to process the sample API Gateway event in event.json, run:

npm run test-create-job

Run as a Web Server

To use the PHP internal web server, run:

php -S localhost:8888 -t . index.php

You can then make a request to the Lambda: http://localhost:8888/api/v0.1/jobs.

Swagger Documentation Generator

Create a Swagger route to generate Swagger specification documentation:

$service->get("/swagger", function (Request $request, Response $response) {
    return SwaggerGenerator::generate(__DIR__ . "/src", $response);
});

Deployment

Travis CI is configured to run our build and deployment process on AWS.

Our Travis CI/CD pipeline will execute the following steps for each deployment trigger:

  • Run unit test coverage
  • Build Lambda deployment packages
  • Execute the deploy hook only for development, qa and master branches to adhere to our node-lambda deployment process
  • Developers do not need to manually deploy the application unless an error occurred via Travis

job-service's People

Contributors

nonword avatar

Stargazers

Salahuddin Hairai avatar

Watchers

Stephen Tiberius Schor avatar Josh Hadro avatar Anthony avatar Kristopher Kelly avatar Kevin Friedman avatar Sean Redmond avatar James Cloos avatar Edwin Guzman avatar Greg Kallenberg avatar David Michaels avatar Ho-Ling Poon avatar Keith Bauer avatar  avatar Brett Richter avatar KP avatar Crystal Ngai avatar Jay Haque avatar Alexander Duryee avatar Stephen Betts avatar Diego Cohen avatar Sarang Joshi avatar  avatar Jobin Thomas avatar Jonathan Smith avatar Mike Benowitz avatar  avatar  avatar  avatar ricardo galvez avatar Natalie Tschechaniuk avatar Jeff Croyle avatar  avatar  avatar

Forkers

holingpoon cxyac

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.