forked from Joystream/pioneer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪢 Merge backend and RWD into
dev
(Joystream#4634)
- Loading branch information
Showing
287 changed files
with
17,140 additions
and
2,418 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM node:20 AS base | ||
WORKDIR /app | ||
|
||
RUN set -eux; \ | ||
apt-get update -y; \ | ||
apt-get install -y --no-install-recommends openssl; \ | ||
rm -rf /var/lib/apt/list/* | ||
|
||
FROM base AS builder | ||
|
||
COPY packages/server/package.json ./ | ||
COPY yarn.lock ./ | ||
RUN yarn --immutable | ||
|
||
COPY tsconfig.json ./base.tsconfig.json | ||
COPY packages/server/tsconfig.json ./ | ||
RUN sed -i 's/"extends":.*/"extends": ".\/base.tsconfig.json",/' tsconfig.json | ||
|
||
COPY packages/server/prisma ./ | ||
COPY packages/server/codegen.ts ./ | ||
COPY packages/server/src ./src | ||
RUN yarn build:local | ||
|
||
RUN rm -rf node_modules | ||
ENV NODE_ENV=production | ||
RUN yarn --prod --immutable | ||
RUN yarn prisma generate | ||
|
||
FROM base | ||
|
||
USER www-data | ||
|
||
COPY --from=builder --chown=www-data /app/dist ./dist | ||
COPY --from=builder --chown=www-data /app/node_modules ./node_modules | ||
COPY packages/server/prisma ./prisma | ||
COPY packages/server/docker/prod/entrypoint.sh /entrypoint.sh | ||
COPY packages/server/docker/prod/notify.sh /usr/bin/notify | ||
|
||
ENV QUERY_NODE_ENDPOINT "https://query.joystream.org/graphql" | ||
ENV PIONEER_URL "https://pioneerapp.xyz" | ||
ENV STARTING_BLOCK 1 | ||
ENV NODE_ENV=production | ||
ENV APP_LOG_LEVEL "verbose" | ||
ENV PORT 3000 | ||
EXPOSE 3000/tcp | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["api"] |
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 @@ | ||
FROM node:18-alpine3.18 AS builder | ||
WORKDIR /app | ||
|
||
COPY packages/server/package.json ./ | ||
COPY yarn.lock ./ | ||
RUN yarn --immutable | ||
|
||
COPY tsconfig.json ./base.tsconfig.json | ||
COPY packages/server/tsconfig.json ./ | ||
RUN sed -i 's/"extends":.*/"extends": ".\/base.tsconfig.json",/' tsconfig.json | ||
|
||
COPY packages/server/prisma ./ | ||
COPY packages/server/codegen.ts ./ | ||
COPY packages/server/src ./src | ||
RUN yarn build:local | ||
|
||
RUN rm -rf node_modules | ||
ENV NODE_ENV=production | ||
RUN yarn --prod --immutable | ||
RUN yarn prisma generate | ||
|
||
FROM postgres:16.0-alpine3.18 | ||
WORKDIR /app | ||
RUN apk add --no-cache nodejs | ||
|
||
COPY --from=builder --chown=postgres /app/dist ./dist | ||
COPY --from=builder --chown=postgres /app/node_modules ./node_modules | ||
COPY packages/server/prisma ./prisma | ||
COPY packages/server/docker/dev/entrypoint.sh /entrypoint.sh | ||
COPY packages/server/docker/dev/notify.sh /usr/bin/notify | ||
COPY packages/server/docker/dev/env.sh ./ | ||
COPY packages/server/docker/dev/prisma-deploy.sh /docker-entrypoint-initdb.d/ | ||
|
||
ENV QUERY_NODE_ENDPOINT "https://query.joystream.org/graphql" | ||
ENV PIONEER_URL "https://pioneerapp.xyz" | ||
ENV STARTING_BLOCK 1 | ||
ENV APP_LOG_LEVEL "verbose" | ||
ENV PORT 3000 | ||
EXPOSE 3000/tcp | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["api"] |
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 |
---|---|---|
|
@@ -10,22 +10,20 @@ | |
] | ||
}, | ||
"scripts": { | ||
"lint": "wsrun --package @joystream/pioneer -c lint", | ||
"lint:fix": "wsrun --package @joystream/pioneer -c lint:fix", | ||
"build": "wsrun --fast-exit --stages -c --exclude @joystream/markdown-editor build", | ||
"build:storybook": "wsrun --fast-exit --stages -c --exclude @joystream/pioneer --exclude-missing build && wsrun --package @joystream/pioneer -c build:storybook", | ||
"lint": "wsrun -x @joystream/markdown-editor -c lint", | ||
"lint:fix": "wsrun -x @joystream/markdown-editor -c lint:fix", | ||
"build": "wsrun --fast-exit --package @joystream/pioneer -c build", | ||
"build:storybook": "wsrun --fast-exit --stages -p @joystream/markdown-editor -c build && wsrun -p @joystream/pioneer -c build:storybook", | ||
"storybook": "wsrun --exclude-missing -c storybook", | ||
"test": "wsrun --fast-exit --package @joystream/pioneer -c test", | ||
"test": "wsrun --fast-exit --exclude-missing -c test", | ||
"test-storybook": "wsrun --package @joystream/pioneer -c test-storybook", | ||
"start": "wsrun --package @joystream/pioneer -c start", | ||
"prepare": "husky install" | ||
}, | ||
"dependencies": { | ||
"eslint-plugin-import": "^2.23.4", | ||
"wsrun": "^5.2.4" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^5.50.0", | ||
"@typescript-eslint/parser": "^5.50.0", | ||
"husky": ">=6", | ||
"lint-staged": ">=10" | ||
}, | ||
|
@@ -52,11 +50,11 @@ | |
"@joystream/[email protected]": "patch:@joystream/js@npm%3A1.2.0#./.yarn/patches/@joystream-js-npm-1.2.0-a8795e7496.patch" | ||
}, | ||
"engines": { | ||
"node": ">=14.18.0", | ||
"node": ">=18", | ||
"yarn": "^1.22.0" | ||
}, | ||
"lint-staged": { | ||
"packages/ui/src/**/*.{js,ts,tsx,html}": [ | ||
"packages/{ui,server}/src/**/*.{js,ts,tsx,html}": [ | ||
"eslint --fix", | ||
"prettier --write" | ||
] | ||
|
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,64 @@ | ||
# | ||
# Database | ||
# | ||
|
||
POSTGRES_DB: "pioneer" | ||
POSTGRES_USER: "pioneer" | ||
POSTGRES_PASSWORD: "pioneer" | ||
|
||
# Use a non standard port to not interfere with the local Joystream mono-repo `db` service. | ||
DB_PORT: 5433 | ||
|
||
# URL Prisma uses to connect to the database (this value is not used when runing the api from the docker compose file). | ||
DATABASE_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:${DB_PORT}/${POSTGRES_DB}" | ||
|
||
# | ||
# Joystream environment | ||
# | ||
|
||
# Query node to fetch from: | ||
# - http://localhost:8081/graphql to connect to a query node running locally. | ||
# - http://graphql-server:8081/graphql to connect to the Joystream mono-repo docker service from its network. | ||
# - https://query.joystream.org/graphql to connect to the Joystream's mainnet query node. | ||
QUERY_NODE_ENDPOINT: "https://query.joystream.org/graphql" | ||
|
||
# Pioneer instance to link to in the notification (Use "http://localhost:8080" for the local instance). | ||
PIONEER_URL: "https://pioneerapp.xyz" | ||
|
||
# Block to start fetching the events from. | ||
STARTING_BLOCK: 1 | ||
|
||
# | ||
# General | ||
# | ||
|
||
# Port to run the api on. | ||
PORT: 3000 | ||
|
||
# The key used to to sign JSON Web Token with. | ||
APP_SECRET_KEY: "SECRET_1234" | ||
|
||
# Log level. | ||
APP_LOG_LEVEL: "verbose" | ||
|
||
NODE_ENV: "development" | ||
|
||
# | ||
# | ||
|
||
# EMAIL_SENDER: "[email protected]" | ||
|
||
# Only one of the api provider should be defined | ||
# SENDGRID_API_KEY: "SG.1234567890qwerty" | ||
|
||
# MAILGUN_API_KEY: "qwerty12345" | ||
# MAILGUN_DOMAIN: "example.com" | ||
# MAILGUN_API_URL: "https://api.eu.mailgun.net" # this is needed for EU domains | ||
|
||
# | ||
# For development only: | ||
# | ||
|
||
# Create default members (their tokens will be displayed when the server start). | ||
INITIAL_MEMBERSHIPS: '[{ "id": 1, "name": "Alice", "email": "[email protected]" }, { "id": 2, "name": "Bob", "email": "[email protected]" }]' |
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 @@ | ||
**/__generated__ |
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 @@ | ||
node_modules | ||
__generated__ | ||
dist | ||
|
||
# Keep environment variables out of version control | ||
.env | ||
|
||
.react-email |
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 @@ | ||
**/__generated__ |
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,6 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"bracketSpacing": true | ||
} |
Oops, something went wrong.