GithubHelp home page GithubHelp logo

agreena-code-challenge's Introduction

recruitment-node-private

Installation

  • Install NodeJS lts or latest version

  • Install Docker

  • In root dir run npm install

  • In root dir run docker-compose up to setup postgres docker image for local development

  • Create a .env file with the content from .env.test

Running the app

  • To build the project, run npm run build
  • To start the project, run npm run start

Application runs on localhost:3000 by default.

Migrations

Migration scripts:

  • npm run migration:generate --path=moduleName --name=InitialMigration - automatically generates migration files with schema changes made
  • npm run migration:create --path=moduleName --name=CreateTableUsers - creates new empty migration file
  • npm run migration:run - runs migration
  • npm run migration:revert - reverts changes

Small code exercises

  1. Please write a function to transform array to containing number and strings.

    • e.g ['super', '20.5', 'test', '23' ] -> ['super', 20.5, 'test', 23 ]
  2. Please write a function to return an array of all .csv files in folder /files

  3. Please write a function to return if a string contains a digit

    • e.g 'test-string' -> false
    • e.g 'test-string23' -> true

Farms Task - API

Setup

  • Use created app
  • Free to add additional packages
  • Use existing user authentication
  • Make sure all endpoints are only accessible for authenticated users

Requirements

General

  1. Coordinates can't be changed manually have to be populated automatically based on the address
  2. Need to have test

Model

  1. User should have following properties: address & coordinates.
  2. Farm should belong to specific user & have following properties: name, address, coordinates, size (e.g 21.5) & yield (e.g. 8.5)

API

Add API that supports following requirements:

  • There should be versioning endpoints (f.e. /api/v1/..)

  • As a user I want to be able to manage (create/update/delete) my own farms

  • As a user I want to be able to retrieve a list of all farms of all users.

    • The list should contain following properties:

    • The user should be able to get list sorted by

      • name (a to z)
      • date (newest first)
      • driving distance (closest first)
    • The user should be able to get list filtered by

      • outliers (Boolean) (outliers = the yield of a farm is 30% below or above of the average yield of all farms).

Seed

  • Add seed that will create 4 users and 4 farms each.



agreena-code-challenge's People

Contributors

i-mostafa 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.