This project is a simple Angular 2 application demonstrating the use of the angular2-jwt helper library, by Auth0. It contains a login component, a home component, a user service, and an authentication service. The application communicates with a simple REST server written in Go.
You need both Docker and Docker Compose installed, to be able to run this project.
Type npm install
in the project directory, and wait for all dependencies to be downloaded, before you proceed.
First, you need to start the Docker containers, by typing npm run start-backend
. This will start two containers, one for the REST server, and one for the Redis server. If you had any of these containers already running, they will be stopped first.
After starting the containers, start the Angular 2 application, by typing npm run start-frontend
. Then point your browser to http://127.0.0.1:4200
.
During development, you may need to restart the containers individually. If you modify the REST server code, you need to rebuild its Docker image for the REST server, and restart it. This can be done by typing npm run restart-rest
. If you need to restart Redis (which will get rid of all the stored data, btw), type npm run restart-redis
.
The Docker containers will run until you stop them. This can be done by typing npm run stop-backend
.