Skip to content
Zaen edited this page Jul 27, 2021 · 7 revisions

Technologies Used

  • Docker

Node

(for the exhaustive list of packages please refer to package.json)

Source

Docker

Two containers are defined in docker-compose.yml: MIST-backend and MIST-db.

  • MIST-backend is synced with src, and MIST-db is built with the postgres docker image. The two are connected with an internal docker bridge.
  • Docker is instructed to ignore the node_modules folder, so on the host machine there is no node_modules folder.

Express

  • server.js handles initialization (cors & session).
  • route.js sets up the routes with API.
  • The API files serves as a level of abstraction between HTTP requests and DB, although at this point the req object is requested by the DB methods. (A potential next step would be changing the parameter from 'req' to {'user', 'email', ...etc})

DB

  • All the methods contain pure SQL queries without an ORM. Instead of structuring it like a class similar to ORM, we went with exporting all the functions one by one. The schemas of all the data can be found in the setup script inside scripts.

  • Some of the files are named with numbers so when Docker initializes the DB the tables are initialized in the correct order.

  • The configuration file to connect to the DB is dbconfig.js.

Clone this wiki locally