You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 18, 2025. It is now read-only.
* Add files
* Change nginx to haproxy
* Update dependencies
* Update README file
* Server is working
* Fix test errors
* Show data from server
* Serve static files for server
* Cleanup
Copy file name to clipboardExpand all lines: README.md
+38-8Lines changed: 38 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,25 +4,27 @@
4
4
5
5
The `server` directory contain a simple [Django](https://www.djangoproject.com/) app that expose an `api` of Django `users` with [Django REST framework](http://www.django-rest-framework.org/). The `client` directory contain an [Angular](https://angular.io/) simple app, built with [Angular-Cli](https://github.com/angular/angular-cli), [ngrx](https://github.com/ngrx) to handle state, [Angular Material](https://github.com/angular/material2) as a design library, have service worker, and ready to `AOT` compilation. The simple Angular app show the users from the Django api.
6
6
7
-
The repo is a production ready app, that uses `nginx` to serve static files (the client app and static files from the server), and `gunicorn` for the server (python) stuff. All the parts are in a separate [Docker](https://www.docker.com/) containers and we use [kubernetes](https://kubernetes.io/) to manage them.
7
+
The repo is a production ready app, that uses `nginx` to serve static files (the client app and static files from the server), and `gunicorn` for the server (python) stuff. All the parts are in a separate [Docker](https://www.docker.com/) containers and we use [Docker Swarm](https://docs.docker.com/engine/swarm/) to manage them.
8
+
9
+
We use [ELK Stack](https://www.elastic.co/products) for logging. The `server` and the `client` logs sent to logstash, and saved in elasticsearch. There is also a kibana instance to check and analyze all the logs.
8
10
9
11
## Pre Requirements
10
12
11
13
1. install [docker](https://www.docker.com/).
12
-
2. Don't know yet.
13
14
14
15
## Installation
15
16
16
17
Automatic installation of the project with docker, for development.
17
18
18
19
1. In `client` directory run `docker build -t client .` to build the Docker image.
19
-
2.Run ```docker run -dit -v `pwd`:/usr/src -p 4200:4200 --name=client-con client``` to run a container from that image.
20
-
3.Open the browser at [http://localhost:4200](http://localhost:4200) to see your Angular (client) app.
21
-
4.In `server` directory run `docker build -t server .` to build the Docker image.
22
-
5.Run ```docker run -dit -v `pwd`:/usr/src -p 8000:8000 --name=server-con server```to run a container from that image.
20
+
2.In `server` directory run `docker build -t server .` to build the Docker image.
There is already tests for the `server` and the `client`, we currently at **+90** percent coverage.
48
+
49
+
We also write some tests for doing load test with [locust](http://locust.io/), you can find it under `server/stress_tests/`. To do a load test just install locust and write
50
+
51
+
```
52
+
locust --host=http://localhost
53
+
```
54
+
55
+
Then open up Locust’s web interface [http://localhost:8089](http://localhost:8089).
56
+
57
+
## Rolling Updates
58
+
59
+
To update the any of the containers that are in a service with a new image just create a new image, for example
60
+
61
+
```
62
+
docker build -t server:v2 .
63
+
```
64
+
65
+
And then update the service with the new image
66
+
67
+
```
68
+
docker service update --image server:v2 prod_server
0 commit comments