GithubHelp home page GithubHelp logo

mw-solution's Introduction

Assignment

The system needs a basic API to handle posts.

Create an api using Node.js, the user of the api should be able to

  • Get all posts
  • Get all posts for a specific impacter
  • Get a post by id
  • Update a post
  • Delete a post

We have provided a basic setup with a PostgreSQL database that has a basic schema and is populated with data. Feel free to update the schema or exchange any framework that is part of the initial setup if you think that is necessary.

If you feel you have the time, you can also add so the user can create a new post by uploading an image to the API.

Make sure to write down what you would have done if you had more time, and submit it together with the rest of the assignment.

Getting started

To help you with the setup we have provided a PostgreSQL database that runs in Docker. To use this you need to have Docker and Node installed on your computer and then run these commands in your terminal.

  1. Open this folder in your terminal
  2. Run docker-compose up -d
  3. Run npm i
  4. Run npm run init-db to setup the database and populate it with data. You can find the database definition in the migrations folder.

If you want to run the database without using docker you will have to update the knexfile.js file with the connection information for your database setup and then run npm run init-db to populate the database.

When you are done you can run docker-compose down to take down the database.

Dev

Run npm run dev to start nodemon with index.js

mw-solution's People

Contributors

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