Skip to content

Commit

Permalink
Merge pull request #4 from HoseaCodes/main
Browse files Browse the repository at this point in the history
Article Updates
  • Loading branch information
HoseaCodes authored May 2, 2024
2 parents 66a7eb6 + 0083008 commit a1a591d
Show file tree
Hide file tree
Showing 197 changed files with 34,486 additions and 45,167 deletions.
37 changes: 37 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Ignore node_modules directory for Node.js projects
node_modules

# Ignore any development dependencies installed globally
npm-debug.log
yarn-error.log

# Ignore any local environment files
.env

# Ignore any log files
logs

# Ignore any build artifacts
build
dist

# Ignore any temporary files
*.tmp
*.temp
*.swp

# Ignore any editor-specific files or directories
.vscode
.idea

# Ignore any Docker-related files
.dockerignore
.docker
.dockerignore.example

# Ignore any git-related files
.git
.gitignore

# Ignore any macOS-specific files
.DS_Store
11 changes: 11 additions & 0 deletions .env example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SKIP_PREFLIGHT_CHECK=
MONGODB_URL=
FOREMAPI=
MEDIUMAPI=
MEDIUMUSER=
ACCESS_TOKEN_SECRET=
REFRESH_TOKEN_SECRET=
CLOUD_API_KEY=
CLOUD_API_SECRET=
CLOUND_NAME=
REACT_APP_VITE_Open_AI_Key=
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"rules": {
"padded-blocks": "off"
},
// "extends": ["airbnb-base", "eslint:recommended", "plugin:react/recommended"]
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
}
}
76 changes: 76 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Dev Pipeline
on:
push:
branches:
- main
jobs:
static-scan:
runs-on: ubuntu-latest
env:
JSON_OUTPUT: snyk-static-scan.json
steps:
- uses: actions/checkout@master
- uses: snyk/actions/setup@master
- uses: actions/setup-go@v1
- name: Run Snyk to check for vulnerabilities
continue-on-error: true
run: |
snyk code test
snyk-to-html -i $JSON_OUTPUT -o snyk.html
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Archive snyk results
uses: actions/upload-artifact@v3
with:
name: snyk-report
path: output/scan/snyk.html
retention-days: 5
dependency-scan:
runs-on: ubuntu-latest
env:
JSON_OUTPUT: snyk-dependency-scan.json
steps:
- uses: actions/checkout@master
- uses: snyk/actions/setup@master
- uses: actions/setup-go@v1
- name: Run Snyk to check for vulnerabilities
continue-on-error: true
run: |
snyk test
snyk-to-html -i $JSON_OUTPUT -o snyk.html
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Archive snyk results
uses: actions/upload-artifact@v3
with:
name: snyk-report
path: output/scan/snyk.html
retention-days: 5
lint:
needs: [static-scan, dependency-scan]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm i --legacy-peer-deps
- name: lint
continue-on-error: true
run: npm run lint
build:
needs: [static-scan, dependency-scan, lint]
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install Dependencies
run: npm install --legacy-peer-deps
- name: Deploy to Heroku
run: |
git remote add heroku https://git.heroku.com/hoseacodes-dev.git
git push heroku main
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}

17 changes: 17 additions & 0 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Snyk Scan
on:
push:
branches:
- master
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ test/db.js
src/.eslintrc.js

.env-cmdrc

test/coverage

animation
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
11 changes: 11 additions & 0 deletions .storybook/main.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
"stories": [
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/preset-create-react-app"
]
}
4 changes: 4 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
}
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use the official Node.js 14 image as base
FROM node:20

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./

# Install dependencies
RUN npm install --legacy-peer-deps

# Copy the rest of the application code
COPY . .

# Build the React app
RUN npm run build

# Expose the port the app runs on
EXPOSE 3000

# Set environment variables from .env file
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}

# Copy .env file to the working directory
COPY .env .

# Run the backend server
CMD ["node", "server.js"]
Loading

0 comments on commit a1a591d

Please sign in to comment.