Koa postgres react nodejs to do app

Check it out


See the Repository



This project is a job interview task where I had to implement a sort of a to-do CRUD app using only koa modules, postgres and react. Even though the project is rather simple and straight forward, it took me about a week and a half to figure out all the bits and pieces. I took other people's work as a starting point, since I had no previous experience using these technologies or prior experience in building REST api at all, especially using JavaScript and its frameworks.

A very helpful nodejs module is nodemon. What it does, it basically reloads the server each time the code is changed (not always though, sometimes I had to reload it manually cuz of changes in server.js, nevertheless it is helpful in all other instances)


For troubleshooting the REST API of my app I had to use POSTMAN at some point. It is very helpful and flexible, you can tailor the request easily to see the behavior of the REST API server.

Main references are:

  • https://medium.com/@olinations/build-a-crud-template-using-react-bootstrap-express-postgres-9f84cc444438
  • https://medium.com/hackernoon/serving-react-and-koa-together-720ba6668298
  • https://www.youtube.com/watch?v=o7gVHMg_jdY

I am very grateful to these guys. They really helped me to get up to speed with all this modern JavaScript magic, I loved it.

These are not the only places that I used as a reference. I scavanged across multitude of sources before I understood how it is done.

The trello cards really got some beating, each comment here contains a link to some article about react, koa or misc problems.


I had to figure out migrations, React Components, koa router, koa mounts and how to build a react project, serve it statically after build. CORS (had no idea what that was before), koa-routes etc, etc... This was a great experience, I learned a lot, this stuff is now clear to me.




Full reference for the stuff I had to go through:

  • https://hackernoon.com/dont-install-postgres-docker-pull-postgres-bee20e200198
  • https://www.youtube.com/watch?v=xpfgkIl8oDU
  • https://www.youtube.com/watch?v=ufdHsFClAk0
  • https://www.youtube.com/watch?v=z84uTk5zmak
  • https://koajs.com/
  • https://github.com/db-migrate/node-db-migrate/blob/master/lib/interface/seederInterface.js#L1-L36
  • https://medium.com/jtribe/node-js-in-2018-full-stack-tutorial-with-koa-react-redux-sagas-and-mongodb-14a7efaee4d4
  • https://mherman.org/blog/building-a-restful-api-with-koa-and-postgres/
  • https://github.com/db-migrate/node-db-migrate/issues/292
  • https://medium.com/hackernoon/serving-react-and-koa-together-720ba6668298
  • https://www.youtube.com/watch?v=WT67-OETeGU
  • https://github.com/matthew-andrews/isomorphic-fetch/issues/34
  • https://medium.com/@olinations/build-a-crud-template-using-react-bootstrap-express-postgres-9f84cc444438
  • https://restfulapi.net/rest-put-vs-post/
  • https://programmer.group/collation-of-common-knowledge-points-in-koa-framework.html
  • https://levelup.gitconnected.com/react-crud-app-without-and-with-redux-da4cd87f2eab
  • https://thinkster.io/tutorials/react-redux-crud-api
  • https://youtu.be/nfIEDzMJCQo
  • https://medium.com/jtribe/node-js-in-2018-full-stack-tutorial-with-koa-react-redux-sagas-and-mongodb-14a7efaee4d4
  • https://github.com/brianc/node-pg-pool
  • https://medium.com/hackernoon/serving-react-and-koa-together-720ba6668298
  • https://github.com/db-migrate/node-db-migrate/blob/master/lib/interface/seederInterface.js#L1-L36
  • https://www.freecodecamp.org/news/demystifying-reacts-server-side-render-de335d408fe4/
  • https://blog.logrocket.com/why-you-should-render-react-on-the-server-side-a50507163b79/
  • https://www.sitepoint.com/asynchronous-apis-server-rendered-react/
  • https://medium.com/@evheniybystrov/full-stack-react-app-from-scratch-part-2-classic-rest-api-b0279bdd8d24
  • https://pusher.com/tutorials/consume-restful-api-react
  • https://dev.to/oktadev/build-a-simple-crud-app-with-python-flask-and-react-30k5
  • https://www.valentinog.com/blog/drf/
  • https://mherman.org/blog/building-a-restful-api-with-koa-and-postgres/
  • https://www.mfosullivan.com/rest-api-node-koa-postgresql/
  • https://habr.com/ru/post/307148/
  • https://habr.com/ru/post/310302/
  • https://www.youtube.com/watch?v=0eGA1zYvyeU
  • https://github.com/koajs/koa
  • https://www.youtube.com/watch?v=z84uTk5zmak
  • https://medium.com/hackernoon/serving-react-and-koa-together-720ba6668298
  • https://blog.logrocket.com/setting-up-a-restful-api-with-node-js-and-postgresql-d96d6fc892d8/
  • https://mherman.org/blog/postgresql-and-nodejs/
  • https://github.com/danneu/koa-skeleton
  • https://mherman.org/blog/building-a-restful-api-with-koa-and-postgres/
  • https://www.mfosullivan.com/rest-api-node-koa-postgresql/
  • https://linuxhint.com/postgresql-nodejs-tutorial/
  • https://node-postgres.com/features/pooling
  • http://zetcode.com/javascript/nodepostgres/
  • https://stackoverflow.com/questions/3582552/postgresql-connection-url
  • https://mherman.org/blog/building-a-restful-api-with-koa-and-postgres/
  • https://github.com/koajs/examples
  • https://github.com/koajs/koa/wiki
  • https://kir9819.github.io/Docs/docs/[en]node_koa_postgre/
  • https://hackernoon.com/dont-install-postgres-docker-pull-postgres-bee20e200198
  • https://github.com/salsita/node-pg-migrate