From 658c45fe781c2b254febd0945ebfea86d693c754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Domonkos?= <144695310+IvnDmnks@users.noreply.github.com> Date: Sat, 12 Oct 2024 00:29:10 +0200 Subject: [PATCH] Feat/adjustment (#14) * fixed gitignore * added docker * adjustments --- .gitignore | 1 + apps/backend/Dockerfile | 40 +++++++++++++ apps/backend/docker-compose.yaml | 32 ++++++++++ .../app/(with-layout)/currentjobs/page.tsx | 2 +- .../frontend/src/app/(with-layout)/layout.tsx | 3 +- .../src/app/(with-layout)/newproject/page.tsx | 8 +-- .../{(with-layout) => }/afterlogin/page.tsx | 2 +- apps/frontend/src/components/AfterLogin.tsx | 8 +-- apps/frontend/src/components/CurrentJobs.tsx | 8 +-- apps/frontend/src/components/Navbar.tsx | 6 -- apps/frontend/src/components/NewProject.tsx | 2 +- .../src/components/ReportingPeriod.tsx | 4 +- apps/frontend/src/components/footer.tsx | 4 +- apps/frontend/src/components/section.tsx | 7 +++ yarn.lock | 58 ++++++++++++++++--- 15 files changed, 148 insertions(+), 37 deletions(-) create mode 100644 apps/backend/Dockerfile create mode 100644 apps/backend/docker-compose.yaml rename apps/frontend/src/app/{(with-layout) => }/afterlogin/page.tsx (73%) create mode 100644 apps/frontend/src/components/section.tsx diff --git a/.gitignore b/.gitignore index cfdcbda..f1175b1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* .DS_Store +.env diff --git a/apps/backend/Dockerfile b/apps/backend/Dockerfile new file mode 100644 index 0000000..ea886b8 --- /dev/null +++ b/apps/backend/Dockerfile @@ -0,0 +1,40 @@ +# Stage 1: Build the application +# Use the official Node.js LTS (Long Term Support) image as the base image +FROM node:20-alpine AS build +ENV NODE_ENV=development + +# Set the working directory inside the container +WORKDIR /app + +# Copy package.json and yarn.lock to the container +COPY package.json ./ + +# Install the project dependencies using Yarn +RUN yarn install +COPY . . +RUN yarn prisma generate + +# Copy the rest of the project files to the container + +# Build the NestJS application +RUN yarn build + +# Stage 2: Create a lightweight container with the built application +FROM node:20-alpine AS production +ENV NODE_ENV=production + +# Set the working directory inside the container +WORKDIR /app + +# Copy the built application from the previous stage +COPY --from=build /app/dist ./dist +COPY --from=build /app/package.json ./package.json +COPY --from=build /app/yarn.lock ./yarn.lock +COPY --from=build /app/prisma ./prisma + +# Install only production dependencies +RUN yarn install --production --frozen-lockfile +RUN yarn prisma generate + +# Command to run the application +CMD ["node", "dist/main"] diff --git a/apps/backend/docker-compose.yaml b/apps/backend/docker-compose.yaml new file mode 100644 index 0000000..42cc6ac --- /dev/null +++ b/apps/backend/docker-compose.yaml @@ -0,0 +1,32 @@ +name: sprint-review + +services: + app: + build: + context: . + ports: + - '${BACKEND_PORT}:${BACKEND_PORT}' + env_file: + - .env + restart: always + networks: + - sprint-review-network + depends_on: + - db + + db: + image: postgres:13.10 + env_file: + - .env + restart: always + volumes: + - sprint-review_db_folder:/var/lib/postgresql/data + networks: + - sprint-review-network + +volumes: + sprint-review_db_folder: + external: true + +networks: + sprint-review-network: diff --git a/apps/frontend/src/app/(with-layout)/currentjobs/page.tsx b/apps/frontend/src/app/(with-layout)/currentjobs/page.tsx index 31d21c8..ad8b87e 100644 --- a/apps/frontend/src/app/(with-layout)/currentjobs/page.tsx +++ b/apps/frontend/src/app/(with-layout)/currentjobs/page.tsx @@ -2,7 +2,7 @@ import CurrentJobs from '../../../components/CurrentJobs'; export default function Home() { return ( -
+
); diff --git a/apps/frontend/src/app/(with-layout)/layout.tsx b/apps/frontend/src/app/(with-layout)/layout.tsx index 273c984..1ab979d 100644 --- a/apps/frontend/src/app/(with-layout)/layout.tsx +++ b/apps/frontend/src/app/(with-layout)/layout.tsx @@ -1,5 +1,6 @@ import { Footer } from '../../components/Footer'; import Navbar from '../../components/Navbar'; +import Section from '../../components/section'; export default function Layout({ children, @@ -9,7 +10,7 @@ export default function Layout({ return (
- {children} +
{children}
); diff --git a/apps/frontend/src/app/(with-layout)/newproject/page.tsx b/apps/frontend/src/app/(with-layout)/newproject/page.tsx index 70567d8..b674c44 100644 --- a/apps/frontend/src/app/(with-layout)/newproject/page.tsx +++ b/apps/frontend/src/app/(with-layout)/newproject/page.tsx @@ -1,9 +1,5 @@ -import SprintLogin from '../../../components/NewProject'; +import NewProject from '../../../components/NewProject'; export default function Home() { - return ( -
- -
- ); + return ; } diff --git a/apps/frontend/src/app/(with-layout)/afterlogin/page.tsx b/apps/frontend/src/app/afterlogin/page.tsx similarity index 73% rename from apps/frontend/src/app/(with-layout)/afterlogin/page.tsx rename to apps/frontend/src/app/afterlogin/page.tsx index a9320ff..c13df5a 100644 --- a/apps/frontend/src/app/(with-layout)/afterlogin/page.tsx +++ b/apps/frontend/src/app/afterlogin/page.tsx @@ -1,4 +1,4 @@ -import AfterLogin from '../../../components/AfterLogin'; +import AfterLogin from '../../components/AfterLogin'; export default function Home() { return ( diff --git a/apps/frontend/src/components/AfterLogin.tsx b/apps/frontend/src/components/AfterLogin.tsx index 0e73067..509e7cc 100644 --- a/apps/frontend/src/components/AfterLogin.tsx +++ b/apps/frontend/src/components/AfterLogin.tsx @@ -45,13 +45,11 @@ export default function GreetingsPage() { -
Profil
-

- Itt láthatod a korábbi beszámolóidat, és a profilodat is itt tudod szerkeszteni. -

+
Új Projekt
+

Itt tudsz új projeket nyitni.

diff --git a/apps/frontend/src/components/CurrentJobs.tsx b/apps/frontend/src/components/CurrentJobs.tsx index bebd2b6..2ac5ab6 100644 --- a/apps/frontend/src/components/CurrentJobs.tsx +++ b/apps/frontend/src/components/CurrentJobs.tsx @@ -19,13 +19,13 @@ export default function CurrentJobs() { }, []); return ( -
-
-

+
+
+

Munkák

-
+
diff --git a/apps/frontend/src/components/Navbar.tsx b/apps/frontend/src/components/Navbar.tsx index cfb44e4..132db9b 100644 --- a/apps/frontend/src/components/Navbar.tsx +++ b/apps/frontend/src/components/Navbar.tsx @@ -20,12 +20,6 @@ export default function Navbar() { > Munkák - - Profil - ); diff --git a/apps/frontend/src/components/NewProject.tsx b/apps/frontend/src/components/NewProject.tsx index 6176aa5..9a6d78a 100644 --- a/apps/frontend/src/components/NewProject.tsx +++ b/apps/frontend/src/components/NewProject.tsx @@ -36,7 +36,7 @@ export default function NewProject() { }; return ( -
+

Új Projekt Létrehozása diff --git a/apps/frontend/src/components/ReportingPeriod.tsx b/apps/frontend/src/components/ReportingPeriod.tsx index a5669f1..916120d 100644 --- a/apps/frontend/src/components/ReportingPeriod.tsx +++ b/apps/frontend/src/components/ReportingPeriod.tsx @@ -1,12 +1,12 @@ export function ReportingPeriod() { return ( -
+

Beszámolási időszakok

-
+

diff --git a/apps/frontend/src/components/footer.tsx b/apps/frontend/src/components/footer.tsx index bc9bb22..f088513 100644 --- a/apps/frontend/src/components/footer.tsx +++ b/apps/frontend/src/components/footer.tsx @@ -1,7 +1,7 @@ export function Footer() { return ( -
-

@Kir-Dev pod-oscar

+
+

@Kir-Dev pod-oscar

); } diff --git a/apps/frontend/src/components/section.tsx b/apps/frontend/src/components/section.tsx new file mode 100644 index 0000000..a68020c --- /dev/null +++ b/apps/frontend/src/components/section.tsx @@ -0,0 +1,7 @@ +export default function Section({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return
{children}
; +} diff --git a/yarn.lock b/yarn.lock index f330637..bd2dc13 100644 --- a/yarn.lock +++ b/yarn.lock @@ -489,6 +489,11 @@ resolved "https://registry.npmjs.org/@prisma/client/-/client-5.16.1.tgz" integrity sha512-wM9SKQjF0qLxdnOZIVAIMKiz6Hu7vDt4FFAih85K1dk/Rr2mdahy6d3QP41K62N9O0DJJA//gUDA3Mp49xsKIg== +"@prisma/client@^5.20.0": + version "5.20.0" + resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.20.0.tgz#4fc9f2b2341c9c997c139df4445688dd6b39663b" + integrity sha512-CLv55ZuMuUawMsxoqxGtLT3bEZoa2W8L3Qnp6rDIFWy+ZBrUcOFKdoeGPSnbBqxc3SkdxJrF+D1veN/WNynZYA== + "@prisma/debug@5.16.1": version "5.16.1" resolved "https://registry.npmjs.org/@prisma/debug/-/debug-5.16.1.tgz" @@ -1259,6 +1264,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + any-promise@^1.0.0: version "1.3.0" resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz" @@ -1491,7 +1501,7 @@ axobject-query@^3.2.1: "@nestjs/platform-express" "^10.3.8" "@nestjs/swagger" "^7.4.2" "@prisma/client" "^5.13.0" - backend "file:../../../../AppData/Local/Yarn/Cache/v6/npm-backend-0.0.0-9d2570a7-2db9-4bab-a398-809332deec43-1728678325607/node_modules/backend" + backend "file:../../../../AppData/Local/Yarn/Cache/v6/npm-backend-0.0.0-ac0052a7-5985-4d36-9fc7-686a319fc1dc-1728681736380/node_modules/backend" class-transformer "^0.5.1" class-validator "^0.14.1" nestjs-prisma "^0.23.0" @@ -2154,6 +2164,11 @@ dotenv@16.4.5: resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz" integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ecdsa-sig-formatter@1.0.11: version "1.0.11" resolved "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz" @@ -2904,7 +2919,7 @@ fresh@0.5.2: axios "^1.7.7" class-variance-authority "^0.7.0" clsx "^2.1.0" - frontend "file:../../../../AppData/Local/Yarn/Cache/v6/npm-frontend-0.0.0-3deb19b8-f568-4a87-b4d9-42f343199435-1728678325617/node_modules/frontend" + frontend "file:../../../../AppData/Local/Yarn/Cache/v6/npm-frontend-0.0.0-ce6b1947-96ab-4fef-ac7f-cfa0704af895-1728681736387/node_modules/frontend" lucide-react "^0.372.0" next "14.2.2" react "^18.2.0" @@ -4133,7 +4148,7 @@ nestjs-prisma@^0.23.0: "@kir-dev/passport-authsch" "^2.1.0" axios "^1.7.2" bcrypt "^5.1.1" - next-nest-template "file:../../../../AppData/Local/Yarn/Cache/v6/npm-next-nest-template-0.0.0-567f1867-bd30-4379-9091-1a038b392b38-1728678325397/node_modules/next-nest-template" + next-nest-template "file:../../../../AppData/Local/Yarn/Cache/v6/npm-next-nest-template-0.0.0-2053e885-8d11-48e8-a27f-969e2563da43-1728681736386/node_modules/next-nest-template" react-router-dom "^6.23.1" next@14.2.2: @@ -5233,7 +5248,7 @@ streamsearch@^1.1.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@4.1.0, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3, string-width@^5.1.2: +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.1.0.tgz#ba846d1daa97c3c596155308063e075ed1c99aff" integrity sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ== @@ -5242,6 +5257,24 @@ string-width@4.1.0, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, s is-fullwidth-code-point "^3.0.0" strip-ansi "^5.2.0" +string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.matchall@^4.0.10: version "4.0.11" resolved "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz" @@ -5948,15 +5981,24 @@ wide-align@^1.1.2: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@7.0.0, wrap-ansi@^6.0.1, wrap-ansi@^6.2.0, wrap-ansi@^8.1.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== +wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== dependencies: ansi-styles "^4.0.0" string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz"