ID | 15 |Code | 16 |Name | 17 |Commands | 18 |
---|---|---|---|
{{ category[0] }} | 24 |{{ category[1] }} | 25 |{{ category[2] }} | 26 |27 | View Products 28 | | 29 |
Logged out content
40 | {% endif %} 41 | {% endblock %} -------------------------------------------------------------------------------- /consumers/website_ecommerce/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block header %} 5 |Logged in content
11 | {% else %} 12 |Logged out content
13 | {% endif %} 14 | {% endblock %} -------------------------------------------------------------------------------- /consumers/website_ecommerce/templates/login.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |You're logged in already!
10 | {% else %} 11 | 12 |GUID | 15 |USERID | 16 |PRODUCTID | 17 |PRODUCTNAME | 18 |PRICE | 19 |ORDERSTATUS | 20 |STOCKSTATUS | 21 |CREDITSTATUS | 22 |TIME | 23 |
---|---|---|---|---|---|---|---|---|
{{ order['GUID'] }} | 29 |{{ order['USERID'] }} | 30 |{{ order['PRODUCT'] }} | 31 |{{ order['PRODUCTNAME'] }} | 32 |{{ order['PRICE'] }} | 33 |{% if order['ORDERSTATUS']==0 %}PENDING{% elif order['ORDERSTATUS']==1 %}CANCELED{% elif order['ORDERSTATUS']==2 %}APPROVED{% elif order['ORDERSTATUS']==3 %}FINALIZED{%else%}order['ORDERSTATUS']{%endif%} | 34 |{% if order['STOCKSTATUS']==0 %}PENDING{% elif order['STOCKSTATUS']==1 %}RECEIVED{% elif order['STOCKSTATUS']==2 %}DENIED{% elif order['STOCKSTATUS']==3 %}APPROVED{%else%}order['STOCKSTATUS']{%endif%} | 35 |{% if order['CREDITSTATUS']==0 %}PENDING{% elif order['CREDITSTATUS']==1 %}RECEIVED{% elif order['CREDITSTATUS']==2 %}DENIED{% elif order['CREDITSTATUS']==3 %}APPROVED{%else%}order['CREDITSTATUS']{%endif%} | 36 |{{ order['TIME'] }} | 37 |
Logged out content
47 | {% endif %} 48 | {% endblock %} -------------------------------------------------------------------------------- /consumers/website_ecommerce/templates/products.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |ID | 15 |Code | 16 |Name | 17 |Description | 18 |Supplier | 19 |CategoryId | 20 |Price | 21 |Stock | 22 |Category Name | 23 |Commands | 24 |
---|---|---|---|---|---|---|---|---|---|
{{ product[0] }} | 30 |{{ product[1] }} | 31 |{{ product[2] }} | 32 |{{ product[3] }} | 33 |{{ product[4] }} | 34 |{{ product[5] }} | 35 |{{ product[6] }} | 36 |{{ product[7] }} | 37 |{{ product[8] }} | 38 |39 | Order 40 | | 41 |
Logged out content
51 | {% endif %} 52 | {% endblock %} -------------------------------------------------------------------------------- /consumers/website_ecommerce/templates/register.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |You're logged in already!
10 | {% else %} 11 | 12 |Please login first
31 | {% endif %} 32 | {% endblock %} 33 | -------------------------------------------------------------------------------- /consumers/website_manager/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:alpine 2 | COPY . /app 3 | WORKDIR /app 4 | RUN pip install -r requirements.txt 5 | EXPOSE 80 6 | CMD ["python", "-u", "app.py"] -------------------------------------------------------------------------------- /consumers/website_manager/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | services: 3 | web_manager: 4 | build: . 5 | image: msdemo-website-manager:v1.0 6 | volumes: 7 | - '.:/app' 8 | ports: 9 | - 5002:80 10 | command: 11 | - /app/run.sh 12 | environment: 13 | PYTHONUNBUFFERED: 1 14 | FLASK_APP: "app/app.py" 15 | FLASK_ENV: "development" 16 | SERVICE_REGISTRY: "http://msdemo-reverse-proxy/" 17 | networks: 18 | default: {} 19 | msdemo-nw: 20 | aliases: 21 | - msdemo-web-manager 22 | networks: 23 | msdemo-nw: 24 | external: 25 | name: msdemo-nw -------------------------------------------------------------------------------- /consumers/website_manager/requirements.txt: -------------------------------------------------------------------------------- 1 | flask 2 | requests -------------------------------------------------------------------------------- /consumers/website_manager/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd product 4 | echo "building" 5 | python3 -m pip install -r requirements.txt --no-cache-dir 6 | echo "running" 7 | python -u app.py -------------------------------------------------------------------------------- /consumers/website_manager/templates/addcategory.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |Login first!
23 | {% endif %} 24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /consumers/website_manager/templates/addproduct.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |Login first!
37 | {% endif %} 38 | {% endblock %} 39 | -------------------------------------------------------------------------------- /consumers/website_manager/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 |ID | 17 |Code | 18 |Name | 19 |Commands | 20 |||
---|---|---|---|---|---|
{{ category[0] }} | 26 |{{ category[1] }} | 27 |{{ category[2] }} | 28 |29 | View Products 30 | | 31 |32 | Edit 33 | | 34 |35 | Delete 36 | | 37 |
Logged out content
48 | {% endif %} 49 | {% endblock %} -------------------------------------------------------------------------------- /consumers/website_manager/templates/customers.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |UserName | 16 |FullName | 17 |Credit | 19 |Commands | 20 ||
---|---|---|---|---|
{{ customer['UserName'] }} | 26 |{{ customer['FullName'] }} | 27 |{{ customer['Email'] }} | 28 |{{ customer['Credit'] }} | 29 |30 | Edit Credits 31 | | 32 |
Logged out content
42 | {% endif %} 43 | {% endblock %} -------------------------------------------------------------------------------- /consumers/website_manager/templates/deletecategory.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |Login first!
26 | {% endif %} 27 | {% endblock %} 28 | -------------------------------------------------------------------------------- /consumers/website_manager/templates/deleteproduct.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |Login first!
26 | {% endif %} 27 | {% endblock %} 28 | -------------------------------------------------------------------------------- /consumers/website_manager/templates/editcategory.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |Login first!
25 | {% endif %} 26 | {% endblock %} 27 | -------------------------------------------------------------------------------- /consumers/website_manager/templates/editcustomercredit.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |Login first!
27 | {% endif %} 28 | {% endblock %} 29 | -------------------------------------------------------------------------------- /consumers/website_manager/templates/editproduct.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |Login first!
39 | {% endif %} 40 | {% endblock %} 41 | -------------------------------------------------------------------------------- /consumers/website_manager/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | 4 | {% block header %} 5 |Login to continue
14 | {% endif %} 15 | {% endblock %} -------------------------------------------------------------------------------- /consumers/website_manager/templates/login.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block header %} 4 |You're logged in already!
10 | {% else %} 11 | 12 |ID | 17 |Code | 18 |Name | 19 |Description | 20 |Supplier | 21 |CategoryId | 22 |Price | 23 |Stock | 24 |Category Name | 25 |Commands | 26 |||
---|---|---|---|---|---|---|---|---|---|---|---|
{{ product[0] }} | 32 |{{ product[1] }} | 33 |{{ product[2] }} | 34 |{{ product[3] }} | 35 |{{ product[4] }} | 36 |{{ product[5] }} | 37 |{{ product[6] }} | 38 |{{ product[7] }} | 39 |{{ product[8] }} | 40 | 41 |42 | Edit 43 | | 44 |45 | Delete 46 | | 47 |
Logged out content
58 | {% endif %} 59 | {% endblock %} -------------------------------------------------------------------------------- /consumers/website_manager/templates/test.html: -------------------------------------------------------------------------------- 1 | 2 |Reverse proxy handles routing of the following items on nginx.conf
Item | 20 |Type | 21 |Path | 22 |Target Docker Alias | 23 |Description | 24 |
---|---|---|---|---|
eCommerce | 27 |Web Site | 28 |/ecommerce | 29 |http://msdemo-web-ecommerce/ | 30 |Customers can login & logout, view products, product categories, prices, order status. And can place purchase orders. | 31 |
Management | 34 |Web Site | 35 |/management | 36 |http://msdemo-web-management/ | 37 |Site Management can Login, Logout, View Yearly Income, View Invoices, Manage Products & Categories | 38 |
Customer | 41 |Rest Web Service | 42 |/customer | 43 |http://msdemo-service-customer/ | 44 |Provides the following api: Login, Add, Update, Delete Customer. Set & Get Customer Credit | 45 |
Order | 48 |Rest Web Service | 49 |/order | 50 |http://msdemo-service-order/ | 51 |Provides the following api: Place, Get Orders | 52 |
Product | 55 |Rest Web Service | 56 |/product | 57 |http://msdemo-service-product/ | 58 |Provides the following api: Add, Update, Remove, Get Products & Product Categories | 59 |
Accounting | 62 |Rest Web Service | 63 |/accounting | 64 |http://msdemo-service-accounting/ | 65 |Provides the following api: Get Total Income, Get Invoices | 66 |
The requests are proxied into related docker containers, wherever they may be.
69 | Clients only need to know Nginx location + Desired Path, Nginx only needs to know the network alias of the related Docker container
70 | Swarm or Kubernetes can deal with containers on different hosts, otherwise "docker network connect" can help
71 | If required, expose the required port of the host machine in which container is hosted, and enter its IP in the conf file