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

sso support #36

Merged
merged 31 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b15e5d0
add login page
coolchock Nov 15, 2024
d3f8fc1
change description
coolchock Nov 15, 2024
f9dbb06
remove google login
coolchock Nov 15, 2024
d79bac0
wip
samjcombs Nov 15, 2024
8a52236
Resolve merge conflict
samjcombs Nov 15, 2024
c9b0ac7
package json
coolchock Nov 15, 2024
5e4d082
add custom login page
coolchock Nov 18, 2024
fd44258
save avatar in usermetadata
coolchock Nov 18, 2024
5797621
add avatar route
coolchock Nov 18, 2024
ce078bd
fetch avatar in the client
coolchock Nov 18, 2024
afb1c26
add CallbackHandler.tsx
coolchock Nov 18, 2024
6d65961
add avatar endpoint
coolchock Nov 18, 2024
1d9c69b
add shad avatar
coolchock Nov 18, 2024
98bd646
package json
coolchock Nov 18, 2024
34d435c
fix /graphql endpoints cors issue
coolchock Nov 18, 2024
70c9986
add .idea to gitignore
coolchock Nov 18, 2024
cd4333d
add sign out
coolchock Nov 18, 2024
99ef847
add github logo
coolchock Nov 19, 2024
92f25e5
add microsoft logo
coolchock Nov 19, 2024
c36bf49
add azure config
coolchock Nov 19, 2024
6233eb2
support azure login in the client
coolchock Nov 19, 2024
cd55278
change auth route
coolchock Nov 19, 2024
eb9e55b
chore: userid support in apollo key storage
samjcombs Nov 19, 2024
6bb40d0
Merge branch 'sso' of github.com:xolvio/instant-mock into sso
samjcombs Nov 19, 2024
d3b7f19
feat: oauth support for azure and github
samjcombs Nov 19, 2024
36a304a
chore: disable e2e for now until we add auth support
samjcombs Nov 19, 2024
2045234
chore: disable CI mode for FE build gh action for now
samjcombs Nov 19, 2024
9f3f29b
feat: unauthenticated experience with auto load from files
samjcombs Nov 21, 2024
28608d6
chore: update root level run scripts, display version
samjcombs Nov 22, 2024
207354e
chore: finalize no-auth vs auth experiences, conditional login dropdo…
samjcombs Nov 22, 2024
6bb8683
chore: version bump
samjcombs Nov 22, 2024
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: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
frontend/node_modules
frontend/package-lock.json
frontend/build

backend/node_modules
backend/package-lock.json
backend/dist
backend/instant-mock.db
backend/data
Expand Down
73 changes: 46 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ on:
branches-ignore: [main]
pull_request:
branches-ignore: [main]

jobs:
e2e-tests:
build:
runs-on: ubuntu-latest
env:
TEST_PORT: 3033
Expand All @@ -22,31 +23,49 @@ jobs:
node-version: '20'
cache: 'npm'

- name: Install dependencies
- name: Install root dependencies
run: npm ci

- name: Create env file
run: |
echo "PLAY_PORT=${{ env.PLAY_PORT }}" >> .env
echo "RECORD_PORT=${{ env.RECORD_PORT }}" >> .env
echo "NODE_ENV=${{ env.NODE_ENV }}" >> .env

# Install Docker using a separate script to avoid dependency conflicts
- name: Install Docker
run: |
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo usermod -aG docker $USER
shell: bash

- name: Run e2e tests
run: npm run e2e:test

- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-test-results
path: |
cypress/videos/
cypress/screenshots/
- name: Install frontend dependencies
working-directory: frontend
run: npm ci

- name: Install backend dependencies
working-directory: backend
run: npm ci

- name: Build frontend
working-directory: frontend
env:
CI: false
run: npm run build

- name: Build backend
working-directory: backend
run: npm run build

# Keeping E2E setup for future use
# - name: Create env file
# run: |
# echo "PLAY_PORT=${{ env.PLAY_PORT }}" >> .env
# echo "RECORD_PORT=${{ env.RECORD_PORT }}" >> .env
# echo "NODE_ENV=${{ env.NODE_ENV }}" >> .env
#
# - name: Install Docker
# run: |
# curl -fsSL https://get.docker.com -o get-docker.sh
# sh get-docker.sh
# sudo usermod -aG docker $USER
# shell: bash
#
# - name: Run e2e tests
# run: npm run e2e:test
#
# - name: Upload test artifacts
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: e2e-test-results
# path: |
# cypress/videos/
# cypress/screenshots/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ node_modules/
.docusaurus
seeds.db
.pgpass

.idea/
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"bracketSpacing": false,
"arrowParens": "always",
"printWidth": 80,
"proseWrap": "always",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}
17 changes: 15 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
FROM node:20-alpine AS frontend-builder
WORKDIR /app/frontend

ARG REACT_APP_BACKEND_URL
ENV REACT_APP_BACKEND_URL=$REACT_APP_BACKEND_URL
ARG REACT_APP_BACKEND_PORT
ENV REACT_APP_BACKEND_PORT=$REACT_APP_BACKEND_PORT
ARG REACT_APP_FRONTEND_URL
ENV REACT_APP_FRONTEND_URL=$REACT_APP_FRONTEND_URL
ARG REACT_APP_FRONTEND_PORT
ENV REACT_APP_FRONTEND_PORT=$REACT_APP_FRONTEND_PORT
ARG REACT_APP_FRONTEND_REQUIRE_AUTH
ENV REACT_APP_FRONTEND_REQUIRE_AUTH=$REACT_APP_FRONTEND_REQUIRE_AUTH

COPY frontend/package*.json ./
RUN npm install
RUN npm ci

COPY frontend/ .
RUN npm run build
Expand All @@ -12,16 +23,18 @@ FROM node:20-alpine AS backend-builder
WORKDIR /app/backend

COPY backend/package*.json ./
RUN npm install
RUN npm ci

COPY backend/ .
RUN npm run build
RUN cp package.json dist/


FROM node:20-alpine AS final
WORKDIR /app

COPY --from=backend-builder /app/backend/dist ./backend/dist
COPY --from=backend-builder /app/backend/package.json ./backend/
COPY --from=backend-builder /app/backend/node_modules ./backend/node_modules
COPY --from=frontend-builder /app/frontend/build ./frontend/build

Expand Down
2 changes: 1 addition & 1 deletion backend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
ecmaVersion: 2020,
sourceType: 'module',
},
ignorePatterns: ['**/*.test.ts', 'dist/**'],
ignorePatterns: ['**/*.test.ts', 'dist/'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
Expand Down
Loading