diff --git a/.gitignore b/.gitignore index 499e9909..87fe1392 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,9 @@ testem.log # System Files .DS_Store Thumbs.db +react-ystemandchess/package-lock.json +chessClient/package-lock.json +middleware/package-lock.json +middlewareNode/package-lock.json +stockfishServer/package-lock.json +chessServer/package-lock.json diff --git a/react-ystemandchess/src/AppRoutes.js b/react-ystemandchess/src/AppRoutes.js index 2de8f84f..a4e4f76b 100644 --- a/react-ystemandchess/src/AppRoutes.js +++ b/react-ystemandchess/src/AppRoutes.js @@ -57,8 +57,16 @@ const AppRoutes = () => { /> } /> } /> + {/* } /> + } /> + } /> */} + } /> - {/* } /> */} + {/* } /> + + } /> */} + } /> + } /> ); }; diff --git a/react-ystemandchess/src/components/badges/Badges.jsx b/react-ystemandchess/src/components/badges/Badges.jsx new file mode 100644 index 00000000..38c7fe82 --- /dev/null +++ b/react-ystemandchess/src/components/badges/Badges.jsx @@ -0,0 +1,55 @@ +import React from 'react'; +import './Badges.scss'; +import Images from '../../images/imageImporter' + +const BadgeKnight = ({}) => { + return ( +
+ YSC Knight Badge +
+ ) +} +const BadgeKing = ({}) => { + return ( +
+ YSC King Badge +
+ ) +} +const BadgeQueen = ({}) => { + return ( +
+ YSC Queen Badge +
+ ) +} +const BadgeRook = ({}) => { + return ( +
+ YSC Rook Badge +
+ ) +} +const BadgePawn = ({}) => { + return ( +
+ YSC Pawn Badge +
+ ) +} +const BadgeBishop = ({}) => { + return ( +
+ YSC Bishop Badge +
+ ) +} + +export default Badges = { + BadgeKnight, + BadgeKing, + BadgeQueen, + BadgeRook, + BadgePawn, + BadgeBishop +} \ No newline at end of file diff --git a/react-ystemandchess/src/components/badges/Badges.scss b/react-ystemandchess/src/components/badges/Badges.scss new file mode 100644 index 00000000..e69de29b diff --git a/react-ystemandchess/src/images/badges/badge-bishop.png b/react-ystemandchess/src/images/badges/badge-bishop.png new file mode 100644 index 00000000..01f83eb8 Binary files /dev/null and b/react-ystemandchess/src/images/badges/badge-bishop.png differ diff --git a/react-ystemandchess/src/images/badges/badge-king.png b/react-ystemandchess/src/images/badges/badge-king.png new file mode 100644 index 00000000..8f59f43a Binary files /dev/null and b/react-ystemandchess/src/images/badges/badge-king.png differ diff --git a/react-ystemandchess/src/images/badges/badge-knight.png b/react-ystemandchess/src/images/badges/badge-knight.png new file mode 100644 index 00000000..e953cd0f Binary files /dev/null and b/react-ystemandchess/src/images/badges/badge-knight.png differ diff --git a/react-ystemandchess/src/images/badges/badge-pawn.png b/react-ystemandchess/src/images/badges/badge-pawn.png new file mode 100644 index 00000000..3213f60b Binary files /dev/null and b/react-ystemandchess/src/images/badges/badge-pawn.png differ diff --git a/react-ystemandchess/src/images/badges/badge-queen.png b/react-ystemandchess/src/images/badges/badge-queen.png new file mode 100644 index 00000000..b3e9d0fa Binary files /dev/null and b/react-ystemandchess/src/images/badges/badge-queen.png differ diff --git a/react-ystemandchess/src/images/badges/badge-rook.png b/react-ystemandchess/src/images/badges/badge-rook.png new file mode 100644 index 00000000..1685adf5 Binary files /dev/null and b/react-ystemandchess/src/images/badges/badge-rook.png differ diff --git a/react-ystemandchess/src/images/imageImporter.jsx b/react-ystemandchess/src/images/imageImporter.jsx index 1584241f..de4af2b7 100644 --- a/react-ystemandchess/src/images/imageImporter.jsx +++ b/react-ystemandchess/src/images/imageImporter.jsx @@ -24,12 +24,27 @@ import playComputerIcon from "./StudentInventoryIcons/play-computer-icon.svg"; import recordingsIcon from "./StudentInventoryIcons/recordings-icon.svg"; import backpackIcon from "./StudentInventoryIcons/backpack-icon.svg"; +<<<<<<< HEAD // Chess Benefit Page import mathComputerImg from "./mathArticle/computer.png"; import mathChampImg from "./mathArticle/Junechamp 2.png"; +======= +// Chess Benefits Page +import mathComputerImg from "./mathArticle/computer.png" +import mathChampImg from "./mathArticle/Junechamp 2.png" +>>>>>>> origin/feature/add-static-badge-elements + +// Badges +import badgeKnight from "./badges/badge-knight.png"; +import badgeQueen from "./badges/badge-knight.png"; +import badgeRook from "./badges/badge-knight.png"; +import badgeKing from "./badges/badge-knight.png"; +import badgePawn from "./badges/badge-knight.png"; +import badgeBishop from "./badges/badge-knight.png"; // Global image object. Don't forget to place images here. const images = { +<<<<<<< HEAD // Home LogoLineBr, TreesGroup, @@ -55,6 +70,40 @@ const images = { playComputerIcon, recordingsIcon, backpackIcon, +======= + // Home + LogoLineBr, + TreesGroup, + Heart, + Gem, + LargeInfo, + ChessGroup, + Book1, + Book2, + BuyNow, + // Chess Benefit Page + mathComputerImg, + mathChampImg, + // Student Inventory + userPortraitCamera, + lineGraphPlaceholder, + activityIcon, + mentorIcon, + learningIcon, + chessLessonsIcon, + gamesIcon, + puzzlesIcon, + playComputerIcon, + recordingsIcon, + backpackIcon, + // Badges + badgeKnight, + badgeQueen, + badgeRook, + badgeKing, + badgePawn, + badgeBishop +>>>>>>> origin/feature/add-static-badge-elements }; export default images; diff --git a/scripts/docker-compose.yml b/scripts/docker-compose.yml index 41cc72ce..9740c588 100644 --- a/scripts/docker-compose.yml +++ b/scripts/docker-compose.yml @@ -4,6 +4,7 @@ networks: ysc-net: external: name: ysc-net + services: nginx: image: nginx:1.19.2-alpine @@ -11,11 +12,8 @@ services: volumes: - ./nginx.conf:/etc/nginx/nginx.conf - /home/azureuser/ysc-2/app.ystemandchess.com/YStemAndChess/dist_new/YStemAndChess:/var/www/html - - /etc/letsencrypt/live/ystemandchess.com/fullchain.pem:/etc/ysc-certs/ysc-cert.pem - - /etc/letsencrypt/live/ystemandchess.com/privkey.pem:/etc/ysc-certs/ysc-key.pem - - /etc/letsencrypt/options-ssl-nginx.conf:/etc/ysc-certs/options-ssl-nginx.conf - - /etc/letsencrypt/ssl-dhparams.pem:/etc/ysc-certs/ysc-dhparam.pem - - /etc/letsencrypt/live/ystemandchess.com/chain.pem:/etc/ysc-certs/ysc-chain.pem + - ./data/certbot/conf:/etc/letsencrypt + - ./data/certbot/www:/var/www/certbot networks: - ysc-net ports: @@ -27,6 +25,16 @@ services: - stockfishserver - chessclient - ystemandchess + + certbot: + image: certbot/certbot + volumes: + - ./data/certbot/conf:/etc/letsencrypt + - ./data/certbot/www:/var/www/certbot + entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" + depends_on: + - nginx + chessserver: image: chessserver:${TAG} container_name: chessserver @@ -36,6 +44,7 @@ services: - ysc-net expose: - "3000" + chessclient: image: chessclient:${TAG} container_name: chessclient @@ -45,6 +54,7 @@ services: - ysc-net expose: - "80" + stockfishserver: image: stockfishserver:${TAG} container_name: stockfishserver @@ -54,6 +64,7 @@ services: - ysc-net expose: - "8080" + middleware: image: middlewarenode container_name: middleware @@ -82,6 +93,7 @@ services: - '8000' volumes: - ../middleware:/var/www/html + ystemandchess: image: ystemandchess:${TAG} container_name: ystemandchess @@ -101,4 +113,4 @@ services: - chessclient - chessserver volumes: - - ../YStemAndChess:/usr/src/app \ No newline at end of file + - ../YStemAndChess:/usr/src/app diff --git a/scripts/nginx.conf b/scripts/nginx.conf index 172c6817..abe21cf0 100644 --- a/scripts/nginx.conf +++ b/scripts/nginx.conf @@ -4,167 +4,143 @@ pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; events { - worker_connections 768; + worker_connections 768; } http { + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE + ssl_prefer_server_ciphers on; + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - - include /etc/nginx/mime.types; - default_type application/octet-stream; + gzip on; + + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + + upstream cclient { + server chessclient:80; + } + + upstream cserver { + server chessserver:3000; + } + + upstream sserver { + server stockfishserver:8080; + } + + server { + listen 80; + server_name ystemandchess.com www.ystemandchess.com; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE - ssl_prefer_server_ciphers on; + location /.well-known/acme-challenge/ { + root /var/www/certbot; + } + location / { + return 301 https://$host$request_uri; + } + } + + server { + root /var/www/html; + index index.html index.htm index.nginx-debian.html; + server_name ystemandchess.com; # managed by Certbot + + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; + + location / { + try_files $uri $uri/ /index.html =404; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $host; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; + location ~ /chessclient { + rewrite ^/chessclient(.*)$ /$1 break; + proxy_pass http://cclient; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header X-Real-IP $remote_addr; + proxy_http_version 1.1; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Connection "upgrade"; + } - + location /socket.io/ { + proxy_pass http://cserver; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } - gzip on; - - map $http_upgrade $connection_upgrade { - default upgrade; - '' close; - } - upstream cclient { - server chessclient:80; - } - - upstream cserver { - server chessserver:3000; - } - - upstream sserver { - server stockfishserver:8080; - } - - server { - root /var/www/html; - - - index index.html index.htm index.nginx-debian.html; - server_name ystemandchess.com; # managed by Certbot - - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; - - location / { - #proxy_pass http://ystemandchess:80; - try_files $uri $uri/ /index.html =404; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $host; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - - } - - location ~ /chessclient { - rewrite ^/chessclient(.*)$ /$1 break; - proxy_pass http://cclient; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - proxy_set_header X-Real-IP $remote_addr; - proxy_http_version 1.1; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - - - proxy_set_header Connection "upgrade"; - } - - location /socket.io/ { -# proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $host; - # proxy_set_header X-NginX-Proxy false; - proxy_pass http://cserver; - # proxy_pass http://localhost:3000; - #proxy_redirect off; - - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - # proxy_read_timeout 300s; - # proxy_connect_timeout 75s; - } - - - location /sockjs-node/ { - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } - - location ~ /chessserver { - rewrite ^/chessserver(.*)$ /$1 break; - - proxy_pass http://cserver; - - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_read_timeout 300; - proxy_connect_timeout 300; - - proxy_http_version 1.1; - } - - location ~ /middleware { - rewrite ^/middleware(.*)$ $1 break; - proxy_pass http://middleware:80; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } - - location ~ /stockfishserver { - proxy_pass http://sserver; - #proxy_pass http://stockfishserver:8080; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - - error_page 405 =200 $uri; - - #listen [::]:443 ssl ipv6only=on; # managed by Certbot - listen 443 ssl; # managed by Certbot - ssl_certificate /etc/ysc-certs/ysc-cert.pem; # managed by Certbot - ssl_certificate_key /etc/ysc-certs/ysc-key.pem; # managed by Certbot - include /etc/ysc-certs/options-ssl-nginx.conf; # managed by Certbot - ssl_dhparam /etc/ysc-certs/ysc-dhparam.pem; # managed by Certbot + location ~ /chessserver { + rewrite ^/chessserver(.*)$ /$1 break; + proxy_pass http://cserver; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 300; + proxy_connect_timeout 300; + proxy_http_version 1.1; } -server { + location ~ /middleware { + rewrite ^/middleware(.*)$ $1 break; + proxy_pass http://middleware:8000; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } + + location ~ /stockfishserver { + proxy_pass http://sserver; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + error_page 405 =200 $uri; + + listen [::]:443 ssl ipv6only=on; # managed by Certbot + listen 443 ssl; # managed by Certbot + ssl_certificate /etc/ysc-certs/ysc-cert.pem; # managed by Certbot + ssl_certificate_key /etc/ysc-certs/ysc-key.pem; # managed by Certbot + include /etc/ysc-certs/options-ssl-nginx.conf; # managed by Certbot + ssl_dhparam /etc/ysc-certs/ysc-dhparam.pem; # managed by Certbot + } + + server { listen [::]:443 ssl ipv6only=on; # managed by Certbot listen 443 ssl; # managed by Certbot ssl_certificate /etc/ysc-certs/ysc-cert.pem; # managed by Certbot ssl_certificate_key /etc/ysc-certs/ysc-key.pem; # managed by Certbot include /etc/ysc-certs/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/ysc-certs/ysc-dhparam.pem; # managed by Certbot - server_name ystemandchess.com www.ystemandchess.com; - return 301 https://ystemandchess.com$request_uri; - } - -server { - listen 80 ; - listen [::]:80 ; - server_name ystemandchess.com www.ystemandchess.com; - return 301 https://ystemandchess.com$request_uri; # managed by Certbot - } + server_name ystemandchess.com www.ystemandchess.com; + return 301 https://ystemandchess.com$request_uri; + } }