Giter Site home page Giter Site logo

daslab-api-test's Introduction

DasLab backend test

Here is a simple backend test to be part of the DasLab backend/API team. You do not need to finish the assigment, take about 1h if you don't get to the end dont worry, just skip to task 3 and give your opinion and we can discuss where you got and blockers during the interview.

Test paramters

  • Fork then install the project localy (npm i)
  • Make your fork private then share it with @etiennea
  • Have a look around the /api-docs
  • Check src/routes.ts
  • Check the corresponding controllers in src/controllers
  • Task1: Add a new model with create, update, delete routes for 'testing locations', you must be logged in as a user and they must belong to a user. Testing locations could have properties like longitude, latiture and some fields like contact addess.
  • Task2: Make e2e tests and unit tests
  • Task3: Write a few sentences on what you would do different or better if you had more time and give your thoughts on the tech stack and file structure. Feedback on the test is also useful.

What we will look at

  • File structure, code organisation
  • Commits, fequency & commit names

Documentation & Resources

How it works

All files are in src, first the app loads bootstrap, where it loads and express app, with logger, middleware and router. Router is a custom router I developed for SpottyEgg Ltd. All the routes are in routes.ts and explanations are there on how to use this.

Conventions

All routes call a controller, every controller should have a test. Models are in the entities folder. Controllers should call services that have the business logic and call the ORM and the models. No logic should be in the controllers.

Commits

We start commit names with, feat-12: infra-12: bug-12: then a short description (when there is no number, there is no number, number comes from taskboard card). In the future it will be feat-123: that will link to the correct story.

Test coverage

We try keep it above 90%!

NPM Scripts

  • ๐Ÿ”ฅ start - run product server (build)
  • ๐Ÿ”ง build - build typescript files for above
  • ๐Ÿ”ง dev - run development server via bastion host
  • ๐Ÿ”ฅ ts-start - run as typescript
  • ๐Ÿ“ฑ test:unit - run all unit tests
  • ๐Ÿ“ฑ test:coverage - run all unit tests + test coverage report
  • ๐Ÿ”ง db:migration - shortcut create a migration file
  • ๐Ÿ”ง db:entity - shortcut create an entity file

daslab-api-test's People

Contributors

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