Project Structure

There are 2 major groups of the project.

  • The Dashboard, under src/dashboard/, which is the front and backend for the Dashboard site.
  • The Command Line Interface, under src/cli/, which is used to insert the initial data into the database.

Dashboard

The Dashboard has 6 important folders under src/dashboard.

data

  • Contains test data for unit testing.

interfaces

  • Contains are type annotations for project.
  • Note: These files have to be the same as the ones in `src/cli/interfaces` which can be done via hard symbolic link.

server

  • Code for the node.js server.
  • Inside the server folder are the following.
    • controllers - Which are the actualy logic for an API endpoint
    • middleware - General purpose functions that are ran when a API endpoint is hit, for example making sure that a user is logged in, or making sure a user is a tagger.
    • models - Which are the Objects to set up some structure in the Database and make sure entries have some uniformity. Note: These files have to be the same as the ones in src/cli/src/models which can be done via hard symbolic link.
    • routes - Assign endpoints to a controller function. For example api/test would be mapped to the test function in the controllers folder.
    • utils - Utility functions.

site

  • Code for the frontend site.
  • Inside the site folder are the following.
    • pages - Which are the pages of the website. Note: Any page inside pages/auth/ will require the user to be logged in, this is ensured by the server.
    • components - Reusable components for the website such as the tagging form, or various buttons.

tests

  • Contains all unit tests. Each file must have the name *.test.ts in its name.

dist

  • Not on GitHub, but generated by TypeScript
  • Contains the compiled code of _server since the server is written in TypeScript.
  • Maintains the exact same structure as src/dashboard/_server but with all files as .js instead of .ts.

CLI

interfaces

  • Contains are type annotations for project.
  • Note: These files have to be the same as the ones in `src/dashboard/interfaces` which can be done via hard symbolic link.

src

  • Main code of the CLI. Its subfolders are

bin

  • Maps command name to function

commands

  • Command function that gets mapped to by bin

models

  • Note: These files have to be the same as the ones in `src/dashboard/src/models` which can be done via hard symbolic link.

utils

  • Utility functions