Skip to content

Commit

Permalink
Merge pull request #26 from healthy-food-and-dietary-products/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jsapro authored Dec 19, 2023
2 parents 532a258 + 01f45de commit 65b722d
Show file tree
Hide file tree
Showing 270 changed files with 18,907 additions and 270 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Adding this to your .gitattributes file will make it so all files
# are checked in using UNIX line endings while letting anyone on the team
# edit files using their local operating system’s default line endings.
* text=auto
92 changes: 92 additions & 0 deletions .github/workflows/good_food_frontend_workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: good_food_frontend workflow

on:
push:
branches:

jobs:
check_codestyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18.x'
- name: Install and check codestyle
run: |
npm ci
npm run lint:js
npm run lint:styles
npm run lint:prettier
- name: send message
if: ${{ github.ref != 'refs/heads/develop' || github.ref != 'refs/heads/main' }}
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
${{ github.workflow }} completed successfully!
Repository: ${{ github.repository }}.
Branch name: ${{ github.ref_name }}.
Commit author: ${{ github.actor }}.
Commit message: ${{ github.event.commits[0].message }}.
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
build_and_push_to_docker_hub:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'

steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push frontend to Docker Hub
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/good_food_frontend:v.01

deploy:
runs-on: ubuntu-latest
needs: build_and_push_to_docker_hub
steps:
- name: executing remote ssh commands to deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
# passphrase: ${{ secrets.SSH_PASSPHRASE }}
script: |
echo ${{ secrets.SSH_HOST_USER_PASSWORD }} | sudo -S docker compose stop
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/good_food_frontend:v.01
sudo docker compose up -d
echo ${{ secrets.SSH_HOST_USER_PASSWORD }} | sudo -S docker image prune -f
send_message:
runs-on: ubuntu-latest
needs: deploy
steps:
- name: send message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
${{ github.workflow }} completed successfully!
Repository: ${{ github.repository }}.
Branch name: ${{ github.ref_name }}.
Commit author: ${{ github.actor }}.
Commit message: ${{ github.event.commits[0].message }}.
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"trailingComma": "es5",
"singleQuote": true,
"bracketSpacing": true,
"endOfLine": "lf"
"endOfLine": "auto"
}
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-standard-scss"],
"plugins": ["stylelint-scss"],
"rules": {
"selector-class-pattern": null
},
"processors": ["stylelint-scss"],
"ignoreFiles": [
"build/**",
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:20.9.0-alpine as build
WORKDIR /app
COPY package*.json .
RUN npm install
COPY . .
RUN npm run build
CMD cp -r build result_build
28 changes: 3 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
# React + TypeScript + Vite
# GoodFood

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
# Платформа для онлайн-продажи и доставки здоровой пищи и диетических продуктов

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
![good_food_frontend workflow](https://github.com/healthy-food-and-dietary-products/frontend/actions/workflows/good_food_frontend_workflow.yaml/badge.svg)

### Подробная информация по работе с проектом в файле `CONTRIBUTE.MD`
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/favicon-site.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>GooDFooD</title>
</head>
<body>
<div id="root"></div>
<div id="popup"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
10 changes: 10 additions & 0 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ module.exports = {
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'^@images/(.*)$': '<rootDir>/$1', // for path aliases to work
'^@scss/(.*)$': '<rootDir>/$1',
'^@hooks/(.*)$': '<rootDir>/$1',
'^@utils/(.*)$': '<rootDir>/$1',
'^@components/(.*)$': '<rootDir>/$1',
'^@components/ui/(.*)$': '<rootDir>/$1',
'^@contexts/(.*)$': '<rootDir>/$1',
'^@data/(.*)$': '<rootDir>/$1',
'^@layouts/(.*)$': '<rootDir>/$1',
'^@services/(.*)$': '<rootDir>/$1',
'^@pages/(.*)$': '<rootDir>/$1',
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
Expand Down
Loading

0 comments on commit 65b722d

Please sign in to comment.