Skip to content

Commit

Permalink
fixed all files using the wrong line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Apr 27, 2024
1 parent 3734485 commit 74f7f3d
Show file tree
Hide file tree
Showing 62 changed files with 6,630 additions and 6,630 deletions.
142 changes: 71 additions & 71 deletions webclient/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
/* eslint-env node */
module.exports = {
root: true,
extends: [
"plugin:vue/vue3-essential",
"plugin:vue/vue3-strongly-recommended",
"plugin:vue/vue3-recommended",
"eslint:recommended",
"@vue/eslint-config-typescript/recommended",
"@vue/eslint-config-prettier",
"@vue/eslint-config-prettier/skip-formatting",
],
parserOptions: {
ecmaVersion: "latest",
},
rules: {
"vue/no-v-html": "off",
"vue/block-lang": [
"error",
{
script: {
lang: "ts",
},
},
],
"vue/block-order": [
"error",
{
order: ["script", "template", "style", "i18n"],
},
],
"vue/block-tag-newline": "error",
"vue/component-api-style": [
"error",
["script-setup", "composition"], // "script-setup", "composition", "composition-vue2", or "options"
],
"vue/multi-word-component-names": "off",
"vue/component-name-in-template-casing": ["error", "PascalCase", { registeredComponentsOnly: false }],
"vue/custom-event-name-casing": ["error", "camelCase"],
"vue/define-macros-order": "error",
"vue/define-props-declaration": ["error", "type-based"],
"vue/html-button-has-type": [
"error",
{
button: true,
submit: true,
reset: true,
},
],
"vue/no-boolean-default": ["error", "default-false"],
"vue/no-empty-component-block": "error",
"vue/html-comment-content-spacing": ["error", "always"],
"vue/no-ref-object-reactivity-loss": "error",
"vue/no-required-prop-with-default": "error",
"vue/no-restricted-call-after-await": "error",
//"vue/no-root-v-if": "error", todo: enable when there is a loading animation
"vue/no-setup-props-reactivity-loss": "error",
//"vue/no-static-inline-styles": "error", todo: enable after migration to tailwind
"vue/no-useless-mustaches": "error",
"vue/no-useless-v-bind": "error",
"vue/no-v-text": "error",
"vue/padding-line-between-blocks": "error",
"vue/prefer-prop-type-boolean-first": "error",
"vue/prefer-separate-static-class": "error",
"vue/require-macro-variable-name": "error",
"vue/require-typed-ref": "error",
"vue/static-class-names-order": "off",
"vue/v-for-delimiter-style": "error",
"vue/no-constant-condition": "error",
},
};
/* eslint-env node */
module.exports = {
root: true,
extends: [
"plugin:vue/vue3-essential",
"plugin:vue/vue3-strongly-recommended",
"plugin:vue/vue3-recommended",
"eslint:recommended",
"@vue/eslint-config-typescript/recommended",
"@vue/eslint-config-prettier",
"@vue/eslint-config-prettier/skip-formatting",
],
parserOptions: {
ecmaVersion: "latest",
},
rules: {
"vue/no-v-html": "off",
"vue/block-lang": [
"error",
{
script: {
lang: "ts",
},
},
],
"vue/block-order": [
"error",
{
order: ["script", "template", "style", "i18n"],
},
],
"vue/block-tag-newline": "error",
"vue/component-api-style": [
"error",
["script-setup", "composition"], // "script-setup", "composition", "composition-vue2", or "options"
],
"vue/multi-word-component-names": "off",
"vue/component-name-in-template-casing": ["error", "PascalCase", { registeredComponentsOnly: false }],
"vue/custom-event-name-casing": ["error", "camelCase"],
"vue/define-macros-order": "error",
"vue/define-props-declaration": ["error", "type-based"],
"vue/html-button-has-type": [
"error",
{
button: true,
submit: true,
reset: true,
},
],
"vue/no-boolean-default": ["error", "default-false"],
"vue/no-empty-component-block": "error",
"vue/html-comment-content-spacing": ["error", "always"],
"vue/no-ref-object-reactivity-loss": "error",
"vue/no-required-prop-with-default": "error",
"vue/no-restricted-call-after-await": "error",
//"vue/no-root-v-if": "error", todo: enable when there is a loading animation
"vue/no-setup-props-reactivity-loss": "error",
//"vue/no-static-inline-styles": "error", todo: enable after migration to tailwind
"vue/no-useless-mustaches": "error",
"vue/no-useless-v-bind": "error",
"vue/no-v-text": "error",
"vue/padding-line-between-blocks": "error",
"vue/prefer-prop-type-boolean-first": "error",
"vue/prefer-separate-static-class": "error",
"vue/require-macro-variable-name": "error",
"vue/require-typed-ref": "error",
"vue/static-class-names-order": "off",
"vue/v-for-delimiter-style": "error",
"vue/no-constant-condition": "error",
},
};
230 changes: 115 additions & 115 deletions webclient/README.md
Original file line number Diff line number Diff line change
@@ -1,115 +1,115 @@
# Webclient

This folder contains the JavaScript based webclient for NavigaTUM.

## Getting started

### Prerequisites

For getting started, there are some system dependencys which you will need.
Please follow the [system dependencys docs](/resources/documentation/Dependencys.md) before trying to run this part of our project.

### Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
Most modern IDEs (like PyCharm) should work as well and have a Plugin.

## Dependencies

### Prerequisites

For getting started, there are some system dependencys which you will need.
Please follow the [system dependencys docs](/resources/documentation/Dependencys.md) before trying to run this part of our project.

### Installing Dependency's

```bash
pnpm install
```

## Run

Ensure that _NavigaTUM-server_ is running in the background.
By default, the webclient will connect to the server on `https://nav.tum.de`.
If you want to connect to a local version instead, change the environemnt variable `NUXT_PUBLIC_{API,CDN,FEEDBACK,MAPS}_URL` to the appropriate value.

To get a local server running, please:

- either via following the [guide to local development](../server/README.md), or
- via [docker](https://docs.docker.com/)
_docker isolates the network, but we want these two containers to communicate to each other without being as brittle as IPs._
_Naming the `navigatum-mieli-search` container `search` makes us able to connect to it via <`http://search:7700`> from the server_

```bash
docker network create navigatum-net
docker run -it --rm -p 7700:7700 --name search --network navigatum-net ghcr.io/tum-dev/navigatum-mieli-search:main
docker run -it --rm -p 8080:8080 --network navigatum-net -e MIELI_SEARCH_ADDR=search ghcr.io/tum-dev/navigatum-server:main /bin/navigatum-main-api
```

```sh
pnpm run dev
```

### Type-Check, Compile and Minify for Production

```sh
pnpm run build
```

### Linting with [ESLint](https://eslint.org/) and formatting via prettier

```sh
pnpm run lint
pnpm run format
```

### Update the API's type definitions

From the folder of this README, run:

```sh
pnpm run type-refresh
```

## Architecture

The NavigaTUM webclient is made as a nuxt3 server side rendered application based on [Vue.js](https://vuejs.org/) and [Vue Router](https://router.vuejs.org/).
Our CSS framework is [Tailwind](https://tailwindcss.com/).

### Directory structure (only the important parts)

```plain
webclient
├── public/ # 🠔 Static assets such as icons, which cannot get inlined
├── api_types/ # 🠔 code generated via openapi.yaml for typechecking reasons
├── content/ # 🠔 Static pages written in markdown. Served at `/about/<filename>`.
├── assets/ # 🠔 Static assets such as icons
│ ├── main.scss # 🠔 Sass CSS code for all non-view parts
│ └── logos # 🠔 The Logos used by the app
├── components/ # 🠔 Vue components, which are used in views.
├── pages/ # 🠔 The pages are parts of App.vue, which are loaded based their file names.
├── nuxt.config.ts # 🠔 core configuration of nuxt
└── package.json # 🠔 Node package definition and dependencies
```

Note that new views are automatically included in the build, but they are not routed.
To add a new view, you need to add a new route in `router.ts`.

## Testing

> [!NOTE]
> cypress is currently temporarily disabled to help in the nuxt transition
For this part of the project, the tests consist mainly of hot-path e2e tests and tests of critical components.
PRs improving the coverage are very likely to be accepted.
The reason behind these tests is that they fundamentally increase the future productivity by allowing faster review cycles.

### Continuous Integration

Every push and pull request triggers a build that runs linting issues (cypress is currently temporarily disabled to help in the nuxt transition).
This helps us catch any regressions or issues early in the development process.

### Reporting Issues

If you encounter any problems while running the Cypress tests or have suggestions for improving the testing framework, please open an issue/pull request on this repository.
We appreciate your feedback and contributions.
# Webclient

This folder contains the JavaScript based webclient for NavigaTUM.

## Getting started

### Prerequisites

For getting started, there are some system dependencys which you will need.
Please follow the [system dependencys docs](/resources/documentation/Dependencys.md) before trying to run this part of our project.

### Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
Most modern IDEs (like PyCharm) should work as well and have a Plugin.

## Dependencies

### Prerequisites

For getting started, there are some system dependencys which you will need.
Please follow the [system dependencys docs](/resources/documentation/Dependencys.md) before trying to run this part of our project.

### Installing Dependency's

```bash
pnpm install
```

## Run

Ensure that _NavigaTUM-server_ is running in the background.
By default, the webclient will connect to the server on `https://nav.tum.de`.
If you want to connect to a local version instead, change the environemnt variable `NUXT_PUBLIC_{API,CDN,FEEDBACK,MAPS}_URL` to the appropriate value.

To get a local server running, please:

- either via following the [guide to local development](../server/README.md), or
- via [docker](https://docs.docker.com/)
_docker isolates the network, but we want these two containers to communicate to each other without being as brittle as IPs._
_Naming the `navigatum-mieli-search` container `search` makes us able to connect to it via <`http://search:7700`> from the server_

```bash
docker network create navigatum-net
docker run -it --rm -p 7700:7700 --name search --network navigatum-net ghcr.io/tum-dev/navigatum-mieli-search:main
docker run -it --rm -p 8080:8080 --network navigatum-net -e MIELI_SEARCH_ADDR=search ghcr.io/tum-dev/navigatum-server:main /bin/navigatum-main-api
```

```sh
pnpm run dev
```

### Type-Check, Compile and Minify for Production

```sh
pnpm run build
```

### Linting with [ESLint](https://eslint.org/) and formatting via prettier

```sh
pnpm run lint
pnpm run format
```

### Update the API's type definitions

From the folder of this README, run:

```sh
pnpm run type-refresh
```

## Architecture

The NavigaTUM webclient is made as a nuxt3 server side rendered application based on [Vue.js](https://vuejs.org/) and [Vue Router](https://router.vuejs.org/).
Our CSS framework is [Tailwind](https://tailwindcss.com/).

### Directory structure (only the important parts)

```plain
webclient
├── public/ # 🠔 Static assets such as icons, which cannot get inlined
├── api_types/ # 🠔 code generated via openapi.yaml for typechecking reasons
├── content/ # 🠔 Static pages written in markdown. Served at `/about/<filename>`.
├── assets/ # 🠔 Static assets such as icons
│ ├── main.scss # 🠔 Sass CSS code for all non-view parts
│ └── logos # 🠔 The Logos used by the app
├── components/ # 🠔 Vue components, which are used in views.
├── pages/ # 🠔 The pages are parts of App.vue, which are loaded based their file names.
├── nuxt.config.ts # 🠔 core configuration of nuxt
└── package.json # 🠔 Node package definition and dependencies
```

Note that new views are automatically included in the build, but they are not routed.
To add a new view, you need to add a new route in `router.ts`.

## Testing

> [!NOTE]
> cypress is currently temporarily disabled to help in the nuxt transition
For this part of the project, the tests consist mainly of hot-path e2e tests and tests of critical components.
PRs improving the coverage are very likely to be accepted.
The reason behind these tests is that they fundamentally increase the future productivity by allowing faster review cycles.

### Continuous Integration

Every push and pull request triggers a build that runs linting issues (cypress is currently temporarily disabled to help in the nuxt transition).
This helps us catch any regressions or issues early in the development process.

### Reporting Issues

If you encounter any problems while running the Cypress tests or have suggestions for improving the testing framework, please open an issue/pull request on this repository.
We appreciate your feedback and contributions.
Loading

0 comments on commit 74f7f3d

Please sign in to comment.