-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add galoy pay to repo - switch galoy pay to use react 18 types - fix linting issues --------- Co-authored-by: vindard <[email protected]>
- Loading branch information
1 parent
b81f275
commit d2e95df
Showing
128 changed files
with
12,034 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
"extends": ["next/core-web-vitals", "@galoy/eslint-config/base"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
|
||
|
||
.env.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.next/ | ||
success-animation.json | ||
tsconfig.json | ||
assetlinks.json | ||
|
||
**/*.yaml | ||
**/*.yml | ||
**/*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const baseConfig = require("@galoy/eslint-config/prettier"); | ||
|
||
module.exports = baseConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
load( | ||
"@toolchains//workspace-pnpm:macros.bzl", | ||
"dev_pnpm_task_binary", | ||
"dev_pnpm_task_test", | ||
"build_node_modules", | ||
"next_build", | ||
"next_build_bin", | ||
"eslint", | ||
"audit", | ||
) | ||
|
||
dev_pnpm_task_binary( | ||
name = "dev", | ||
command = "dev", | ||
) | ||
|
||
dev_pnpm_task_binary( | ||
name = "lint-fix", | ||
command = "lint:fix", | ||
) | ||
|
||
dev_pnpm_task_binary( | ||
name = "cypress-open", | ||
command = "cypress:open", | ||
) | ||
|
||
dev_pnpm_task_test( | ||
name = "test-integration", | ||
command = "cypress:run", | ||
) | ||
|
||
export_file( | ||
name = "package.json", | ||
visibility = ["PUBLIC"], | ||
) | ||
|
||
build_node_modules( | ||
name = "node_modules", | ||
) | ||
|
||
filegroup( | ||
name = "src", | ||
srcs = glob([ | ||
"app/**", | ||
"theme/**", | ||
"services/**", | ||
"components/**", | ||
"config/**", | ||
"hooks/**", | ||
"lib/**", | ||
"pages/**", | ||
"utils/**", | ||
"public/**", | ||
"next.config.js", | ||
"tsconfig.json", | ||
"*.ts", # env.ts / middleware.ts / instrumentation.ts | ||
"instrumentation.node.ts" | ||
]), | ||
) | ||
|
||
next_build( | ||
name = "build", | ||
srcs = [":src"], | ||
) | ||
|
||
next_build_bin( | ||
name = "pay", | ||
) | ||
|
||
dev_deps_srcs = { | ||
"lib/eslint-config": "//lib/eslint-config:src", | ||
} | ||
|
||
audit( | ||
name = "audit", | ||
level = "critical", | ||
) | ||
|
||
eslint( | ||
name = "lint", | ||
srcs = [":src"] + glob([".eslint*"]), | ||
extensions = [".ts", ".tsx"], | ||
allow_warnings = True, | ||
dev_deps_srcs = dev_deps_srcs, | ||
) | ||
|
||
test_suite( | ||
name = "test-unit", | ||
tests = [ | ||
":audit", | ||
":lint", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Install dependencies only when needed | ||
FROM node:20-alpine AS deps | ||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | ||
RUN apk add --no-cache libc6-compat python3 make g++ | ||
WORKDIR /app | ||
COPY package.json yarn.lock ./ | ||
RUN yarn global add node-gyp \ | ||
&& yarn install --frozen-lockfile | ||
|
||
# Rebuild the source code only when needed | ||
FROM node:20-alpine AS builder | ||
WORKDIR /app | ||
COPY . . | ||
COPY --from=deps /app/node_modules ./node_modules | ||
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline | ||
|
||
# Production image, copy all the files and run next | ||
FROM node:20-alpine AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV production | ||
|
||
RUN addgroup -g 1001 -S nodejs | ||
RUN adduser -S nextjs -u 1001 | ||
|
||
# You only need to copy next.config.js if you are NOT using the default configuration | ||
# COPY --from=builder /app/next.config.js ./ | ||
COPY --from=builder /app/public ./public | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package.json ./package.json | ||
|
||
USER nextjs | ||
|
||
EXPOSE 3000 | ||
|
||
ARG BUILDTIME | ||
ARG COMMITHASH | ||
ENV BUILDTIME ${BUILDTIME} | ||
ENV COMMITHASH ${COMMITHASH} | ||
|
||
CMD ["node_modules/.bin/next", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Galoy Pay | ||
|
||
## What is it for? | ||
|
||
This repo is a web application that can be used to send tips or payments to users. | ||
|
||
It's packaged as a docker image, and is automatically installed as part of the Galoy helm charts. | ||
|
||
With a default installation, Galoy-Pay can be accessed under `pay.domain.com`. | ||
|
||
Galoy-Pay uses query, mutation, and subscription operations from the Galoy's graphql API endpoints `api.domain.com` as defined in [schema.graphql](https://github.com/GaloyMoney/galoy/blob/main/src/graphql/public/schema.graphql) | ||
|
||
## How to run this repo locally ? | ||
|
||
`.env.local` is set with values that works for local dev. | ||
|
||
for staging, use `.env.local` with the following properties | ||
|
||
``` | ||
NEXT_PUBLIC_GRAPHQL_URL='https://api.staging.galoy.io/graphql' | ||
NEXT_PUBLIC_GRAPHQL_WEBSOCKET_URL='wss://ws.staging.galoy.io/graphql' | ||
GRAPHQL_URL_INTERNAL="http://api.galoy-staging-galoy.svc.cluster.local" | ||
``` | ||
|
||
then run | ||
|
||
```sh | ||
yarn install | ||
yarn dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. | ||
|
||
The page will automatically reload when you make edits. | ||
|
||
You will also see any lint errors in the console. | ||
|
||
## How to run this repo in docker? | ||
|
||
In your terminal, run | ||
|
||
```sh | ||
yarn build:docker | ||
``` | ||
|
||
then run | ||
|
||
```sh | ||
yarn dev:docker | ||
``` | ||
|
||
This will spin up an instance of a galoy-pay docker container running on <http://localhost:3000> | ||
|
||
This will also run the app in production mode. | ||
|
||
## How to build for production? | ||
|
||
In the project directory, you can run: | ||
|
||
```sh | ||
yarn install | ||
yarn build | ||
``` | ||
|
||
This will build the app for production under a `build` folder. It will bundle React in production mode and optimize the build for the best performance. The build will be minified, and the bundled files will include unique hashes in their names. | ||
|
||
## Test lnurlp | ||
|
||
|
||
This environment variable is needed for getting the lnurlp endpoint working. | ||
|
||
curl localhost:3000/.well-known/lnurlp/alice | ||
curl localhost:3000/.well-known/lnurlp/alice?amount=1234 |
Oops, something went wrong.