Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #169 from purplship/purplship-dashboard-2021.11
Browse files Browse the repository at this point in the history
[release-candidate] Purplship dashboard 2021.11
  • Loading branch information
danh91 committed Dec 8, 2021
2 parents 3d72c00 + 65becfd commit 7728338
Show file tree
Hide file tree
Showing 236 changed files with 8,415 additions and 35,159 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,16 @@ npm install

Use the following environment variables to configure the dashboard:

- `NEXT_PUBLIC_PURPLSHIP_API_URL` (**required**) - URL of a running instance of purplship-server. If you are running purplship-server locally with the default settings, set `NEXT_PUBLIC_PURPLSHIP_API_URL` to: `http://localhost:5002`.
- `NEXT_PUBLIC_PURPLSHIP_API_URL` (**required**) - URL of a running instance of purplship server. If you are running purplship-server locally with the default settings, set `NEXT_PUBLIC_PURPLSHIP_API_URL` to: `http://localhost:5002`.

- `JWT_SECRET` (**required**) - A secret to use for JWT key generation - you should set this explicitly.

- `NEXTAUTH_URL` (**required**) - The URL of your dashboard to restrict the authentication host to your instance. If you are running the dashboard locally, set `NEXTAUTH_URL` to: `http://localhost:3000`.

- `PURPLSHIP_HOSTNAME` - URL of a running instance of purplship server. Useful for an ingress network request from the node side of the dashboard.

- `BASE_PATH` - A base path to use for deploying the dashboard to a domain subpath. e.g. `instance.purplship.com/dashboard`

- `JWT_SECRET` - A secret to use for JWT key generation - you should set this explicitly.

#### Development

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ USER pship

EXPOSE 3000

CMD ["npm", "run", "start"]
CMD ["node_modules/.bin/next", "start"]
3 changes: 3 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
const path = require('path')

module.exports = {
basePath: process.env.BASE_PATH || '',
reactStrictMode: true,
sassOptions: {
includePaths: [path.join(__dirname, 'src', 'styles')],
},
serverRuntimeConfig: {
JWT_SECRET: process.env.JWT_SECRET,
PURPLSHIP_HOSTNAME: process.env.PURPLSHIP_HOSTNAME || process.env.NEXT_PUBLIC_PURPLSHIP_API_URL,
},
publicRuntimeConfig: {
BASE_PATH: process.env.BASE_PATH || '',
PURPLSHIP_API_URL: process.env.NEXT_PUBLIC_PURPLSHIP_API_URL
}
}
1,800 changes: 1,451 additions & 349 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
"eslint-config-next": "11.0.1",
"typescript": "4.3.5"
}
}
}
1 change: 1 addition & 0 deletions public/carriers/dhl_poland_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions public/carriers/dhl_poland_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
"name": "Purple Board",
"icons": [
{
"src": "\/android-chrome-192x192.png",
"src": "android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
},
{
"src": "\/android-chrome-512x512.png",
"src": "android-chrome-512x512.png",
"sizes": "512x512",
"type": "image\/png",
"density": "4.0"
}
],
"start_url": "\/",
"start_url": "",
"display": "standalone",
"theme_color": "#9504af",
"background_color": "#9504af"
Expand Down
10 changes: 8 additions & 2 deletions scripts/generate-pship-client.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#!/usr/bin/env bash
branch="${1:=main}"

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \
-i /local/scripts/openapi.json \
-i "https://raw.githubusercontent.com/purplship/purplship/${branch}/server/schemas/openapi.json" \
-g typescript-fetch \
-o /local/src/api/generated \
-o /local/src/purplship/rest/generated \
--additional-properties=typescriptThreePlus=true \
--additional-properties=modelPropertyNaming=snake_case \
--additional-properties=useSingleRequestParameter=True

rm -rf src/purplship/rest/generated/index.ts \
src/purplship/rest/generated/apis/index.ts \
src/purplship/rest/generated/.openapi-generator-ignore \
src/purplship/rest/generated/.openapi-generator/
11 changes: 8 additions & 3 deletions scripts/generate-pship-graphql-types.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/usr/bin/env bash
branch="${1:=main}"

apollo-codegen generate "src/graphql/queries.ts" \
--schema "scripts/graphql.json" \
curl https://raw.githubusercontent.com/purplship/purplship/${branch}/server/schemas/graphql.json --output graphql.json

apollo-codegen generate "src/purplship/graphql/queries.ts" \
--schema "./graphql.json" \
--target typescript \
--output "src/graphql/types.ts"
--output "src/purplship/graphql/types.ts"

rm -f graphql.json
Loading

0 comments on commit 7728338

Please sign in to comment.