Git Product home page Git Product logo

attribution-generator-api's Introduction

Attribution Generator API

An API for generating attribution hints for images from Wikipedia and Wikimedia Commons.

Build Status

Prerequisites

You will need a few things to get started:

Configuration

All of the application's configuration is read from environment variables. If a .env file is present in the current working directory, the application reads it via dotenv when starting.

For a quick start in development, just copy .env.test and update its values:

cp .env.test .env

In case you need to generate secure app secrets, run scripts/gen-secret.

Getting started

Install JavaScript dependencies:

yarn install

To start the server and restart it on file changes:

yarn watch

To simply start the server without restarts:

yarn start

then connect to localhost:8080 (and any API endpoint in there) to use the app.

To bind to a different port start the app with

PORT=9000 yarn start

Development tasks

We use npm scripts for development-related tasks:

  • Run linting: yarn lint, to autocorrect issues yarn lint --fix
  • Run tests: yarn test, to start in watch mode yarn test --watch
  • Generate / update the API documentation: yarn run apidoc

Debugging

You can debug this application with ndb by running yarn debug. Set break points in the pop-up window and run the test file in the terminal tab of the pop-up window.

In the debug window, run the tests within the supplied terminal using:

yarn debugtest

This lets all test run sequentially to avoid concurrency issues.

It can be useful to run tests with the DEBUG flag enabled in order to get more information on errors:

DEBUG=true yarn debugtest

Documentation

You can open http://localhost:8080/docs to browse the API documentation or http://localhost:8080/swagger to see the raw openapi.json output to be used in other tools.

Resources

The app communicates with the Wikimedia and Wikipedia APIs:

attribution-generator-api's People

Contributors

juffel avatar klappradla avatar manicki avatar pmeinhardt avatar tessi avatar

Watchers

 avatar

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.