Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.turbo
build
node_modules
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: ScoreTrak Client Docker Image CI
on:
release:
types: [published]
Expand Down
34 changes: 25 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
node_modules
.pnp
.pnp.js

# testing
/coverage
coverage

# production
/build
# next.js
.next/
out/
build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
# non-pnpm lock files
package-lock.json
yarn.lock

# turbo
.turbo
*/.turbo

.idea
# intellij
.idea
30 changes: 21 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#Thanks to https://typeofnan.dev/how-to-serve-a-react-app-with-nginx-in-docker/
# Thanks to https://typeofnan.dev/how-to-serve-a-react-app-with-nginx-in-docker/
# Thanks to https://pnpm.io/cli/fetch#usage-scenario
# Name the node stage "builder"
FROM node:14 AS builder
# Set working directory
WORKDIR /app
# Copy all files from current directory to working dir in image
COPY . .
FROM node:16 AS builder

RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm

# Install binarys
RUN BIN="/usr/local/bin" && \
VERSION="3.15.8" && \
BINARY_NAME="protoc" && \
Expand All @@ -30,8 +31,19 @@ RUN BIN="/usr/local/bin" && \
"https://github.com/bufbuild/buf/releases/download/v${VERSION}/${BINARY_NAME}-$(uname -s)-$(uname -m)" \
-o "${BIN}/${BINARY_NAME}" && \
chmod +x "${BIN}/${BINARY_NAME}"
# install node modules and build assets
RUN yarn install && yarn build


WORKDIR /app

# Files required by pnpm install
COPY package.json pnpm-lock.yaml ./

RUN pnpm install --frozen-lockfile

# Copy all files from current directory to working dir in image
COPY . .

RUN pnpm install && pnpm run build


# nginx state for serving content
Expand All @@ -41,7 +53,7 @@ WORKDIR /usr/share/nginx/html
# Remove default nginx static assets
RUN rm -rf ./*
# Copy static assets from builder stage
COPY --from=builder /app/build .
COPY --from=builder /app/apps/client/build .
#redirect 404s to index
RUN sed -i '/index index.html index.htm;/a try_files \$uri \$uri/ /index.html;' /etc/nginx/conf.d/default.conf
# Containers run nginx with global directives and daemon off
Expand Down
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,64 @@
# ScoreTrak Web App
# ScoreTrak JS Mono Repo

The react web application for ScoreTrak, a scoring engine built in go.
The monorepo for ScoreTrak client packages using [pnpm](https://pnpm.io) as the package manager.

### Apps and Packages

- `apps/client`: the scoretrak react js client app
- `packages/scoretrak-scoretrakapis`: the generated protobuf files for the react js client app.

## Installation

Clone the repository.

```bash
git clone https://github.com/ScoreTrak/client
git clone https://github.com/scoretrak/client
```

## Usage

Install Dependencies

```bash
yarn install
pnpm install
```

### Development

Start the application

```bash
yarn run start
pnpm run start
```

Test the application

```bash
yarn run test
pnpm run test
```

### Production

Build the application

```bash
yarn run build
pnpm run build
```

Serve generated static files

```bash
yarn install --global serve
pnpm install --global serve
serve -s build
```

## Useful Links

Learn more about the power of Turborepo:

- [Pipelines](https://turborepo.org/docs/features/pipelines)
- [Caching](https://turborepo.org/docs/features/caching)
- [Remote Caching (Beta)](https://turborepo.org/docs/features/remote-caching)
- [Scoped Tasks](https://turborepo.org/docs/features/scopes)
- [Configuration Options](https://turborepo.org/docs/reference/configuration)
- [CLI Usage](https://turborepo.org/docs/reference/command-line-reference)
3 changes: 3 additions & 0 deletions apps/client/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.turbo
build
node_modules
25 changes: 25 additions & 0 deletions apps/client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

# production
build
dist
dist-ssr

# misc
.DS_Store
*.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.idea
.turbo
File renamed without changes.
File renamed without changes.
78 changes: 78 additions & 0 deletions apps/client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"name": "@scoretrak/client",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-table/core": "^2.3.26",
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
"@nivo/bar": "^0.73.1",
"@nivo/core": "^0.73.0",
"@testing-library/jest-dom": "^5.11.5",
"@testing-library/react": "^11.1.1",
"@testing-library/user-event": "^12.2.0",
"@types/google-protobuf": "^3.7.4",
"@types/jest": "^26.0.15",
"@types/material-ui": "^0.21.8",
"@types/node": "^18.0.4",
"@types/react": "^16.9.56",
"@types/react-dom": "^16.9.9",
"@types/react-router": "^5.1.8",
"clsx": "^1.1.1",
"file-saver": "^2.0.2",
"google-protobuf": "^3.14.0-rc.1",
"grpc-web": "^1.2.1",
"jwt-decode": "^3.1.1",
"material-table": "1.67.1",
"notistack": "^1.0.1",
"npm-watch": "^0.11.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-full-screen": "^0.3.1",
"react-json-view": "^1.21.3",
"react-refresh": "^0.12.0",
"react-router": "^5.1.8",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.0",
"ts-transformer-keys": "^0.4.3",
"typescript": "4.0.3",
"watch": "^1.0.2",
"web-vitals": "^0.2.4"
},
"scripts": {
"start": "react-scripts start",
"prebuild": "buf generate --template buf.gen.yaml 'https://github.com/scoretrak/scoretrakapis.git'",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
],
"ignorePatterns": [
"**/*_pb.js"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/file-saver": "^2.0.1",
"@types/react-router-dom": "^5.1.6",
"@types/uuid": "^8.3.0",
"react-hook-form": "^6.11.0"
},
"proxy": "https://engine.ubnetdef.org"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
87 changes: 19 additions & 68 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,26 @@
{
"name": "scoretrak-client",
"version": "0.1.0",
"name": "scoretrak-web-mr",
"version": "0.0.0",
"private": true,
"dependencies": {
"@material-table/core": "^2.3.26",
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
"@nivo/bar": "^0.73.1",
"@nivo/core": "^0.73.0",
"@testing-library/jest-dom": "^5.11.5",
"@testing-library/react": "^11.1.1",
"@testing-library/user-event": "^12.2.0",
"@types/google-protobuf": "^3.7.4",
"@types/jest": "^26.0.15",
"@types/material-ui": "^0.21.8",
"@types/node": "^12.19.3",
"@types/react": "^16.9.56",
"@types/react-dom": "^16.9.9",
"@types/react-router": "^5.1.8",
"file-saver": "^2.0.2",
"google-protobuf": "^3.14.0-rc.1",
"grpc-web": "^1.2.1",
"jwt-decode": "^3.1.1",
"material-table": "1.67.1",
"notistack": "^1.0.1",
"npm-watch": "^0.11.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-full-screen": "^0.3.1",
"react-json-view": "^1.21.3",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.0",
"ts-transformer-keys": "^0.4.3",
"typescript": "4.0.3",
"watch": "^1.0.2",
"web-vitals": "^0.2.4"
},
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
"start": "react-scripts start",
"prebuild": "buf generate --template buf.gen.yaml 'https://github.com/scoretrak/scoretrakapis.git'",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
],
"ignorePatterns": [
"**/*_pb.js"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"build": "turbo run build",
"dev": "turbo run dev --parallel",
"start": "turbo run start --parallel",
"preview": "turbo run preview --parallel",
"lint": "turbo run lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\""
},
"devDependencies": {
"@types/file-saver": "^2.0.1",
"@types/react-router-dom": "^5.1.6",
"@types/uuid": "^8.3.0",
"react-hook-form": "^6.11.0"
"prettier": "^2.5.1",
"turbo": "latest"
},
"engines": {
"npm": ">=7.0.0",
"node": ">=14.0.0"
},
"proxy": "https://engine.ubnetdef.org"
"packageManager": "pnpm@6.26.1"
}
Loading