GithubHelp home page GithubHelp logo

astrovicis / takehome Goto Github PK

View Code? Open in Web Editor NEW

This project forked from baileex/tdd-node-shows

0.0 1.0 0.0 268 KB

Test Driven Development with Docker, Node.js, Postgres, and Knex.js

License: MIT License

Dockerfile 9.89% JavaScript 87.99% CSS 0.61% Pug 1.51%

takehome's Introduction

MIT License pipeline status

takehome-addresses

Table of Contents


About

takehome-addresses is a an example REST API developed with Docker, Node.js, PostgreSQL, and Knex.js.

See Test Driven Development with Node, Postgres, and Knex (Red/Green/Refactor) by Michael Herman for details.

Dockerized with the help of Bret Fisher's node-docker-good-defaults.

Modified by Max Howard for a special use case.

Installation

  1. You'll need Docker and docker-compose.
$ git clone [email protected]:Astrovicis/takehome.git && cd takehome
  1. Build Docker containers locally:
$ docker-compose up -d --build
  1. Run migrations & seed:
$ docker-compose exec node_app knex migrate:latest --env development
$ docker-compose exec node_app knex migrate:latest --env test
$ docker-compose exec node_app knex seed:run --env development
$ docker-compose exec node_app knex seed:run --env test

Usage

docker-compose up -d

Go to http://localhost to see the Express app.

Tests

After you've spun up the container:

docker-compose exec node_app mocha --exit

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Credits

Productionification Thoughts

What I've learned

  • Docker compose is really useful
  • Null prototype objects should be null prototype objects as the req.body
  • Joi is great and I miss it

Things I would add/change with more time

  • Add Joi validation
  • Change db/queries.js to services/addresses.js
  • Make more secure the postgres container (nondefault passwords), especially with open port
  • De-hardcode the table columns queried by getMatching, whether with objection or knex

takehome's People

Contributors

sophiabrandt avatar astrovicis avatar

Watchers

James Cloos 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.