X-Git-Url: https://git.r.bdr.sh/rbdr/forum/blobdiff_plain/cac85db02ff00732cf75d473dc3411332f33d845..6ccc6f60fc85e665c8a07a169efbe8d09c9d9e8e:/doc/README.md diff --git a/doc/README.md b/doc/README.md index d3119e0..0d14a40 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,88 +1,32 @@ -## Modules +forum / [Exports](modules.md) -
-
Forum
-

The Forum class is the main entry point for the backend application.

-
-
+# Forum -## Typedefs +A forum for the year 3000. -
-
tForumBackendConfiguration : object
-

The main configuration object for the Forum backend. It will be used to -initialize all of the sub-components. It can extend any property of -the forum object.

-
-
tJWTConfiguration : object
-

Configures the behavior of the JWT token.

-
-
tRethinkDBConfiguration : object
-

Information required to connect to the rethinkDB server

-
-
+## What you will need to get started - +This project uses [node][node] for most of its development processes. +Once you have node installed according to the instructions there, run +`npm install` from the root of the project. -## Forum +For local development serve the page by running `npm run dev` from the +root of the project. -The Forum class is the main entry point for the backend application. +This project depends on the [forum server][forum-server], so make sure +that's running before starting. -| Param | Type | Description | -| ------ | ---------------------------------------------------------------------- | ------------------------------------------------- | -| config | [tForumBackendConfiguration](#tForumBackendConfiguration) | the initialization options to extend the instance | +## Testing - +You can run tests with `npm test`. The tests use `testing-library`, `pact`, +and `jest`. -### forum.run() +Here's some short guidelines: -Initializes the application and starts listening. Also prints a -nice robotic banner with information. +- Every component that receives props or changes state should be tested. +- Test expected outcomes, not implementation details. +- Avoid mocking unless it's an external call +- Stores that interact with the API should be tested using pact -**Kind**: instance method of [Forum](#module_Forum) - - -## tForumBackendConfiguration : object - -The main configuration object for the Forum backend. It will be used to -initialize all of the sub-components. It can extend any property of -the forum object. - -**Kind**: global typedef -**Properties** - -| Name | Type | Default | Description | -| ----------------- | ---------------------------------------------------------------- | ------------------------------- | ---------------------------------------------------------------- | -| [port] | number | 1978 | the port where the app will listen on | -| [staticDirectory] | string | "static" | the path, relative to the project root, where static assets live | -| [ttl] | number | 180 | the time in seconds that posts remain alive | -| rethinkDB | [tRethinkDBConfiguration](#tRethinkDBConfiguration) | | the configuration to connect to the rethinkDB server | -| jwt | [tJWTConfiguration](#tJWTConfiguration) | | the configuration for the JWT authentication | - - - -## tJWTConfiguration : object - -Configures the behavior of the JWT token. - -**Kind**: global typedef -**Properties** - -| Name | Type | Default | Description | -| ---------- | ------------------- | ------------------ | ---------------------------------- | -| [duration] | number | 86400 | the duration of the JWT in seconds | -| secret | string | | the secret used to sign the JWT | - - - -## tRethinkDBConfiguration : object - -Information required to connect to the rethinkDB server - -**Kind**: global typedef -**Properties** - -| Name | Type | Default | Description | -| ------ | ------------------- | ----------------- | ---------------------------------------- | -| host | string | | the location of the rethinkDB host | -| [post] | string | 6379 | port where rethinkDB server is listening | +[node]: https://nodejs.org/en/ +[forum-server]: https://gitlab.com/rbdr/forum-server