Skip to content

Commit

Permalink
Merge pull request #61 from edenia/feat/update-dependencies
Browse files Browse the repository at this point in the history
Update Dependencies
  • Loading branch information
xavier506 committed Sep 7, 2023
2 parents 2ebdf50 + 7b5f65c commit 5383f14
Show file tree
Hide file tree
Showing 50 changed files with 1,388 additions and 2,698 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ HASURA_GRAPHQL_ACTION_BASE_URL=http://hapi:9090
# hapi
HAPI_SERVER_PORT=9090
HAPI_SERVER_ADDRESS=hapi
HAPI_NETWORK_API=http://jungle.edenia.cloud
HAPI_NETWORK_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840
HAPI_NETWORK_API=https://jungle.edenia.cloud
HAPI_NETWORK_CHAIN_ID=73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d
HAPI_NETWORK_BASE_ACCOUNT=accountname1
HAPI_NETWORK_BASE_PASSWORD=PW...
HAPI_NETWORK_WALLET_URL=http://wallet:8888
Expand All @@ -34,5 +34,5 @@ NEXT_PUBLIC_UAL_APP_NAME=BoilerplateWebApp
NEXT_PUBLIC_UAL_API_PROTOCOL=https
NEXT_PUBLIC_UAL_API_HOST=jungle.edenia.cloud
NEXT_PUBLIC_UAL_API_PORT=443
NEXT_PUBLIC_UAL_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840
NEXT_PUBLIC_UAL_CHAIN_ID=73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d
NEXT_PUBLIC_HASURA_URL=http://localhost:8080/v1/graphql
8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"prettier.prettierPath": "./webapp/.yarn/sdks/prettier/index.js"
}
}
85 changes: 42 additions & 43 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,76 +1,75 @@
version: '3.8'
version: "3.8"
services:
wallet:
container_name: 'wallet'
container_name: "wallet"
build: ./wallet
ports:
- '8888:8888'
- "8888:8888"
volumes:
- ./tmp/wallet/:/opt/application/data/
postgres:
container_name: 'postgres'
image: postgres:13.6-alpine
container_name: "postgres"
image: postgres:13.11-alpine
ports:
- '5432:5432'
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: '${POSTGRES_USER}'
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
POSTGRES_DB: '${POSTGRES_DB}'
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
hapi:
container_name: 'hapi'
image: node:16.13.2-slim
container_name: "hapi"
image: node:16.20.2
ports:
- '9090:9090'
- "9090:9090"
volumes:
- ./tmp/hapi/node_modules/:/app/node_modules/
- type: bind
source: ./hapi
target: /app
working_dir: /app
command: bash -c "yarn && yarn watch"
command: bash -c "yarn && yarn start:dev"
environment:
HAPI_SERVER_PORT: '${HAPI_SERVER_PORT}'
HAPI_SERVER_ADDRESS: '${HAPI_SERVER_ADDRESS}'
HAPI_NETWORK_API: '${HAPI_NETWORK_API}'
HAPI_NETWORK_CHAIN_ID: '${HAPI_NETWORK_CHAIN_ID}'
HAPI_NETWORK_BASE_ACCOUNT: '${HAPI_NETWORK_BASE_ACCOUNT}'
HAPI_NETWORK_BASE_PASSWORD: '${HAPI_NETWORK_BASE_PASSWORD}'
HAPI_NETWORK_WALLET_URL: '${HAPI_NETWORK_WALLET_URL}'
HAPI_HASURA_URL: '${HAPI_HASURA_URL}'
HAPI_HASURA_ADMIN_SECRET: '${HAPI_HASURA_ADMIN_SECRET}'
HAPI_SERVER_PORT: "${HAPI_SERVER_PORT}"
HAPI_SERVER_ADDRESS: "${HAPI_SERVER_ADDRESS}"
HAPI_NETWORK_API: "${HAPI_NETWORK_API}"
HAPI_NETWORK_CHAIN_ID: "${HAPI_NETWORK_CHAIN_ID}"
HAPI_NETWORK_BASE_ACCOUNT: "${HAPI_NETWORK_BASE_ACCOUNT}"
HAPI_NETWORK_BASE_PASSWORD: "${HAPI_NETWORK_BASE_PASSWORD}"
HAPI_NETWORK_WALLET_URL: "${HAPI_NETWORK_WALLET_URL}"
HAPI_HASURA_URL: "${HAPI_HASURA_URL}"
HAPI_HASURA_ADMIN_SECRET: "${HAPI_HASURA_ADMIN_SECRET}"
hasura:
container_name: 'hasura'
image: hasura/graphql-engine:v2.6.1.cli-migrations-v3
container_name: "hasura"
image: hasura/graphql-engine:v2.33.1.cli-migrations-v3
ports:
- '8080:8080'
- "8080:8080"
depends_on:
- postgres
volumes:
- ./hasura/migrations:/migrations
- ./hasura/metadata:/metadata
- ./hasura/seeds:/seeds
environment:
HASURA_GRAPHQL_DATABASE_URL: '${HASURA_GRAPHQL_DATABASE_URL}'
HASURA_GRAPHQL_DATABASE_URL: "${HASURA_GRAPHQL_DATABASE_URL}"
HASURA_GRAPHQL_MIGRATIONS_DIR: /migrations
HASURA_GRAPHQL_METADATA_DIR: /metadata
HASURA_GRAPHQL_SEEDS_DIR: /seeds
HASURA_GRAPHQL_ACTION_BASE_URL: '${HASURA_GRAPHQL_ACTION_BASE_URL}'
HASURA_GRAPHQL_ENABLE_CONSOLE: 'true'
HASURA_GRAPHQL_ACTION_BASE_URL: "${HASURA_GRAPHQL_ACTION_BASE_URL}"
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
# Local Development Configurations It is recommended to disable this in production
HASURA_GRAPHQL_DEV_MODE: 'true'
HASURA_GRAPHQL_DEV_MODE: "true"
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_ENABLE_LOGGING: 'true'
HASURA_GRAPHQL_ENABLE_LOGGING: "true"
# disabled security for local development
# HASURA_GRAPHQL_ADMIN_SECRET: "${HASURA_GRAPHQL_ADMIN_SECRET}"
# HASURA_GRAPHQL_UNAUTHORIZED_ROLE: "${HASURA_GRAPHQL_UNAUTHORIZED_ROLE}"
webapp:
container_name: 'webapp'
container_name: "webapp"
image: node:16.14.0-alpine
stdin_open: true
ports:
- '3000:3000'
- "3000:3000"
volumes:
- ./tmp/webapp/node_modules/:/app/node_modules/
- type: bind
Expand All @@ -79,15 +78,15 @@ services:
working_dir: /app
command: bash -c "yarn && yarn start"
environment:
NEXT_PUBLIC_TAG: '${NEXT_PUBLIC_TAG}'
NEXT_PUBLIC_TITLE: '${NEXT_PUBLIC_TITLE}'
NEXT_PUBLIC_LOGO: '${NEXT_PUBLIC_LOGO}'
NEXT_PUBLIC_FOOTER_LINKS: '${NEXT_PUBLIC_FOOTER_LINKS}'
NEXT_PUBLIC_UAL_APP_NAME: '${NEXT_PUBLIC_UAL_APP_NAME}'
NEXT_PUBLIC_UAL_API_PROTOCOL: '${NEXT_PUBLIC_UAL_API_PROTOCOL}'
NEXT_PUBLIC_UAL_API_HOST: '${NEXT_PUBLIC_UAL_API_HOST}'
NEXT_PUBLIC_UAL_API_PORT: '${NEXT_PUBLIC_UAL_API_PORT}'
NEXT_PUBLIC_UAL_CHAIN_ID: '${NEXT_PUBLIC_UAL_CHAIN_ID}'
NEXT_PUBLIC_HASURA_URL: '${NEXT_PUBLIC_HASURA_URL}'
NEXT_PUBLIC_TAG: "${NEXT_PUBLIC_TAG}"
NEXT_PUBLIC_TITLE: "${NEXT_PUBLIC_TITLE}"
NEXT_PUBLIC_LOGO: "${NEXT_PUBLIC_LOGO}"
NEXT_PUBLIC_FOOTER_LINKS: "${NEXT_PUBLIC_FOOTER_LINKS}"
NEXT_PUBLIC_UAL_APP_NAME: "${NEXT_PUBLIC_UAL_APP_NAME}"
NEXT_PUBLIC_UAL_API_PROTOCOL: "${NEXT_PUBLIC_UAL_API_PROTOCOL}"
NEXT_PUBLIC_UAL_API_HOST: "${NEXT_PUBLIC_UAL_API_HOST}"
NEXT_PUBLIC_UAL_API_PORT: "${NEXT_PUBLIC_UAL_API_PORT}"
NEXT_PUBLIC_UAL_CHAIN_ID: "${NEXT_PUBLIC_UAL_CHAIN_ID}"
NEXT_PUBLIC_HASURA_URL: "${NEXT_PUBLIC_HASURA_URL}"
volumes:
postgres_data:
2 changes: 2 additions & 0 deletions hapi/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
34 changes: 13 additions & 21 deletions hapi/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{
"extends": ["standard", "prettier", "plugin:prettier/recommended"],
"rules": {
"promise/always-return": "off",
"complexity": [
"error",
{
"max": 21
}
]
},
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
// "root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": 2018
"ecmaVersion": 2020
}
}
}
28 changes: 3 additions & 25 deletions hapi/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,9 @@
# dependencies
node_modules

# testing
coverage

# production
build
build_*

# misc
.DS_Store
.env*
!.env.example

npm-debug.log*
yarn-debug.log*
yarn-error.log*
.yarnrc.yml
.yarn/


*.abi
*.wasm
*.rej

__docs

.idea/**/*

resources/**/*
resources/**/*
# yarn
dist
5 changes: 5 additions & 0 deletions hapi/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

cd hapi
yarn lint-staged
9 changes: 5 additions & 4 deletions hapi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# ---------- Base ----------
FROM node:16.13.2-slim as base
FROM node:16.20.2 as base
WORKDIR /app

# ---------- Builder ----------
FROM base AS builder
COPY package.json yarn.lock ./
RUN yarn --ignore-optional
COPY ./src ./src
COPY ./ ./
RUN yarn build

# ---------- Release ----------
FROM base AS release
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/src ./src
COPY --from=builder /app/dist ./src
USER node
CMD ["node", "./src/index.js"]
CMD ["node", "./src/index.js"]
2 changes: 1 addition & 1 deletion hapi/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ build-docker-cached: ./Dockerfile

push-image: ##@devops Push the freshly built image and tag with release or latest tag
push-image:
@docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME_HAPI):$(VERSION)
@docker push $(DOCKER_REGISTRY)/$(IMAGE_NAME_HAPI):$(VERSION)
6 changes: 6 additions & 0 deletions hapi/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"watch": ["src"],
"ext": ".ts,.js",
"ignore": [],
"exec": "ts-node ./src/index.ts"
}
60 changes: 28 additions & 32 deletions hapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,42 @@
"version": "1.0.0",
"description": "Edenia Boilerplate WebApp",
"repository": "https://github.com/edenia/full-stack-boilerplate.git",
"license": "MIT",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node src/index.js",
"watch": "nodemon --enable-source-maps src/index.js",
"lint": "lint-staged"
"build": "tsc",
"start": "tsc && node dist/index.js",
"start:dev": "nodemon",
"prepare": "cd .. && husky install hapi/.husky"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"lint-staged": {
"*.ts": [
"eslint . --ext .ts",
"prettier --write"
]
},
"license": "MIT",
"dependencies": {
"@hapi/boom": "^10.0.0",
"@hapi/hapi": "^20.2.1",
"axios": "^0.27.2",
"@hapi/hapi": "^21.3.2",
"axios": "^1.5.0",
"eosjs": "^22.1.0",
"eosjs-api": "^7.0.4",
"graphql": "^16.5.0",
"graphql-request": "^4.3.0",
"http-status-codes": "^2.2.0",
"joi": "^17.5.0",
"node-fetch": "^3.2.6"
"graphql": "^16.7.1",
"graphql-request": "^6.1.0",
"joi": "^17.6.4",
"node-fetch": "^3.3.2"
},
"devDependencies": {
"env-cmd": "^10.1.0",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.0.0",
"husky": "7.0.4",
"lint-staged": "^12.3.1",
"nodemon": "^2.0.15",
"prettier": "^2.5.1",
"standard": "^16.0.4"
},
"optionalDependencies": {
"fsevents": "2.3.2"
"@types/node": "^20.5.9",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"eslint": "^8.26.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"husky": "^8.0.1",
"lint-staged": "^14.0.1",
"nodemon": "^3.0.1",
"prettier": "^3.0.3",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
}
}
7 changes: 0 additions & 7 deletions hapi/src/config/eos.config.js

This file was deleted.

9 changes: 9 additions & 0 deletions hapi/src/config/eos.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const endpoint =
process.env.HAPI_NETWORK_API || 'https://jungle.edenia.cloud'
export const chainId =
process.env.HAPI_NETWORK_CHAIN_ID ||
'73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d'
export const baseAccount =
process.env.HAPI_NETWORK_BASE_ACCOUNT || 'accountname1'
export const baseAccountPassword = process.env.HAPI_NETWORK_BASE_PASSWORD
export const walletUrl = process.env.HAPI_NETWORK_WALLET_URL
4 changes: 0 additions & 4 deletions hapi/src/config/hasura.config.js

This file was deleted.

8 changes: 8 additions & 0 deletions hapi/src/config/hasura.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const url =
process.env.HAPI_HASURA_URL || 'http://hasura:8081/v1/graphql'
export const adminSecret =
process.env.HAPI_HASURA_ADMIN_SECRET || 'myadminsecretkey'

if (!url || !adminSecret) {
throw new Error('Missing required hasura env variables')
}
Loading

0 comments on commit 5383f14

Please sign in to comment.