Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/city-of-helsinki/berth-reservations-ui
https://github.com/city-of-helsinki/berth-reservations-ui
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/city-of-helsinki/berth-reservations-ui
- Owner: City-of-Helsinki
- License: mit
- Created: 2018-10-08T09:12:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-12T06:45:42.000Z (about 1 month ago)
- Last Synced: 2024-11-12T07:32:22.711Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 24.9 MB
- Stars: 2
- Watchers: 21
- Forks: 2
- Open Issues: 53
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Berth Reservation UI
[![CI status](https://github.com/City-of-Helsinki/berth-reservations-ui/workflows/CI/badge.svg)](https://github.com/City-of-Helsinki/berth-reservations-ui/actions?query=workflow%3ACI)
[![Browser Tests status](https://github.com/City-of-Helsinki/berth-reservations-ui/workflows/Browser%20Tests/badge.svg)](https://github.com/City-of-Helsinki/berth-reservations-ui/actions?query=workflow%3A%22Browser+Tests%22)## Prerequisites
- Yarn
- Strong recommendation for an IDE: VSCode### Recommended VSCode plugins:
- [TSLint](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin)
- [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)### Setup
After cloning this repository, create a new `.env.development.local` file from the provided `.env` file:
```
$ cp .env .env.development.local
```The default configuration uses the test environment as backend.
## Development
To start development environment, run:
```
$ yarn start
```This will start [the application](http://localhost:3000) on port `3000`.
### Problems starting development environment
#### Windows specific
- `SassError: File to import not found or unreadable`, e.g. `@import 'helsinki/colors';`
- Change all `:` characters to `;` in SASS_PATH, see [sass documentation](https://github.com/sass/sass/blob/embedded-protocol-2.1.0/js-api-doc/legacy/options.d.ts#L32-L35)### Starting dockerized development environment
1. Check if Docker and docker CLI installed, port `3000` and `9000` is free, not occupied by running server.
2. Make sure you have env variables in `.env.development.local`, otherwise extend it from example by:
```
$ cp .env.example .env.development.local
```
3. Start building docker image and start container:
```
$ docker-compose up
```
4. Open `localhost:3000` on browser.## Testing
To run tests:
```
$ yarn test
```## Browser tests
Browser tests are written in TypeScript with [TestCafe](https://devexpress.github.io/testcafe/) framework and they are run against [test environment](https://venepaikat-federation-gateway.test.hel.ninja) in CI as GitHub Cron Job (daily) with Chrome (headless mode).
### How to run locally
Running against test environment
- `yarn browser-test`
Running against local environment
- `yarn browser-test:local`
## Useful docker command
- To rebuild the docker images:
```
$ docker-compose up --force-recreate --build
```
- To enter inside docker container environment:
```
$ docker-compose exec web sh
```
- Remove docker container if needed:
```
$ docker rm -f berth-frontend
```
- Remove docker image:
```
$ docker rmi berth-reservations-ui_web
```
- Running command inside Docker environment (test for example):
(Make sure docker container is running)
`$ docker-compose run web YOUR_COMMAND_HERE`
- Encounter `node-sass` issue ? try to go inside docker container environment and run `npm rebuild node-sass`