Project Structure

The layout of your API
Project Structure
  • Certs

    • Your public / private keypair for generating JWT tokens

  • Connections

    • This holds your database connection as well as an S3 connection (if you need one)

  • Controllers

    • Each top level model (table) has its own folder.

REST API Controllers
  • Middleware

    • This is the middleware to decrypt auth tokens, and do whatever else you need.

    • There is a file called hook.js where you can put whatever you want in there. It's already wired up to get called by each api

  • Models

    • These are your database models

  • Routes

    • These are your api routes. There is one file per database model

  • Test

    • These hold simple tests for your API

  • Utils

    • There are a few utility functions in here including some nifty CRUD operations on S3 objects

      • You can use S3, Wasabi, Minio, or any other S3 api