Git Product home page Git Product logo

analyze-catalog's Introduction

Requirements

Node and npm

Get Started

  1. Clone this repo - git clone <repo_url> && cd <repo_name>
  2. Install dependencies - npm i
  3. Start the app - npm start
  4. Browse to localhost.8081

Endpoints

  • / - straight from catalog
  • /massaged - catalog processed and combined with additional json files
  • /massaged/json - download the massaged and combined json

Tools

  • node compare.js <old.json> <new.json> - compare two massaged json files semantically, ignoring order of links, contents, and subcontents.

Combining Extra JSON Files

  • Add the JSON file (must adhere to the structure) into data folder.
  • In index.js, require it.
const extraData = require('./data/extra.json');
  • In index.js, inside addAdditionalData(), concat the data.
const dataToAdd = manualData
    .concat(gogsData)
    .concat(handmadeData)
    .concat(extraData)
    .map(...);

End Result Structure

[
  language,
]

language = {
  code: 'en',
  name: 'English',
  englishName: 'English' || '',
  direction: 'ltr' || 'rtl',
  contents: [
    content,
  ]
}

// Resource for a language
content = {
  code: 'ulb',
  name: 'Unlocked Literal Bible',
  subject: 'Bible' || 'Bible stories' || 'Some other',
  description: 'Some text' || '',
  checkingLevel: '1' || '2' || '3' || '',
  links: [
    link,
  ],
  subcontents: [
    subcontent,
  ]
}

// Book/project of a resource
subcontent = {
  code: 'gen',
  name: 'Genesis',
  sort: 0,
  category: 'bible-ot' || 'bible-nt',
  links: [
    link,
  ]
}

// Same for both content and subcontent
link = {
  url: 'https://google.com',
  format: 'any',
  zipContent: 'any' || '',
  quality: 'any' || null,
}

Unit-Testing

  • Name test files <fileUnderTest>.test.js.
  • Put test files in __test__ folder.
  • Run npm test

analyze-catalog's People

Contributors

purpleguitar avatar vleong2332 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

analyze-catalog's Issues

Split into separate build and run jobs

Fix up analyze-contents job to not rebuild every night. Need to split into separate build and run jobs -- mount translations.json rather than add it to the container

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.