Git Product home page Git Product logo

candidate-project-nodejs's Introduction

ZOOM+Care Candidate Code Challenge - NodeJS API

ZOOM+Care Logo

Welcome to the ZOOM+Care NodeJS API Candidate Code Challenge. If you are here you most likely have interest in joining the ZOOM+Care Software Engineering Team and asked to choose one of our software development challenges. If you came here on your own, you are welcome to explore the challenge and use it to sharpen your skills or prepare for future interviews.

The ZOOM+Care Candidate Code Challenges are intended to take between 1 and 2 hours to complete. This is not intended to be an extensive test of your programing skills or knowledge, but rather as a starting point for further conversations during the application process.

Instructions

This Candidate Code Challenge is geared toward developers with experience in JavaScript and NodeJS. The objective is to create an API that exposes several CRUD operations over HTTP for a predefined data schema. The data schema for this challenge is simple: A user (which is a writer) has posts, and each post has comments. Here are the basic requirements of the API:

  • Create a user.
  • Retrieve all comments associated with a user's post.
  • Update a post.
  • Delete a comment.
  • Allow Cross-Origin Resource Sharing (CORS) from any domain.
  • Provide simple validation and appropriate HTTP statuses in the response.
  • When performing a mutation, ensure that all incoming requests for those routes contain an authorization header. The value of this header can be any non-empty string. If the request does not contain a header of authorization, respond with the appropriate HTTP status code.

Project Dependencies and Structure

The HTTP server is created from Express.

The database is handled via LokiJS, which is, to quote their website, "A fast, in-memory document-oriented datastore for node.js, browser and cordova". In config/loki.js, the database is initialized in memory and a method is provided for retrieving the database connection. You may implement the data access layer using any frameworks and architecture you would like.

This project was generated via the Express Generator NPM dependency. You can reorganize routes, controllers, etc. as you see fit.

Developing

Ensure you have the latest LTS NodeJS and NPM versions installed. Preferred version is NodeJS v10.x and NPM v6.x.

# Install dependencies
npm install

# Run in development mode with `nodemon`
npm run dev

# Optionally, run directly with `node`
npm run start

Navigate to localhost:3001 on your machine and the index page should be accessible. All API endpoints should also be accessible from this URL and port.

Data Schema Reference

Here are some simple examples of the three data types used in this project. You can see the full data in the data folder.
User

{
  "id": 1,
  "name": "Leanne Graham",
  "username": "Bret",
  "email": "[email protected]",
  "address": {
    "street": "Kulas Light",
    "city": "Gwenborough",
    "zipcode": "92998-3874",
    "geo": {
      "lat": "-37.3159",
      "lng": "81.1496"
    }
  },
  "phoneNumbers": ["1-770-736-8031 x56442", "1-771-736-8032"],
  "website": "hildegard.org"
}

Post

{
  "userId": 1,
  "id": 1,
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
  "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}

Comment

{
  "postId": 1,
  "id": 1,
  "name": "id labore ex et quam laborum",
  "email": "[email protected]",
  "body": "laudantium enim quasi est quidem magnam voluptate ipsam \n skdfjb"
}

Steps to Complete

  • Create a Fork of the repository into your personal GitHub space.
  • Implement the API requirements as described above.
  • Create a Pull Request back to the original project.

candidate-project-nodejs's People

Contributors

sclarkson-zoomcare avatar

Watchers

 avatar  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.