Skip to content

A small recrument project (Angular) - the web notes manager

License

Notifications You must be signed in to change notification settings

dplocki/angular-notes-manager

Repository files navigation

🗒️ Angular Notes Manager

This is a small Angular 2 application. The main and only purpose of this app is to manage notes, which are saved in the browser's localStorage. It allows users to create, edit, and delete notes, and it also supports autosave.

📜 Historic background

This was a recruitment project and also one of my first projects in Angular (I had a few in AngularJS before). I decided to upgrade it, as I couldn't run it, even with the proper Node version from that time.

At the time (around 2016) I have used Angular 5, based on Node 7.

The original code is available in this repo by tag: 1.0.0.

⌨️ Current state

🛠️ Docker

docker build . -t angular-notes-manager
docker run --rm -p 4200:4200 -p 9876:9876 -p 49153:49153 -v $(pwd):/build -it angular-notes-manager

Running the Angular app in container

You need to specify the host of the app (in angular.json configuration file) or by command:

ng serve --host 0.0.0.0

The need ports are: 4200 and 49153 for refresh.

📝 Notes

Docker and karma tests

Turns out it is not so easy. There are many tutorials on how to run Karma inside the docker container, but they seem not to be working now (most of them were made at least a few years ago). Probably, Chrome has changed. Definitely, the link to Google Chrome has changed.

Luckily I found the solution: How to run Karma tests from docker container? - the third replay. Based on that I have adjusted my Dockerfile.

Running test during CI

Unfortunately, running the unit test during gateway checking was also not so easy. Finally, the following command runs properly:

ng test --browsers=ChromeHeadless --no-watch --no-progress

Visual Code extensions: