Readme reorganisation [skip ci]

This commit is contained in:
Nicolai Ort 2021-01-21 15:43:11 +01:00
parent f4668b6e81
commit e2ec0a3b64

View File

@ -2,20 +2,18 @@
Backend Server Backend Server
## Quickstart 🐳
> Use this to run the backend with a postgresql db in docker
1. Clone the repo or copy the docker-compose
2. Run in toe folder that contains the docker-compose file: `docker-compose up -d`
3. Visit http://127.0.0.1:4010/api/docs to check if the server is running
4. You can now use the default admin user (`demo:demo`)
## Dev Setup 🛠 ## Dev Setup 🛠
> Local dev setup utilizing sqlite3 as the database.
### Local w/ sqlite 1. Rename the .env.example file to .env (you can adjust app port and other settings, if needed)
1. Create a .env file in the project root containing:
```
APP_PORT=4010
DB_TYPE=sqlite
DB_HOST=bla
DB_PORT=bla
DB_USER=bla
DB_PASSWORD=bla
DB_NAME=./test.sqlite
```
2. Install Dependencies 2. Install Dependencies
```bash ```bash
yarn yarn
@ -25,15 +23,21 @@ Backend Server
yarn dev yarn dev
``` ```
### Generate Docs ### Run Tests
```
yarn docs
```
### Docker w/ postgres 🐳
```bash ```bash
docker-compose up --build # Run tests once (server has to run)
yarn test
# Run test in watch mode (reruns on change)
yarn test:watch
# Run test in ci mode (automaticly starts the dev server)
yarn test:ci
```
### Generate Docs
```bash
yarn docs
``` ```
## Recommended Editor ## Recommended Editor
@ -42,22 +46,19 @@ docker-compose up --build
### Recommended Extensions ### Recommended Extensions
- will be automatically recommended via ./vscode/extensions.json * will be automatically recommended via ./vscode/extensions.json
## Branches ## Staging
- main: Protected "release" branch ### Branches & Tags
- dev: Current dev branch for merging the different features - only push for merges or minor changes! * vX.Y.Z: Release tags created from the main branch
- feature/xyz: Feature branches - `feature/issueid-title` * The version numbers follow the semver standard
- bugfix/xyz: Branches for bugfixes - `bugfix/issueid-title` (no id for readme changes needed) * A new release tag automaticly triggers the release ci pipeline
* main: Protected "release" branch
* The latest tag of the docker image get's build from this
## File Structure * New releases get created as tags from this
* dev: Current dev branch for merging the different feature branches and bugfixes
- src/models/entities\* - database models (typeorm entities) * The dev tag of the docker image get's build from this
- src/models/actions\* - actions models * Only push minor changes to this branch!
- src/models/responses\* - response models * To merge a feature branch into this please create a pull request
- src/controllers/\* - routing-controllers * feature/xyz: Feature branches - nameing scheme: `feature/issueid-title`
- src/loaders/\* - loaders for the different init steps of the api server * bugfix/xyz: Branches for bugfixes - nameing scheme:`bugfix/issueid-title`
- src/middlewares/\* - express middlewares (mainly auth r/n)
- src/errors/* - our custom (http) errors
- src/routes/\* - express routes for everything we don't do via routing-controllers (depreciated)