/aurora

Dockerized Scaffolding for Node

Primary LanguageTypeScript

Docker Commands

  • Build image docker-compose build
  • Start image as container docker-compose up
  • Run psql inside the postgres container docker exec -it database psql -U postgres
  • Run tests docker exec -it webserver npm run test

PSQL Commands

  • list databases \l
  • create database: CREATE DATABASE koa_api;
  • switch to a database \c koa_api
  • show tables in the current schema \dt

Resources:

Todo

  • Add close() methods for db and cache
  • Allow shorthand HttpResponse construction
  • Investigate 'Bad Request' response on malformed JSON requests (probably koa?)
  • Have a more thoughtfull directory structure for the volumes in Docker
  • Investigate @koa/cors and when it's necessary
  • Investigate deploying only a Docker image that clones in all supporting files
  • Add an entrypoint.js type module for running migrations etc..
  • Maybe use GMT format for cookie.expires
  • Maybe allow nested routes
  • config -> settings, views -> pages, routes -> urls
  • Maybe allow ...args in DataShape field constraints

Unanswered Questions

  • How can database content be persistent accross image/container destruction?
  • When is database content destroyed, and where is it contained?
  • How and when should migration/seeding be performed?
  • What's the best way to dependency-invert knex?
  • What tools are available for automated semantic versioning?
  • What's a better interface than DataShape.test(), and how should you create instances of a DataShape?
    • Maybe use fits() or satisfiedBy()
    • What's a good way to separate boolean responses to those functions from error oriented ones?
  • How considerate should DataShape be to the idea that an adapter will make a table from it?
    • Probably not at all...
    • Does this mean that it should drop its constraints property altogether?