|
| 1 | +# [TODO:PROJECT_NAME] |
| 2 | + |
| 3 | +[TODO:PROJECT_DESCRIPTION] |
| 4 | + |
| 5 | +- [Setup](#setup) |
| 6 | + - [Prerequisites / Dependencies](#prerequisites--dependencies) |
| 7 | + - [Installation](#installation) |
| 8 | + - [Post-install](#post-install) |
| 9 | +- [Usage](#usage) |
| 10 | + - [Running the app](#running-the-app) |
| 11 | + - [Building the app](#building-the-app) |
| 12 | +- [Testing](#testing) |
| 13 | + - [Unit testing](#unit-testing) |
| 14 | + - [End to end tests](#end-to-end-tests) |
| 15 | + - [Code quality](#code-quality) |
| 16 | +- [Environments](#environments) |
| 17 | +- [Environment variables](#environment-variables) |
| 18 | + - [List of environment variables](#list-of-environment-variables) |
| 19 | +- [Deployment](#deployment) |
| 20 | +- [Releases](#releases) |
| 21 | +- [Translations](#translations) |
| 22 | +- [Licencing](#licencing) |
| 23 | + |
| 24 | +## Setup |
| 25 | + |
| 26 | +### Prerequisites / Dependencies |
| 27 | + |
| 28 | +You will need to have NodeJS and NPM installed to run this application. It's recommended to use a NodeJS version manager to manage your versions. Required NodeJS versions will typically match LTS (long-term support) versions and you can check which exact version to install by checking `.node-version` file in the repository root. |
| 29 | + |
| 30 | +### Installation |
| 31 | + |
| 32 | +1. clone this repository: `git clone [TODO:GIT_LINK]` |
| 33 | +2. install all the dependencies: `npm ci` |
| 34 | + |
| 35 | +### Post-install |
| 36 | + |
| 37 | +1. set up the [environment variables](#environment-variables) |
| 38 | + |
| 39 | +## Usage |
| 40 | + |
| 41 | +### Running the app |
| 42 | + |
| 43 | +To run the app, you can simply run `npm start`. This starts the application in the environment dependent on your environment setup. |
| 44 | + |
| 45 | +### Building the app |
| 46 | + |
| 47 | +To build the app you can use some of the following commands: |
| 48 | + |
| 49 | +``` |
| 50 | +npm run build |
| 51 | +npm run build:dev |
| 52 | +npm run build:prod # builds the app for production |
| 53 | +
|
| 54 | +``` |
| 55 | + |
| 56 | +## Testing |
| 57 | + |
| 58 | +### Unit testing |
| 59 | + |
| 60 | +To start the unit tests you can use one of the following commands: |
| 61 | + |
| 62 | +``` |
| 63 | +npm run test |
| 64 | +npm run test:watch # runs all tests in watch mode and without code coverage report |
| 65 | +npm run test:watch:coverage # runs all tests in watch mode with code coverage report |
| 66 | +
|
| 67 | +``` |
| 68 | + |
| 69 | +### End to end tests |
| 70 | + |
| 71 | +[TODO:DESCRIBE_E2E] |
| 72 | + |
| 73 | +### Code quality |
| 74 | + |
| 75 | +The following tools are used in the project to ensure code quality: |
| 76 | + |
| 77 | +Prettier: for consistent code formatting. |
| 78 | +ESLint: for identifying and fixing code quality issues. |
| 79 | +Stylelint: for identifying and fixing CSS code quality issues. |
| 80 | +Husky: Git hooks to automate code quality checks with ESLint and Prettier |
| 81 | + |
| 82 | +Local code quality checks (Prettier, ESLint, and Stylelint) are run before a user can commit their code through Husky's _pre-commit_ hook, which ensures that the code pushed to Git is consistent and doesn't include any obvious issues that can be detected with static analysis. |
| 83 | + |
| 84 | +## Environments |
| 85 | + |
| 86 | +There are currently two application environments: |
| 87 | + |
| 88 | +1. DEV - development instance, used for testing developed features |
| 89 | + - API: [TODO:DEV_BACKEND_API_URL] |
| 90 | + - Frontend: [TODO:DEV_APP_URL] |
| 91 | +2. PRODUCTION - production environment |
| 92 | + - API: [TODO:PROD_BACKEND_API_URL] |
| 93 | + - Frontend: [TODO:PROD_APP_URL] |
| 94 | + |
| 95 | +## Environment variables |
| 96 | + |
| 97 | +You can specify environment variables as per the guide in the [Nuts & Bolts](https://infinum.github.io/ngx-nuts-and-bolts/docs/environment-variables). |
| 98 | + |
| 99 | +### List of environment variables |
| 100 | + |
| 101 | +| Variable | Requirement | Description | |
| 102 | +| ---------------- | ----------- | ---------------------------------------------------------- | |
| 103 | +| API_HOST | required | API endpoint URL | |
| 104 | +| ENV | required | Available options: development, production | |
| 105 | +| ASSETS_BASE_HREF | optional | Specifies the base path for the static assets (default: /) | |
| 106 | + |
| 107 | +## Deployment |
| 108 | + |
| 109 | +The application deployment is managed with GitHub Actions. |
| 110 | + |
| 111 | +More information on the deployment process can be found in [Deployment process wiki page](TODO:GITHUB_WIKI_PAGE). |
| 112 | + |
| 113 | +## Releases |
| 114 | + |
| 115 | +Releases are handled through GitHub Releases feature and documentation for it can be found on [Release process wiki page](TODO:GITHUB_WIKI_PAGE). |
| 116 | + |
| 117 | +## Translations |
| 118 | + |
| 119 | +The application uses [Polyglot](TODO:PROJECT_POLYGLOT_LINK) for handling translations. More information can be found on the [Translations handling wiki page](TODO:GITHUB_WIKI_PAGE). |
| 120 | + |
| 121 | +## Licencing |
| 122 | + |
| 123 | +The application uses a licence header for all TypeScript files. To help out with setting this up for new files, you can install `licenser` extension. |
| 124 | + |
| 125 | +``` |
| 126 | +# CMD + P |
| 127 | +ext install licenser |
| 128 | +
|
| 129 | +``` |
| 130 | + |
| 131 | +This extension will add proper license headers to each new file. |
| 132 | + |
| 133 | +You can also add license headers manually: |
| 134 | + |
| 135 | +``` |
| 136 | +# CMD + SHIFT + P |
| 137 | +licenser: Insert license header |
| 138 | +
|
| 139 | +``` |
0 commit comments