Go to file
Pau 2f490365fd add env variables support 2023-01-09 10:06:34 +01:00
models add env variables support 2023-01-09 10:06:34 +01:00
.gitignore add env variables support 2023-01-09 10:06:34 +01:00
README.md remove testing code, updated readme, updated formatter 2022-12-19 14:34:39 +01:00
index.js Logging changes 2022-12-20 10:50:29 +01:00
package-lock.json add env variables support 2023-01-09 10:06:34 +01:00
package.json add env variables support 2023-01-09 10:06:34 +01:00

README.md

Floriday

Requires Node.js v14.x.x or higher.

The Floriday service project should perform the following tasks:

  1. Create / mantain the table structure to allow the storage of the data provided by the Floriday API. This is done using the Sequelize ORM.
  2. Query the Floriday API and store the data in the database. This is done using the node-fetch package.
    2.1. The data is requested every minute, but only the data that has changed is stored in the database. This is done using the Sequelize ORM and storing the data as it is received from the API, so it can be compared with the previous data.

Guidelines

  • In case a new model is created, it should follow the following structure:

  • /models

    • index.js
    • foo.js

Foo.js

import { Sequelize } from "sequelize";

const bar = {
  barCharacteristicOne: {
    type: Sequelize.INTEGER,
  },
  barCharacteristicTwo: {
    type: Sequelize.STRING,
  },
  barCharacteristicThree: {
    type: Sequelize.STRING,
  },
};

export default (sequelize) => {
  const Foo = sequelize.define(
    "FDfoo",
    bar,
    {
      timestamps: false,
      freezeTableName: true,
    }
  );
  return Foo;
};

Index.js

import foo from "./foo";

let models = {
   bar: foo(sequelize),
}; 

To install dependencies:

npm install

To run:

npm start