Overall structure

ROQ One Backend is placed in the /backend folder of the mono-repository that you can find on Github: roqtech/roq-one. In this directory, you’ll see several sub-directories and files:

Directory

Content

backend/

Root directory of ROQ One Backend. The files are explained below.

backend/data

The data-directory contains CSV files which represent your “seed” or “demo” data.

backend/graphqlDocs

Generated documentation of your GraphQL API. Read more about this here: GraphQL API doc

backend/src

Source directory of your application. All directories are explained below.

backend/test

End-to-end tests

Root directory backend/

Directory

Content

.editorconfig

This file makes your IDE compatible with the used coding guidelines. The EditorConfig is compatible with most IDEs like WebStorm and VS Code.

📖 EditorConfig

.eslintignore

Configuration file for ESLint that defines which files to ignore.

📖 Ignoring Code - ESLint

.eslintrc.js

Configuring ESLint rules.

📖 Configuring ESLint

.gitignore

Defines which files won’t be commited to the repository

📖 gitignore Documentation

.nvmrc

Setting node.js version for nvm. Nvm is the package which allows to switch between node versions without new installation of node.

📖 nvm-sh/nvm

.prettierrc

Config of rules of prettier. Prettier is a utility that automatically formats your code.

📖 Configuration File · Prettier

create-dev-db.sh

Used by docker-compose to install the database, see Local installation guide

docker-compose.yml

Installation of ROQ One Backend via docker-compose, see Local installation guide

📖 Compose specification

Dockerfile

Installation of ROQ One Backend via docker, see Local installation guide

📖 Dockerfile reference

jest.config.js

Configuration file of Jest which is used for the e2e tests.

📖 Configuring Jest

nest-cli.json

Compiler options that are needed because of the mono-repository approach.

📖 NestJS - monorepo

ormconfig.json

This file will be auto-generated when you run TypeORM migration, see Database migrations

ormlogs.log

This file contains all executed database queries and statements. You can configure it in app.module.ts.

package.json

List of dependencies which are installed when you run npm i

📖 package.json | npm Docs

package-lock.json

Calculated file that describes which versions of what dependency will be installed.

📖 package-lock.json | npm Docs

tsconfig.build.json

tsconfig.json

These files contain options of the TypeScript compiler

📖 Documentation - What is a tsconfig.json

Source directory backend/src

Directory

Content

External documentation

src/auth

This directory contains the entire authentication flow with user registration, login, refresh-tokens and the strategies.

📖 Nest.js authentication

📖 Passport.js documentation

src/config

Usual way of Nest.js configuration.

📖 Nest.js configuration

src/example

Example module with the book-author case. Should be removed before go-live.for more information.

src/migration

Directory that keeps all generated database migrations. See Database migrations

📖 TypeORM migrations

sec/testSetup

This module is a helper module which is needed to set up cypress testing environment. It has controllers to define the initial state when running cypress tests locally. The module is protected for non-development environments.

src/user

Module that contains the core CRUD logic of the user feature.

src/userInternal

Additional logic for user module that is integrated with ROQ Platform.

src/userInvite

Business logic of the user invite feature.

src/app.controller

Rest controller for the application’s health-check.

src/app.module

Root module of the application where you declare the global dependencies like TypeORM and Apollo Server and also set global middleware and interceptors.

📖 Nest.js modules

src/console.ts

src/create-schema.ts

  • Apollo Server schema. Result is schema file (schema.gql). Should be in console directory.

src/migration

  • Utility for migration

src/newrelic.ts

  • Default New Relic configuration

📖 New Relic NestJS Integration