1
Fork 0
No description https://tb.drs.tobot.dev/
This repository has been archived on 2022-08-23. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
2022-02-28 12:08:13 +01:00
.devcontainer Install which into devcontainer 2022-02-28 12:08:05 +01:00
.github/workflows Fix test not initializing submodules 2022-02-28 12:07:52 +01:00
src Fix size constraints 2022-02-28 12:08:13 +01:00
.eslintignore Initial commit 2022-01-07 12:09:22 +01:00
.eslintrc.json Initial commit 2022-01-07 12:09:22 +01:00
.gitignore Clean up package 2022-02-28 12:08:11 +01:00
.gitmodules Upgrade dependencies 2022-02-28 12:08:09 +01:00
.prettierignore Initial commit 2022-01-07 12:09:22 +01:00
.prettierrc Initial commit 2022-01-07 12:09:22 +01:00
LICENSE Clean up package 2022-02-28 12:08:11 +01:00
next-env.d.ts Update dependencies 2022-02-28 12:07:44 +01:00
next.config.mjs Next config as module 2022-02-28 12:08:04 +01:00
package.json Clean up package 2022-02-28 12:08:11 +01:00
README.md Clean up package 2022-02-28 12:08:11 +01:00
tsconfig.json Update dependencies 2022-02-28 12:07:44 +01:00
yarn.lock Upgrade dependencies 2022-02-28 12:08:09 +01:00

Backend for Minimal Non-Persistent chat

Built in TypeScript 4.5 with Next.js, React, Preact, and Sass.

Install

Run the command yarn install (or the equivalent in your package manager of choice).

Develop

Run the command yarn dev (or the equivalent in your package manager of choice).

This will run the server in development mode.
Changes to source files will trigger a rebuild and an automatic reload of the page.

By default the application will be hosted on http://localhost:3000.
To change the port, pass the --port flag to the command. (e.g. yarn dev --port 9090)

Formatting & Testing

The command yarn type-check (or equivalent) will run the TypeScript compiler without any output, reporting any compile-time errors or warnings.

The command yarn lint (or equivalent) will run the configured linters, reporting any linting errors or warnings.
Its "subcommands" are:

  • yarn lint: runs all configured linters
  • yarn lint:eslint: runs ESLint with the rules set in .eslintrc.json, ignoring files in .eslintignore
  • yarn lint:prettier: runs Prettier with the rules set in .prettierrc

The command yarn test (or equivalent) will run the type checker and the configured linters in strict mode. It will fail if there are any warnings or errors reported. It will (or should, at least) automatically run when you create a new git commit. Its "subcommands" are:

  • yarn test: runs the type checker and both linter test-scripts
  • yarn test:eslint: runs ESLint lint-script, but disallows any warnings or errors
  • yarn test:prettier: runs Prettier lint-script
    • prettier's test and lint script are equivalent, by prettier's design

The command yarn fix (or equivalent) will format all source files using the configured linters. Its "subcommands" are:

  • yarn fix: formats all source files using both linter fix-scripts
  • yarn fix:eslint: runs the eslint lint-script, but fixes any fixable errors in-place
  • yarn fix:prettier: formats all source files only using the Prettier linter

Build

Run the command yarn build (or the equivalent in your package manager of choice).

This will build a production version of the application.
Barring unexpected changes, this build output will be static and suitable for deployment on a web server with no installed JavaScript runtime.

Export

You may access the built output files manually.
For that you will need to run yarn next export (or the equivalent in your package manager of choice).
The files will then be available in the out directory.

Run

To run a production build, run the command yarn start (or the equivalent in your package manager of choice).

The compiled script does not take any parameters.
Any configuration needs to be done in-source, before the building step.

This will run the built production version of the application and will fail if no such build has been created.

By default the application will be hosted on http://localhost:3000.
To change the port, pass the --port flag to the command. (e.g. yarn start --port 9090)

Combined script

The combined script yarn prod (or equivalent) will run the build script and, if successful, the run script.

This command takes the same parameters as the start script.

This package has only been tested on Linux with Node.js v17.3.0

The page has only been tested in the Chrome browser.