Skip to content

Commit

Permalink
Merge branch 'julianpoy:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
levyitay authored Feb 3, 2024
2 parents 3da1247 + 213e772 commit df67afb
Show file tree
Hide file tree
Showing 748 changed files with 63,613 additions and 34,036 deletions.
36 changes: 23 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ commands:
- dependency-cache-
- run:
name: install-deps
command: 'npm install'
command: "npm install"
- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
Expand All @@ -33,12 +33,13 @@ jobs:
POSTGRES_HOST: localhost
POSTGRES_SSL: false
POSTGRES_LOGGING: false
DATABASE_URL: postgresql://chefbook:admin@localhost:5432/chefbook_test?connection_limit=5
SEARCH_PROVIDER: none
STORAGE_TYPE: filesystem
FILESYSTEM_STORAGE_PATH: ~/project/rsdata
GRIP_URL: http://localhost:5561/
GRIP_KEY: changeme
- image: postgres:9.6.9
- image: postgres:16.1
environment:
POSTGRES_USER: chefbook
POSTGRES_PASSWORD: admin
Expand All @@ -47,11 +48,21 @@ jobs:
- checkout
- install-dependencies
- run:
name: lint, typecheck, test, build
command: npx nx run-many --targets=lint,ngx-translate-lint,typecheck,test,build
name: prettier
command: npx prettier --check .
- run:
name: migrate
command: npx prisma migrate dev
- run:
name: start api
command: npx ts-node --swc --project packages/backend/tsconfig.json packages/backend/src/bin/www
background: true
- run:
name: tmp
command: ls packages/frontend
name: wait for api
command: dockerize -wait tcp://localhost:3000 -timeout 30s
- run:
name: lint, typecheck, test, build
command: npx nx run-many --targets=lint,typecheck,test,build
push_backend:
resource_class: large
docker:
Expand Down Expand Up @@ -98,16 +109,16 @@ jobs:
- install-dependencies
- run:
name: build-frontend
command: npx nx build @recipesage/frontend
command: npx nx build frontend
- run:
name: move-frontend-build
command: mv packages/frontend/www ./www
- run:
name: set-frontend-version
command: sed -i "s/window.version = 'development';/window.version = '${CIRCLE_TAG:=stg}';/" www/index.html
command: sed -i "s/window.version = \"development\";/window.version = \"${CIRCLE_TAG:=stg}\";/" www/index.html
- run:
name: set-service-worker-version
command: sed -i "s/APP_VERSION = 'development';/APP_VERSION = '${CIRCLE_TAG:=stg}';/" www/service-worker.js
command: sed -i "s/APP_VERSION = \"development\";/APP_VERSION = \"${CIRCLE_TAG:=stg}\";/" www/service-worker.js
- run:
name: webapp-hosted.sh
command: ./scripts/build/webapp-hosted.sh ${CIRCLE_TAG:=stg}
Expand All @@ -130,16 +141,16 @@ jobs:
- install-dependencies
- run:
name: build-frontend
command: npx nx build:selfhost @recipesage/frontend
command: npx nx build:selfhost frontend
- run:
name: move-frontend-build
command: mv packages/frontend/www ./www
- run:
name: set-frontend-version
command: sed -i "s/window.version = 'development';/window.version = '${CIRCLE_TAG:=stg}';/" www/index.html
command: sed -i "s/window.version = \"development\";/window.version = \"${CIRCLE_TAG:=stg}\";/" www/index.html
- run:
name: set-service-worker-version
command: sed -i "s/APP_VERSION = 'development';/APP_VERSION = '${CIRCLE_TAG:=stg}';/" www/service-worker.js
command: sed -i "s/APP_VERSION = \"development\";/APP_VERSION = \"${CIRCLE_TAG:=stg}\";/" www/service-worker.js
- run:
name: webapp-selfhost.sh
command: ./scripts/build/webapp-selfhost.sh ${CIRCLE_TAG:=stg}
Expand Down Expand Up @@ -186,4 +197,3 @@ workflows:
only: /^v[0-9]+(\.[0-9]+)*.*/
branches:
ignore: /.*/

2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**/node_modules
node_modules
**/npm-debug.log
.git
Assets
Expand Down
42 changes: 42 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
}
]
}
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# These are supported funding model platforms
custom: ['https://recipesage.com/#/contribute']
custom: ["https://recipesage.com/#/contribute"]
16 changes: 9 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Bug report
about: Existing functionality that isn't working as expected
title: ''
title: ""
labels: bug
assignees: julianpoy

---

**Describe the bug**
Expand All @@ -15,6 +14,7 @@ A quick description of where the bug is (Meal Plan Page, Shopping List Page, Web

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -27,13 +27,15 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]

**Additional context**
Add any other context about the problem here.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/idea-or-proposal.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Idea or Proposal
about: Suggest a new idea for RecipeSage (general, broad scope, business/org)
title: ''
title: ""
labels: proposal/idea
assignees: julianpoy

---

**Is your idea or proposal related to a problem? Please describe.**
Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/new-feature.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: New Feature
about: Suggest new application functionality (actionable, single, functional)
title: ''
title: ""
labels: feature
assignees: julianpoy

---

**Is your new feature related to a problem? Please describe.**
Expand Down
63 changes: 31 additions & 32 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ "master", "*-maintenance", "beta" ]
branches: ["master", "*-maintenance", "beta"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
branches: ["master"]
schedule:
- cron: '32 20 * * 6'
- cron: "32 20 * * 6"

jobs:
analyze:
Expand All @@ -32,45 +32,44 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
23 changes: 12 additions & 11 deletions .github/workflows/deploy-api-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ jobs:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.tag }}

- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save 43e06009-6d1b-40cb-abbc-38736cc6746c

- name: Deploy
run: ./scripts/deploy/deploy_tag.sh api-beta ${{ inputs.tag }}
- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save 43e06009-6d1b-40cb-abbc-38736cc6746c

- name: Deploy
run: ./scripts/deploy/deploy_tag.sh api-beta ${{ inputs.tag }}
23 changes: 12 additions & 11 deletions .github/workflows/deploy-api-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ jobs:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.tag }}

- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save 43e06009-6d1b-40cb-abbc-38736cc6746c

- name: Deploy
run: ./scripts/deploy/deploy_tag.sh api ${{ inputs.tag }}
- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save 43e06009-6d1b-40cb-abbc-38736cc6746c

- name: Deploy
run: ./scripts/deploy/deploy_tag.sh api ${{ inputs.tag }}
22 changes: 12 additions & 10 deletions .github/workflows/deploy-frontend-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ jobs:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.tag }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Push
run: ./scripts/deploy/deploy_tag.sh static-beta ${{ inputs.tag }}
- name: Push
run: ./scripts/deploy/deploy_tag.sh static-beta ${{ inputs.tag }}
Loading

0 comments on commit df67afb

Please sign in to comment.