Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files for frontend and backend staging and production #75

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: echo "REACT_APP_BACKEND_URL=${{ secrets.DEV_BACKEND_URL }}" > .env
- run: echo "REACT_APP_OAUTH_CLIENT_ID=${{ secrets.DEV_OAUTH_CLIENT_ID }}" >> .env
- run: rm -rf node_modules && yarn install --frozen-lockfile && yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy frontend to Firebase Hosting preview
# https://github.com/firebase/firebase-toolsnaname: Deploy frontend to Firebase Hosting preview

on:
pull_request:
Expand All @@ -19,8 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: echo "REACT_APP_BACKEND_URL=${{ secrets.PREVIEW_BACKEND_URL }}" > .env
- run: echo "REACT_APP_OAUTH_CLIENT_ID=${{ secrets.DEV_OAUTH_CLIENT_ID }}" >> .env
- run: rm -rf node_modules && yarn install --frozen-lockfile && yarn build
- run: rm -rf node_modules && yarn install --frozen-lockfile && yarn fix && yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile-staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:20.11.1-slim

WORKDIR /app

COPY package.json yarn.lock tsconfig.json ./

RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list

# libcurl3 is required for mongodb-memory-server, which is used for testing
RUN apt-get update && apt-get install -y libcurl3

RUN yarn install

COPY . ./

RUN yarn exec -- tsc

EXPOSE 8080
ENTRYPOINT ["node", "./build/server.js"]
6 changes: 3 additions & 3 deletions backend/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import courseRouter from "./rest/courseRoutes";

const CORS_ALLOW_LIST = [
"http://localhost:3000",
"https://uw-blueprint-starter-code.firebaseapp.com",
"https://uw-blueprint-starter-code.web.app",
/^https:\/\/uw-blueprint-starter-code--pr.*\.web\.app$/,
"https://extendafamily-7613e.firebaseapp.com",
"https://extendafamily-7613e.web.app",
/^https:\/\/extendafamily-7613e--pr.*\.web\.app$/,
];

const CORS_OPTIONS: cors.CorsOptions = {
Expand Down
13 changes: 13 additions & 0 deletions docker-compose-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
backend:
container_name: eaf_backend
restart: always
build:
context: ./backend
dockerfile: Dockerfile-staging
ports:
- 0.0.0.0:58001:8080
dns:
- 8.8.8.8
env_file:
- ./.env
2 changes: 1 addition & 1 deletion frontend/.firebaserc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projects": {
"default": "uw-blueprint-starter-code"
"default": "extendafamily-7613e"
}
}
66 changes: 66 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase-debug.log*
firebase-debug.*.log*

# Firebase cache
.firebase/

# Firebase config

# Uncomment this if you'd like others to create their own Firebase project.
# For a team working on the same Firebase project(s), it is recommended to leave
# it commented so all members can deploy to the same project(s) in .firebaserc.
# .firebaserc

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
5 changes: 4 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@types/react-table": "^7.0.29",
"@types/react-window": "^1.8.8",
"@types/react-window-infinite-loader": "^1.0.9",
"autoprefixer": "10.4.5",
"axios": "^0.28.0",
"bootstrap": "^5.0.0",
"framer-motion": "^11.2.12",
Expand Down Expand Up @@ -79,9 +80,11 @@
},
"resolutions": {
"@types/react": "^18.2.69",
"@types/react-dom": "^18.2.19"
"@types/react-dom": "^18.2.19",
"autoprefixer": "10.4.5"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@types/humps": "^2.0.0",
"@types/jwt-decode": "^3.1.0",
"@types/lodash": "^4.17.5",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/pages/ManageUserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import {
TableFooter,
TablePagination,
TableHead,
Table,
Stack,
FormControl,
} from "@mui/material";
import TablePaginationActions from "@mui/material/TablePagination/TablePaginationActions";
import { Table } from "react-bootstrap";
import { Role } from "../../types/AuthTypes";
import UserAPIClient from "../../APIClients/UserAPIClient";
import { User } from "../../types/UserTypes";
Expand Down
Loading
Loading