update README

This commit is contained in:
Moriz Wahl 2023-12-05 10:43:23 +01:00
parent 2d1191c511
commit 1fada0abc0
4 changed files with 56 additions and 12 deletions

View File

@ -2,6 +2,10 @@
[![nodejs][badge-nodejs-img]][badge-nodejs-href]
[![npm][badge-npm-img]][badge-npm-href]
[![docker][badge-docker-img]][badge-docker-href]
[![eslint][badge-eslint-img]][badge-eslint-href]
[![apollo-server][badge-apollo-img]][badge-apollo-href]
[![graphql][badge-graphql-img]][badge-graphql-href]
[![type-graphql][badge-type-graphql-img]][badge-type-graphql-href]
The IT4C Boilerplate for an apollo express backends.
@ -15,14 +19,42 @@ The project sets up an apollo express server.
The following commands are available:
| Command | Description |
|----------------------------|------------------------------------------|
| **Develop** | |
| `npm run dev` | Compiles and hot-reloads for development |
| **Test** | |
| `npm run test:lint` | Run all linters |
| `npm run test:lint:eslint` | Run linter eslint |
| `npm run test:lint:remark` | Run linter remark |
| Command | Description |
|----------------------------|-------------------------------------------------|
| `npm install` | Project setup |
| `npm run build` | Compiles and minifies for production |
| `npm run start` | Runs productions server |
| **Develop** | |
| `npm run dev` | Compiles and hot-reloads for development |
| **Test** | |
| `npm run test:lint` | Run all linters |
| `npm run test:lint:eslint` | Run linter eslint |
| `npm run test:lint:remark` | Run linter remark |
| `npm run test:unit` | Run all unit tests and generate coverage report |
| `npm test` | Run all tests & linters |
### Docker
Docker can be run in development mode utilizing `docker-compose.overwrite.yml`:
```bash
docker compose up
```
Docker can be run in production mode:
```bash
docker compose -f docker-compose.yml up
```
### Update
You can get a list of packes to update by running `npm run update`.
Appending `-u ` will also update the packages in the `package.json`. You have to run `npm install` again after.
```bash
npm run update -- -u
npm install
```
## Endpoints
@ -46,3 +78,15 @@ The following endpoints are provided given the right command is executed or all
[badge-docker-img]: https://img.shields.io/badge/docker-latest-blue
[badge-docker-href]: https://www.docker.com/
[badge-eslint-img]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2FIT4Change%2Fboilerplate-backend%2Fmaster%2Fpackage.json&query=devDependencies.eslint&label=eslint&color=yellow
[badge-eslint-href]: https://eslint.org/
[badge-apollo-img]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2FIT4Change%2Fboilerplate-backend%2Fmaster%2Fpackage.json&query=dependencies.apollo-server-express&label=eslint&color=yellow
[badge-apollo-href]: https://github.com/apollographql/apollo-server#readme
[badge-graphql-img]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2FIT4Change%2Fboilerplate-backend%2Fmaster%2Fpackage.json&query=dependencies.graphql&label=eslint&color=yellow
[badge-graphql-href]: https://graphql.org/
[badge-type-graphql-img]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2FIT4Change%2Fboilerplate-backend%2Fmaster%2Fpackage.json&query=dependencies.type-graphql&label=eslint&color=yellow
[badge-type-graphql-href]: https://typegraphql.com/

View File

@ -18,7 +18,6 @@ services:
# bind the local folder to the docker to allow live reload
- ./:/server
volumes:
backend_node_modules:
documentation_node_modules:

View File

@ -22,7 +22,8 @@
"test:lint:eslint": "eslint --ext .ts,.tsx,.js,.jsx,.json,.yml,.yaml --max-warnings 0 --ignore-path .gitignore .",
"test:lint:remark": "remark . --quiet --frail",
"test:unit": "TZ=UTC jest --runInBand --forceExit --detectOpenHandles",
"test": "npm run test:lint && npm run test:unit"
"test": "npm run test:lint && npm run test:unit",
"update": "npx npm-check-update"
},
"dependencies": {
"apollo-server-express": "^3.13.0",