diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml new file mode 100644 index 0000000..90a4898 --- /dev/null +++ b/.forgejo/workflows/demo.yaml @@ -0,0 +1,53 @@ +name: Build, Test and Push Flask App + +on: + push: + branches: [ main, master ] + +jobs: + docker-build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Docker CLI + run: | + apt-get update + apt-get install -y docker.io + docker --version + + - name: Configure Docker CLI for insecure registry + run: | + mkdir -p ~/.docker + echo '{"insecure-registries" : ["git.rustprogersteam.ru"]}' > ~/.docker/config.json + cat ~/.docker/config.json + + - name: 'Docker Tags' + id: tags + uses: https://github.com/cssnr/docker-tags-action@v2 + with: + images: 'git.rustprogersteam.ru/pvhproject/pvhfrontend/' + + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: git.rustprogersteam.ru + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + git.rustprogersteam.ru/pvhproject/pvhfrontend/pvh:latest + git.rustprogersteam.ru/pvhproject/pvhfrontend/pvh:${{ github.sha }} + labels: ${{ steps.tags.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/front/.gitignore b/.gitignore similarity index 100% rename from front/.gitignore rename to .gitignore diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3b74df8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM mkenney/npm:node-11-alpine + +WORKDIR /web/app + +COPY . . + +RUN npm install +RUN npm cache clean --force + +CMD ["npm", "run", "dev"] diff --git a/front/README.md b/README.md similarity index 100% rename from front/README.md rename to README.md diff --git a/front/eslint.config.js b/eslint.config.js similarity index 100% rename from front/eslint.config.js rename to eslint.config.js diff --git a/front/vite.config.ts b/front/vite.config.ts deleted file mode 100644 index 705517a..0000000 --- a/front/vite.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react' - -// https://vite.dev/config/ -export default defineConfig({ - plugins: [react()], - server: { - port: 5173, - host: true, // попробуйте добавить эту строку - } -}) diff --git a/front/index.html b/index.html similarity index 100% rename from front/index.html rename to index.html diff --git a/front/package-lock.json b/package-lock.json similarity index 100% rename from front/package-lock.json rename to package-lock.json diff --git a/front/package.json b/package.json similarity index 100% rename from front/package.json rename to package.json diff --git a/front/src/App.css b/src/App.css similarity index 100% rename from front/src/App.css rename to src/App.css diff --git a/front/src/api/catalogApi.ts b/src/api/catalogApi.ts similarity index 100% rename from front/src/api/catalogApi.ts rename to src/api/catalogApi.ts diff --git a/front/src/api/client.ts b/src/api/client.ts similarity index 100% rename from front/src/api/client.ts rename to src/api/client.ts diff --git a/front/src/app/hooks.ts b/src/app/hooks.ts similarity index 100% rename from front/src/app/hooks.ts rename to src/app/hooks.ts diff --git a/front/src/app/routes.tsx b/src/app/routes.tsx similarity index 100% rename from front/src/app/routes.tsx rename to src/app/routes.tsx diff --git a/front/src/app/store.ts b/src/app/store.ts similarity index 100% rename from front/src/app/store.ts rename to src/app/store.ts diff --git a/front/src/assets/images/Logo.jpg b/src/assets/images/Logo.jpg similarity index 100% rename from front/src/assets/images/Logo.jpg rename to src/assets/images/Logo.jpg diff --git a/front/src/assets/images/mainPage/296170994030930.jpg b/src/assets/images/mainPage/296170994030930.jpg similarity index 100% rename from front/src/assets/images/mainPage/296170994030930.jpg rename to src/assets/images/mainPage/296170994030930.jpg diff --git a/front/src/assets/images/mainPage/ChatGPT-Image-Oct-1_-2025_-05_29_18-PM.png b/src/assets/images/mainPage/ChatGPT-Image-Oct-1_-2025_-05_29_18-PM.png similarity index 100% rename from front/src/assets/images/mainPage/ChatGPT-Image-Oct-1_-2025_-05_29_18-PM.png rename to src/assets/images/mainPage/ChatGPT-Image-Oct-1_-2025_-05_29_18-PM.png diff --git a/front/src/assets/images/mainPage/_.jpg b/src/assets/images/mainPage/_.jpg similarity index 100% rename from front/src/assets/images/mainPage/_.jpg rename to src/assets/images/mainPage/_.jpg diff --git a/front/src/assets/images/mainPage/category_internal1.jpg b/src/assets/images/mainPage/category_internal1.jpg similarity index 100% rename from front/src/assets/images/mainPage/category_internal1.jpg rename to src/assets/images/mainPage/category_internal1.jpg diff --git a/front/src/assets/images/mainPage/category_internal2.jpg b/src/assets/images/mainPage/category_internal2.jpg similarity index 100% rename from front/src/assets/images/mainPage/category_internal2.jpg rename to src/assets/images/mainPage/category_internal2.jpg diff --git a/front/src/assets/images/mainPage/orig.jpg b/src/assets/images/mainPage/orig.jpg similarity index 100% rename from front/src/assets/images/mainPage/orig.jpg rename to src/assets/images/mainPage/orig.jpg diff --git a/front/src/components/Banner/Banner.module.css b/src/components/Banner/Banner.module.css similarity index 100% rename from front/src/components/Banner/Banner.module.css rename to src/components/Banner/Banner.module.css diff --git a/front/src/components/Banner/Banner.tsx b/src/components/Banner/Banner.tsx similarity index 100% rename from front/src/components/Banner/Banner.tsx rename to src/components/Banner/Banner.tsx diff --git a/front/src/components/Button/Button.module.css b/src/components/Button/Button.module.css similarity index 100% rename from front/src/components/Button/Button.module.css rename to src/components/Button/Button.module.css diff --git a/front/src/components/Button/Button.tsx b/src/components/Button/Button.tsx similarity index 100% rename from front/src/components/Button/Button.tsx rename to src/components/Button/Button.tsx diff --git a/front/src/components/Categories/Categories.module.css b/src/components/Categories/Categories.module.css similarity index 100% rename from front/src/components/Categories/Categories.module.css rename to src/components/Categories/Categories.module.css diff --git a/front/src/components/Categories/Categories.tsx b/src/components/Categories/Categories.tsx similarity index 100% rename from front/src/components/Categories/Categories.tsx rename to src/components/Categories/Categories.tsx diff --git a/front/src/components/ContactProduct/ContactProduct.module.css b/src/components/ContactProduct/ContactProduct.module.css similarity index 100% rename from front/src/components/ContactProduct/ContactProduct.module.css rename to src/components/ContactProduct/ContactProduct.module.css diff --git a/front/src/components/ContactProduct/ContactProduct.tsx b/src/components/ContactProduct/ContactProduct.tsx similarity index 100% rename from front/src/components/ContactProduct/ContactProduct.tsx rename to src/components/ContactProduct/ContactProduct.tsx diff --git a/front/src/components/Footer/Footer.module.css b/src/components/Footer/Footer.module.css similarity index 100% rename from front/src/components/Footer/Footer.module.css rename to src/components/Footer/Footer.module.css diff --git a/front/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx similarity index 100% rename from front/src/components/Footer/Footer.tsx rename to src/components/Footer/Footer.tsx diff --git a/front/src/components/Header/Header.module.css b/src/components/Header/Header.module.css similarity index 100% rename from front/src/components/Header/Header.module.css rename to src/components/Header/Header.module.css diff --git a/front/src/components/Header/Header.tsx b/src/components/Header/Header.tsx similarity index 100% rename from front/src/components/Header/Header.tsx rename to src/components/Header/Header.tsx diff --git a/front/src/components/ModalRequestForm/ModalRequestForm.module.css b/src/components/ModalRequestForm/ModalRequestForm.module.css similarity index 100% rename from front/src/components/ModalRequestForm/ModalRequestForm.module.css rename to src/components/ModalRequestForm/ModalRequestForm.module.css diff --git a/front/src/components/ModalRequestForm/ModalRequestForm.tsx b/src/components/ModalRequestForm/ModalRequestForm.tsx similarity index 100% rename from front/src/components/ModalRequestForm/ModalRequestForm.tsx rename to src/components/ModalRequestForm/ModalRequestForm.tsx diff --git a/front/src/components/PriceLisForm/PriceLisForm.module.css b/src/components/PriceLisForm/PriceLisForm.module.css similarity index 100% rename from front/src/components/PriceLisForm/PriceLisForm.module.css rename to src/components/PriceLisForm/PriceLisForm.module.css diff --git a/front/src/components/PriceLisForm/PriceLisForm.tsx b/src/components/PriceLisForm/PriceLisForm.tsx similarity index 100% rename from front/src/components/PriceLisForm/PriceLisForm.tsx rename to src/components/PriceLisForm/PriceLisForm.tsx diff --git a/front/src/components/QuestionsBlock/QuestionsBlock.module.css b/src/components/QuestionsBlock/QuestionsBlock.module.css similarity index 100% rename from front/src/components/QuestionsBlock/QuestionsBlock.module.css rename to src/components/QuestionsBlock/QuestionsBlock.module.css diff --git a/front/src/components/QuestionsBlock/QuestionsBlock.tsx b/src/components/QuestionsBlock/QuestionsBlock.tsx similarity index 100% rename from front/src/components/QuestionsBlock/QuestionsBlock.tsx rename to src/components/QuestionsBlock/QuestionsBlock.tsx diff --git a/front/src/features/MainPage/MainPage.module.css b/src/features/MainPage/MainPage.module.css similarity index 100% rename from front/src/features/MainPage/MainPage.module.css rename to src/features/MainPage/MainPage.module.css diff --git a/front/src/features/MainPage/PhoneRequest.tsx b/src/features/MainPage/PhoneRequest.tsx similarity index 100% rename from front/src/features/MainPage/PhoneRequest.tsx rename to src/features/MainPage/PhoneRequest.tsx diff --git a/front/src/features/catalog/Catalog.module.css b/src/features/catalog/Catalog.module.css similarity index 100% rename from front/src/features/catalog/Catalog.module.css rename to src/features/catalog/Catalog.module.css diff --git a/front/src/features/catalog/CategoriesGrid.tsx b/src/features/catalog/CategoriesGrid.tsx similarity index 100% rename from front/src/features/catalog/CategoriesGrid.tsx rename to src/features/catalog/CategoriesGrid.tsx diff --git a/front/src/features/catalog/CategoryCards.tsx b/src/features/catalog/CategoryCards.tsx similarity index 100% rename from front/src/features/catalog/CategoryCards.tsx rename to src/features/catalog/CategoryCards.tsx diff --git a/front/src/features/catalog/CategoryFilters.tsx b/src/features/catalog/CategoryFilters.tsx similarity index 100% rename from front/src/features/catalog/CategoryFilters.tsx rename to src/features/catalog/CategoryFilters.tsx diff --git a/front/src/features/catalog/Pagination.tsx b/src/features/catalog/Pagination.tsx similarity index 100% rename from front/src/features/catalog/Pagination.tsx rename to src/features/catalog/Pagination.tsx diff --git a/front/src/features/catalog/ProductCard.tsx b/src/features/catalog/ProductCard.tsx similarity index 100% rename from front/src/features/catalog/ProductCard.tsx rename to src/features/catalog/ProductCard.tsx diff --git a/front/src/features/catalog/ProductGrid.tsx b/src/features/catalog/ProductGrid.tsx similarity index 100% rename from front/src/features/catalog/ProductGrid.tsx rename to src/features/catalog/ProductGrid.tsx diff --git a/front/src/features/catalog/SidebarCategories.tsx b/src/features/catalog/SidebarCategories.tsx similarity index 100% rename from front/src/features/catalog/SidebarCategories.tsx rename to src/features/catalog/SidebarCategories.tsx diff --git a/front/src/features/catalog/categoriesSlice.ts b/src/features/catalog/categoriesSlice.ts similarity index 100% rename from front/src/features/catalog/categoriesSlice.ts rename to src/features/catalog/categoriesSlice.ts diff --git a/front/src/features/catalog/productsSlice.ts b/src/features/catalog/productsSlice.ts similarity index 100% rename from front/src/features/catalog/productsSlice.ts rename to src/features/catalog/productsSlice.ts diff --git a/front/src/index.css b/src/index.css similarity index 100% rename from front/src/index.css rename to src/index.css diff --git a/front/src/main.tsx b/src/main.tsx similarity index 100% rename from front/src/main.tsx rename to src/main.tsx diff --git a/front/src/pages/About/About.module.css b/src/pages/About/About.module.css similarity index 100% rename from front/src/pages/About/About.module.css rename to src/pages/About/About.module.css diff --git a/front/src/pages/About/About.tsx b/src/pages/About/About.tsx similarity index 100% rename from front/src/pages/About/About.tsx rename to src/pages/About/About.tsx diff --git a/front/src/pages/ItemPage/ItemPage.module.css b/src/pages/ItemPage/ItemPage.module.css similarity index 100% rename from front/src/pages/ItemPage/ItemPage.module.css rename to src/pages/ItemPage/ItemPage.module.css diff --git a/front/src/pages/ItemPage/ItemPage.tsx b/src/pages/ItemPage/ItemPage.tsx similarity index 100% rename from front/src/pages/ItemPage/ItemPage.tsx rename to src/pages/ItemPage/ItemPage.tsx diff --git a/front/src/pages/Layout/Layout.module.css b/src/pages/Layout/Layout.module.css similarity index 100% rename from front/src/pages/Layout/Layout.module.css rename to src/pages/Layout/Layout.module.css diff --git a/front/src/pages/Layout/Layout.tsx b/src/pages/Layout/Layout.tsx similarity index 100% rename from front/src/pages/Layout/Layout.tsx rename to src/pages/Layout/Layout.tsx diff --git a/front/src/pages/Main/Main.module.css b/src/pages/Main/Main.module.css similarity index 100% rename from front/src/pages/Main/Main.module.css rename to src/pages/Main/Main.module.css diff --git a/front/src/pages/Main/Main.tsx b/src/pages/Main/Main.tsx similarity index 100% rename from front/src/pages/Main/Main.tsx rename to src/pages/Main/Main.tsx diff --git a/front/src/pages/Products/Products.module.css b/src/pages/Products/Products.module.css similarity index 100% rename from front/src/pages/Products/Products.module.css rename to src/pages/Products/Products.module.css diff --git a/front/src/pages/Products/Products.tsx b/src/pages/Products/Products.tsx similarity index 100% rename from front/src/pages/Products/Products.tsx rename to src/pages/Products/Products.tsx diff --git a/front/src/types/categories.ts b/src/types/categories.ts similarity index 100% rename from front/src/types/categories.ts rename to src/types/categories.ts diff --git a/front/src/types/product.ts b/src/types/product.ts similarity index 100% rename from front/src/types/product.ts rename to src/types/product.ts diff --git a/front/tsconfig.app.json b/tsconfig.app.json similarity index 100% rename from front/tsconfig.app.json rename to tsconfig.app.json diff --git a/front/tsconfig.json b/tsconfig.json similarity index 100% rename from front/tsconfig.json rename to tsconfig.json diff --git a/front/tsconfig.node.json b/tsconfig.node.json similarity index 100% rename from front/tsconfig.node.json rename to tsconfig.node.json diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..13122b5 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,18 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [react()], + server: { + host: '0.0.0.0', // Слушаем все интерфейсы + port: 5173, + allowedHosts: ['rustprogersteam.ru'], + strictPort: true, // Запрещаем автоматический выбор порта + hmr: { + clientPort: 5173, // Важно для HMR в Docker + }, + // Разрешаем CORS для внешних запросов + cors: true + } +})