diff --git a/.gitignore b/.gitignore index 4d29575..1be3c69 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies -/node_modules +node_modules /.pnp .pnp.js @@ -21,3 +21,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +__pycache__ +venv \ No newline at end of file diff --git a/README.md b/README.md index 852273b..1324338 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,15 @@ -# Pizza Day +# Luncher Zatím to nemá dokumentaci. -Klient je v tomto adresáři, server v adresáři /server, obojí lze spustit pomocí: +Server je v adresáři /server, client v adresáři /client obojí lze spustit pomocí: ### `yarn` ### `yarn start` + +## TODO +- Popsat Food API, nginx +- Popsat spuštění pro vývoj +- Vyndat URL na Food API do .env +- Neselhat při nedostupnosti nebo chybě z Food API +- Dokončit docker-compose pro kompletní funkčnost +- Implementovat pizza day \ No newline at end of file diff --git a/client/.dockerignore b/client/.dockerignore new file mode 100644 index 0000000..aaefa8f --- /dev/null +++ b/client/.dockerignore @@ -0,0 +1,3 @@ +**/node_modules +**/npm-debug.log +build \ No newline at end of file diff --git a/client/.env.production b/client/.env.production new file mode 100644 index 0000000..ccaad5e --- /dev/null +++ b/client/.env.production @@ -0,0 +1 @@ +PUBLIC_URL=http://192.168.1.106:3005 \ No newline at end of file diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 0000000..c795b05 --- /dev/null +++ b/client/.gitignore @@ -0,0 +1 @@ +build \ No newline at end of file diff --git a/client/Dockerfile b/client/Dockerfile new file mode 100644 index 0000000..35ff2cd --- /dev/null +++ b/client/Dockerfile @@ -0,0 +1,23 @@ +FROM node:alpine AS builder + +COPY package.json . +COPY yarn.lock . +COPY tsconfig.json . +COPY .env.production . + +RUN yarn install + +COPY ./src ./src +COPY ./public ./public + +RUN yarn build + +FROM node:alpine +ENV NODE_ENV production + +WORKDIR /app + +COPY --from=builder /build . + +RUN yarn global add serve && yarn +CMD ["serve", "-s", "."] \ No newline at end of file diff --git a/client/build.sh b/client/build.sh new file mode 100755 index 0000000..ea33823 --- /dev/null +++ b/client/build.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker build -t luncher-client . \ No newline at end of file diff --git a/package.json b/client/package.json similarity index 92% rename from package.json rename to client/package.json index 284995f..939b02a 100644 --- a/package.json +++ b/client/package.json @@ -1,6 +1,7 @@ { - "name": "luncher", + "name": "luncher-client", "version": "0.1.0", + "license": "MIT", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.16.5", @@ -15,6 +16,7 @@ "react-bootstrap": "^2.7.2", "react-dom": "^18.2.0", "react-scripts": "5.0.1", + "socket.io-client": "^4.6.1", "typescript": "^4.9.5", "web-vitals": "^2.1.4" }, @@ -42,4 +44,4 @@ "last 1 safari version" ] } -} +} \ No newline at end of file diff --git a/public/favicon.ico b/client/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to client/public/favicon.ico diff --git a/public/index.html b/client/public/index.html similarity index 62% rename from public/index.html rename to client/public/index.html index aa069f2..8302a97 100644 --- a/public/index.html +++ b/client/public/index.html @@ -1,21 +1,19 @@ -
- - - - - - - - - -