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

Test if the CI/CD pipeline works #693

Closed
wants to merge 264 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
264 commits
Select commit Hold shift + click to select a range
f809051
setup
AlexXi19 Oct 19, 2022
7a06bd5
Update README.md
AlexXi19 Oct 19, 2022
6c14bc7
cleanup
AlexXi19 Oct 19, 2022
e1487f1
codegen
AlexXi19 Oct 19, 2022
61cf9e1
Update README.md
AlexXi19 Oct 19, 2022
b5b3f20
update generate types
AlexXi19 Oct 19, 2022
7368d3f
basic framework for grades resolver
Oct 22, 2022
40ff47e
schema merging
AlexXi19 Oct 22, 2022
3987bb9
start adding schedule files
zacharyzollman Oct 22, 2022
1ddbf2b
cleanup
AlexXi19 Oct 22, 2022
5585d12
gitignore
zacharyzollman Oct 22, 2022
a361019
Merge branch 'master' of https://github.com/AlexXi19/berkeleytime-gql…
zacharyzollman Oct 22, 2022
d0a99f0
fix typedef
AlexXi19 Oct 22, 2022
dec859c
actions
AlexXi19 Oct 23, 2022
697459d
Delete .DS_Store
Youngster-Joey Oct 23, 2022
4b43aaf
killed DS_Store hopefully for real this time?
Oct 23, 2022
cbe107d
killed DS_Store
Oct 23, 2022
57133a8
Merge branch 'master' of https://github.com/AlexXi19/ts-graphql-start…
AlexXi19 Oct 23, 2022
5d3098a
fix vulnerabilities and update dependencies
AlexXi19 Oct 23, 2022
15e13bc
update to apollo 4 and add linting
AlexXi19 Oct 23, 2022
a76a0d5
change action name
AlexXi19 Oct 23, 2022
a9e04f0
change action name
AlexXi19 Oct 23, 2022
a373807
Merge branch 'master' of https://github.com/AlexXi19/ts-graphql-starter
AlexXi19 Oct 23, 2022
d82da5f
add classes model
AlexXi19 Oct 28, 2022
453155c
add simple enrollment resolver and diff generator
AlexXi19 Oct 28, 2022
1e97869
clean up and remove no explicit any linting
AlexXi19 Oct 28, 2022
b09d926
starting point
ikeg225 Oct 28, 2022
c85e0f8
fix linting errors
ikeg225 Oct 28, 2022
1430031
Merge pull request #2 from AlexXi19/classes-v2
AlexXi19 Oct 29, 2022
c030a0d
fixing type errros
ikeg225 Oct 29, 2022
d483f6a
fix lint
ikeg225 Oct 29, 2022
003ee83
add env.example
AlexXi19 Oct 29, 2022
895d593
enrollment first finish
AlexXi19 Oct 29, 2022
1209c4d
Merge pull request #3 from AlexXi19/classes
AlexXi19 Oct 29, 2022
12a61e5
add basic catalog types and resolver
kevinzwang Oct 29, 2022
d989e4a
Merge branch 'master' into grades-schema
ikeg225 Oct 29, 2022
e614094
added arguments
ikeg225 Oct 29, 2022
71dabd9
fix class schema and change id
AlexXi19 Oct 29, 2022
3915372
Created get user by google id graphql query
williamT386 Nov 3, 2022
c760abf
Modified MongoDB data and typdef to match new User Graphql schema
williamT386 Nov 3, 2022
6612c31
query by all semesters
ikeg225 Nov 4, 2022
697a2a0
add name field
zacharyzollman Nov 4, 2022
a369087
update created_by field
zacharyzollman Nov 4, 2022
3df65d2
finished first resolver
ikeg225 Nov 4, 2022
da3b2fb
Update controller.ts
zacharyzollman Nov 4, 2022
78c19bb
preliminary resolver for courses in catalog
Nov 4, 2022
1f0d10e
added some files (cont'd from prev)
Nov 4, 2022
4c5b129
update vulnerable dependency from apollo server
AlexXi19 Nov 5, 2022
fb7de9a
improve formatter and controller
zacharyzollman Nov 5, 2022
64f41c3
fixed issue with identifiers
Nov 5, 2022
f84fe40
various type fixes
zacharyzollman Nov 5, 2022
01e1087
add gpa, letter, and denominator
ikeg225 Nov 5, 2022
0ed2127
Did data migration from sample Postgres db to Mongo and modified Grap…
williamT386 Nov 16, 2022
d3b1c02
Update index.ts
zacharyzollman Feb 3, 2023
3f61380
Merge branch 'master' into schedule
zacharyzollman Feb 15, 2023
e65669c
update apollo and regenerate types
zacharyzollman Feb 15, 2023
cef5189
Update controller.ts
zacharyzollman Feb 15, 2023
c29950f
Throw error on invalid user id
maxmwang Feb 16, 2023
55fdc17
Remove testing files
maxmwang Feb 16, 2023
396b9d0
Merge branch 'master' into user-graphql
maxmwang Feb 16, 2023
9862f72
Fix git check
maxmwang Feb 16, 2023
a98b3b4
Generate graphql typedefs
maxmwang Feb 16, 2023
3f03ace
Query user by email not id
maxmwang Feb 18, 2023
2ae4681
Merge pull request #4 from asuc-octo/user-graphql
zacharyzollman Feb 18, 2023
9922386
Merge branch 'master' into schedule
zacharyzollman Feb 18, 2023
20a9386
update weeks variable, term-specific query, and throw errors
zacharyzollman Feb 18, 2023
3f6183c
Merge branch 'master' into grades-schema
zacharyzollman Feb 18, 2023
5572340
Remove redundant cors middleware
maxmwang Feb 21, 2023
818c2b4
Remove redundant bodyParser dependency
maxmwang Feb 21, 2023
b46f4e8
basic catalog resolver functionality
Youngster-Joey Feb 23, 2023
25ef935
basic catalog resolver functionality
Youngster-Joey Feb 23, 2023
bc42036
update error checking in grades controller
zacharyzollman Feb 23, 2023
3a35dc8
Merge pull request #1 from asuc-octo/grades-schema
zacharyzollman Feb 23, 2023
6fe4829
Merge pull request #5 from asuc-octo/classes
zacharyzollman Feb 23, 2023
cd09ab4
Update package.json
maxmwang Feb 24, 2023
40ced3d
Merge branch 'master' into schedule
zacharyzollman Feb 27, 2023
fc2535b
initial attempt at removing schedule
zacharyzollman Feb 27, 2023
ae4bc36
add barely functional schedule creation mutation
zacharyzollman Feb 27, 2023
3895e41
make schedule name and is_public optional
zacharyzollman Feb 27, 2023
215086a
try to fix linting error
zacharyzollman Feb 27, 2023
ad6214b
improve schedule mutation functionality
zacharyzollman Feb 27, 2023
b58d038
set classes and update timestamps
zacharyzollman Feb 27, 2023
a3e8a44
catalog resolver basic functionality and courseId query
Youngster-Joey Mar 2, 2023
8262f49
schedule ObjectID updates
zacharyzollman Mar 2, 2023
d032fcc
add mutation for editing existing schedule
zacharyzollman Mar 2, 2023
8d68278
make is_public optional
zacharyzollman Mar 2, 2023
d9aa87d
User OAuth login with sessions, express-session and Apollo context in…
maxmwang Mar 2, 2023
2b2c04a
create new interface for updating schedule info
zacharyzollman Mar 2, 2023
055cebd
make fields other than arrays and id optional for editing schedule
zacharyzollman Mar 2, 2023
a40d86c
fix linting error
zacharyzollman Mar 2, 2023
2ca66fd
Secure function to authenticating endpoints
maxmwang Mar 6, 2023
6c28e7c
Create new User object upon first login
maxmwang Mar 6, 2023
a5d5ab0
Update last_login on login
maxmwang Mar 6, 2023
289a7dc
Merge branch 'master' into user-auth
maxmwang Mar 6, 2023
dfd9365
Mongo document types
maxmwang Mar 6, 2023
e003861
Cleanup, safe process.env
maxmwang Mar 6, 2023
6199c95
add catalog and grade resolvers
kevinzwang Mar 9, 2023
e520f85
remove redundant classes module
kevinzwang Mar 9, 2023
a6ccbc0
add timestamps and interface for schedule creation
zacharyzollman Mar 9, 2023
82c4f5a
make arrays optional in mutations
zacharyzollman Mar 9, 2023
949fabe
add secondary section IDs field
zacharyzollman Mar 9, 2023
a31cfd6
Mongo model and gql typedef
maxmwang Mar 9, 2023
e526071
remove time metadata fields
zacharyzollman Mar 9, 2023
fb24a4f
clean up existing schedule resolvers
zacharyzollman Mar 9, 2023
d84227d
add course, class, and section schemas
kevinzwang Mar 9, 2023
0bf7ae8
Update typedefs
maxmwang Mar 9, 2023
032d884
Query and mutations
maxmwang Mar 9, 2023
9bd5578
Add refresh_token to schema
maxmwang Mar 9, 2023
94938c5
Lint fix, schema selectors
maxmwang Mar 9, 2023
d3ecbbe
Merge branch 'user-auth' into user-mutations
maxmwang Mar 9, 2023
80203c0
Set fields as immutable
maxmwang Mar 10, 2023
4ac861d
Rename context to contextValue
maxmwang Mar 10, 2023
49c2a41
Merge branch 'user-auth' into user-mutations
maxmwang Mar 10, 2023
32a439a
Delete user mutation
maxmwang Mar 10, 2023
4012f08
Add descriptions and remove linting
kevinzwang Mar 10, 2023
3ccbeef
Change null to undefined
maxmwang Mar 10, 2023
50160c7
Add ISODate type
kevinzwang Mar 10, 2023
4059528
Extra security
maxmwang Mar 10, 2023
d0c634a
Merge branch 'user-auth' into user-mutations
maxmwang Mar 10, 2023
14acd22
Add all catalog functionality
kevinzwang Mar 10, 2023
260fcb3
Renew sessions on new request
maxmwang Mar 12, 2023
476fde6
Use findOneAndUpdate
maxmwang Mar 13, 2023
63ccd4d
add courseList and classes queries
kevinzwang Mar 13, 2023
586d743
Reduce unnecessary queries and add latest course query
kevinzwang Mar 13, 2023
327073d
Improve code speed and readability
kevinzwang Mar 14, 2023
d205602
Remove getCourseSections
kevinzwang Mar 14, 2023
e503ed2
Add enrollment query, but no implementation
kevinzwang Mar 14, 2023
9004d15
Merge branch 'master' into enrollment
kevinzwang Mar 14, 2023
911a5b2
Fix linter comments
kevinzwang Mar 14, 2023
5a6b488
Secure user query
maxmwang Mar 14, 2023
fd5c878
Use directive for authentication in apollo typeDefs
maxmwang Mar 16, 2023
8c7e7ab
add draft gql docstrings for schedule
zacharyzollman Mar 18, 2023
65cf55a
Add graphql docs and more consistent empty response
kevinzwang Mar 22, 2023
971c7a7
Merge pull request #10 from asuc-octo/enrollment
kevinzwang Mar 22, 2023
fea543e
Update generated-types
maxmwang Mar 23, 2023
488a020
Merge branch 'master' into HEAD
maxmwang Mar 23, 2023
6c1466c
Merge branch 'user-auth' into user-mutations
maxmwang Mar 23, 2023
d100062
Update env.example
maxmwang Mar 23, 2023
d5d5d42
Migrate from secure wrapper function to auth directive
maxmwang Mar 23, 2023
9b26500
Only allow users to query for themselves
maxmwang Mar 23, 2023
2012ee2
Fix env.example
maxmwang Mar 23, 2023
c34ad10
Typedef docstrings
maxmwang Mar 23, 2023
cb1a1a9
Optimize mutations
maxmwang Mar 23, 2023
437ec6f
Test: expect fail
maxmwang Mar 23, 2023
0c6ace8
Test: expect success
maxmwang Mar 23, 2023
9cca072
Clean up
maxmwang Mar 23, 2023
85987b5
Test debug message: expect fail
maxmwang Mar 23, 2023
6112314
Test debug message: expect success
maxmwang Mar 23, 2023
56765cd
Clean up
maxmwang Mar 23, 2023
76f0b24
Merge pull request #11 from asuc-octo/codegen-github-action
zacharyzollman Mar 23, 2023
f474d75
Merge branch 'master' into schedule
zacharyzollman Mar 23, 2023
41a2589
move schedule model into src/db
zacharyzollman Mar 23, 2023
59f3a7e
Update package-lock.json
zacharyzollman Mar 23, 2023
a677c06
require non-null string entries in schedule string arrays
zacharyzollman Mar 23, 2023
3c37668
regenerate types
zacharyzollman Mar 23, 2023
74c9363
update schedule formatting to account for undefined custom_events
zacharyzollman Mar 23, 2023
b5059c6
switch back to automatic _id
zacharyzollman Mar 23, 2023
5c031ae
improve type checking in controller
zacharyzollman Mar 23, 2023
9aecb86
Merge branch 'master' into schedule
zacharyzollman Mar 24, 2023
7169796
use ternary operators in schedule controller
zacharyzollman Mar 24, 2023
dade25d
add options to model, change public to is_public
zacharyzollman Mar 24, 2023
1a885dd
clean up schedule controller and resolver types
zacharyzollman Mar 24, 2023
a12497e
change term input from String to Term
zacharyzollman Mar 24, 2023
91c8a81
add term output type
zacharyzollman Mar 24, 2023
34f2eae
store term as an object instead of as a string
zacharyzollman Mar 24, 2023
4117eb7
add Term docstring and update README
zacharyzollman Mar 24, 2023
d0e69d3
regenerate types
zacharyzollman Mar 24, 2023
8734d16
rename Term types to more clearly distinguish between input and output
zacharyzollman Mar 24, 2023
f9341f1
switch to TermInput in schedule controller
zacharyzollman Mar 24, 2023
fd9388c
make created_by mutable
zacharyzollman Mar 24, 2023
3af0632
Combine mutations into one
maxmwang Mar 25, 2023
439f448
Optimize queries and simplify resolvers
maxmwang Mar 25, 2023
aecc8a5
Destory session on logout/delete account
maxmwang Mar 25, 2023
5e42d3a
Fix explicit null bug
maxmwang Mar 26, 2023
714d159
Simplify formatter
maxmwang Mar 26, 2023
e07b939
Typedef naming convention, @auth directive placement, format dates as…
maxmwang Mar 26, 2023
4021fd4
Move model.ts to src/db
maxmwang Mar 26, 2023
40976b3
Use lodash
maxmwang Mar 26, 2023
960c7e5
Add comment
maxmwang Mar 26, 2023
5ad87ba
Move @auth to field
maxmwang Mar 27, 2023
db619cf
create and use ScheduleInput
zacharyzollman Mar 29, 2023
d7a9b72
clean up
zacharyzollman Mar 29, 2023
5947121
create CustomEventInput
zacharyzollman Mar 29, 2023
9f40c04
try to remove explicit nulls
zacharyzollman Mar 29, 2023
4c1a7aa
stop creating ObjectIDs for terms
zacharyzollman Mar 29, 2023
7e92dc1
add creation and revision dates to object
zacharyzollman Mar 29, 2023
698ba79
Merge pull request #8 from asuc-octo/schedule
zacharyzollman Mar 31, 2023
d22668b
Merge branch 'master' into user-auth
maxmwang Apr 5, 2023
af6763b
Merge pull request #6 from asuc-octo/user-auth
maxmwang Apr 5, 2023
cb531a7
Merge remote-tracking branch 'gql/master'
kevinzwang Apr 5, 2023
46f94d1
remove old backend
kevinzwang Apr 5, 2023
bfa20de
Move .github to root
maxmwang Apr 5, 2023
0522cf7
(Fix) Move .github to root
maxmwang Apr 5, 2023
ba2d8f4
Add working docker compose
kevinzwang Apr 6, 2023
81feff5
Update readme with run instructions
kevinzwang Apr 6, 2023
5636488
Update compose and instructions
kevinzwang Apr 6, 2023
4117eb8
Fix authentication routes
maxmwang Oct 8, 2023
ee798b1
Remove unused dependencies
maxmwang Oct 8, 2023
7abb77e
Update .env.template
maxmwang Oct 8, 2023
ff1b1f2
added authentication
Chengming-Li Oct 9, 2023
2ea380f
added authentication to mutations
Chengming-Li Oct 11, 2023
072e81f
undid accidental changes to package lock
Chengming-Li Oct 11, 2023
1193299
Merge pull request #633 from asuc-octo/gql-auth
Chengming-Li Oct 17, 2023
3422e6e
Setup scripts folder
KartavyaSharma Oct 7, 2023
fc4435f
Upgrade backend dependencies
kevinzwang Oct 23, 2023
8e4a85b
Move db files to models and update SIS models
kevinzwang Oct 23, 2023
1aa2c4e
Add catalog update script
kevinzwang Oct 23, 2023
5bcf09c
Merge pull request #639 from asuc-octo/kev-update-scripts
kevinzwang Nov 7, 2023
072e776
fix: change logout route to GET
maxmwang Nov 7, 2023
f8ed877
Merge pull request #651 from asuc-octo/gql-logout
maxmwang Nov 9, 2023
d388ea2
fix: remove Makefile
maxmwang Nov 14, 2023
74a1e54
Rewrite schedule schema to better track courses(#644)
Chengming-Li Nov 14, 2023
7479aa5
revert: use POST for logout
maxmwang Nov 14, 2023
e7bc4a4
init: file structure and ingress/service/deployment templates
maxmwang Dec 6, 2023
8047380
refactor: flatten charts file directory
maxmwang Dec 7, 2023
2d541cd
pull images from docker registry, running on local kube engine
maxmwang Jan 25, 2024
f6ac91f
feat: nginx-controller routing to frontend
maxmwang Jan 27, 2024
39cc1bc
refactor: rename directory
maxmwang Jan 27, 2024
2d01af0
feat: mongodb
maxmwang Jan 27, 2024
94e6dcf
feat: redis
maxmwang Jan 27, 2024
c6b7c12
refactor: move ingress-nginx to namespace bt-base
maxmwang Feb 1, 2024
44a4f99
add mongodb install command in init.sh
Chengming-Li Feb 11, 2024
0e2a843
add redis install command to init.sh
Chengming-Li Feb 12, 2024
3c65949
modify backend env uri's to use redis and mongo pod services
Chengming-Li Feb 12, 2024
54df980
fix: mongodb and redis urls in backend
maxmwang Feb 16, 2024
e072e01
migrate to octoberkeleytime docker hub image repos
maxmwang Feb 18, 2024
5b4cc66
remove old infra, rename new-infra directory
maxmwang Feb 18, 2024
7903b85
remove old infra, rename new-infra directory (actually)
maxmwang Feb 18, 2024
d5364b9
remove helm build package
maxmwang Feb 18, 2024
5fc6bef
use --values values.yaml instead of inline --set
maxmwang Feb 18, 2024
c8ae223
add prod infra
kevinzwang Feb 20, 2024
8fa83db
reorder charts and change ingress to use issuer, not clusterissuer
kevinzwang Feb 20, 2024
75dac81
Merge pull request #672 from asuc-octo/infra-kev
maxmwang Feb 22, 2024
cd7d488
create cron job to spin up new pod
Chengming-Li Feb 22, 2024
7b24586
finish updater.yaml
Chengming-Li Feb 22, 2024
4ed0c3b
mongo bitnami chart
maxmwang Feb 23, 2024
883a86d
fix implementation to allow for multiple commands
Chengming-Li Feb 23, 2024
7d36ee3
add metallb and move base dependencies
kevinzwang Feb 23, 2024
94c218b
fix default address range (oops used current bt ip)
kevinzwang Feb 23, 2024
bca70d0
move to letsencrypt prod
kevinzwang Feb 23, 2024
f711c5d
add common labels to metallb configs
kevinzwang Feb 23, 2024
d8b8f5f
formatting
maxmwang Feb 27, 2024
ef1d4b9
use bitnami mongodb chart
maxmwang Feb 27, 2024
b11005c
use existingClaim as pvc name
maxmwang Feb 28, 2024
75f6054
merge infra in
maxmwang Feb 28, 2024
ade9469
Merge pull request #680 from asuc-octo/infra-mongo
maxmwang Feb 28, 2024
4e03e7b
express trust proxy (nginx)
maxmwang Feb 29, 2024
df0da41
disable mongo auth, update helm commands
maxmwang Feb 29, 2024
db49184
add CI/CD workflows
Chengming-Li Mar 25, 2024
bc75ecb
test
Chengming-Li Mar 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 16 additions & 16 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# ".env.template" is not actually used anywhere. It is just to show the format of an appropriate environment file
DATABASE_URL=postgres://<username>:<password>@<hostname>:5432/bt
DJANGO_SECRET_KEY=
ENVIRONMENT_NAME=localhost
GOOGLE_APPLICATION_CREDENTIALS_FILE_CONTENTS_BASE64=
GOOGLE_APPLICATION_CREDENTIALS_FILEPATH=/auth.json
GOOGLE_SIGNIN_CLIENT_SECRET_CONTENTS_BASE64=
GOOGLE_SIGNIN_CLIENT_SECRET_FILEPATH=/signin.json
GOOGLE_EMAIL=
GOOGLE_PASS=
GITHUB_TOKEN=
REDIS_URL=redis://<username>:<password>@<hostname>:6379
SIS_CLASS_APP_ID=
SIS_CLASS_APP_KEY=
SIS_COURSE_APP_ID=
SIS_COURSE_APP_KEY=
PORT=5001
URL=http://localhost:5001
BACKEND_PATH=/api
GRAPHQL_PATH=/graphql
NODE_ENV=development
MONGODB_URI=mongodb://mongodb:27017/bt
REDIS_URI=redis://redis:6379

SIS_CLASS_APP_ID=_
SIS_CLASS_APP_KEY=_
SIS_COURSE_APP_ID=_
SIS_COURSE_APP_KEY=_

GOOGLE_CLIENT_ID=_
GOOGLE_CLIENT_SECRET=_
SESSION_SECRET=_
35 changes: 35 additions & 0 deletions .github/workflows/cd-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name:
Deploy to Dev

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: SSH into Hozer
uses: appleboy/ssh-action@v1.0.3
with:
host: hozer-51.ocf.berkeley.edu
username: root
key: ${{ secrets.SSH_KEY }}
script: |
cd /berkeleytime
git checkout ${{ github.event.pull_request.head.sha }}
git pull
docker compose up --build -d
docker tag berkeleytime-backend octoberkeleytime/bt-backend:${{ github.event.pull_request.head.sha }}
docker tag berkeleytime-frontend octoberkeleytime/bt-frontend:${{ github.event.pull_request.head.sha }}
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker push octoberkeleytime/bt-backend:${{ github.event.pull_request.head.sha }}
docker push octoberkeleytime/bt-frontend:${{ github.event.pull_request.head.sha }}
helm install bt-dev-app ./app --namespace=bt \
--set host=${{ github.event.pull_request.head.sha }}.stanfurdtime.com \
--set mongoUri=mongodb://bt-dev-mongo-mongodb.bt.svc.cluster.local:27017/bt \
--set redisUri=redis://bt-dev-redis-master.bt.svc.cluster.local:6379 \
--set nodeEnv=development \
--set frontend.image.tag=${{ github.event.pull_request.head.sha }} \
--set backend.image.tag=${{ github.event.pull_request.head.sha }}
30 changes: 30 additions & 0 deletions .github/workflows/cd-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name:
Deploy to Staging

on:
push:
branches: [ master ]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: SSH into Hozer
uses: appleboy/ssh-action@v1.0.3
with:
host: hozer-51.ocf.berkeley.edu
username: root
key: ${{ secrets.SSH_KEY }}
script: |
cd /berkeleytime
git checkout master
git pull
docker compose up --build -d
docker tag berkeleytime-backend octoberkeleytime/bt-backend:latest
docker tag berkeleytime-frontend octoberkeleytime/bt-frontend:latest
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker push octoberkeleytime/bt-backend:latest
docker push octoberkeleytime/bt-frontend:latest
kubectl rollout restart deployment bt-staging-app-backend
kubectl rollout restart deployment bt-staging-app-frontend
36 changes: 36 additions & 0 deletions .github/workflows/gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name:
Codegen Test

on:
push:
pull_request:

jobs:
Codegen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: install node v12
uses: actions/setup-node@v1
with:
node-version: 12

- name: npm install
run: npm install

- name: gen
run: npm run generate

- name: test diff
uses: tj-actions/verify-changed-files@v14
id: test-diff
with:
files: |
**/generated-types/*.ts

- if: steps.test-diff.outputs.files_changed == 'true'
run: |
echo "Run 'npm run generate' to fix!"
exit 1

20 changes: 20 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name:
Linting

on:
push:
pull_request:

jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install node v12
uses: actions/setup-node@v1
with:
node-version: 12
- name: npm install
run: npm install
- name: lint
run: npm run lint
24 changes: 0 additions & 24 deletions Makefile

This file was deleted.

18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@
A course discovery and planning tool which combines all of UC Berkeley's academic information in one place. We intend to make it a more accurate and powerful tool than anything students currently use.

Berkeleytime was created by [Yuxin Zhu](http://yuxinzhu.com/) and [Noah Gilmore](https://noahgilmore.com) and is maintained by [the ASUC Office of the CTO](https://octo.asuc.org/).
# Getting started

## Development
Create an `.env` file with the keys in `.env.template` populated accordingly.

Much of the current development is on [the node branch](https://github.com/asuc-octo/berkeleytime/tree/node).
Start Docker before running these in repo root

It hasn't been updated recently, but this project does have [a wiki](https://github.com/asuc-octo/berkeleytime/wiki).
```{bash}
docker-compose up # CTRL+C to stop
docker-compose down # cleaner shutdown, removes containers
```

To seed the database, run these following commands while the containers are up. You will only need to do this once.
```{bash}
curl -O https://storage.googleapis.com/berkeleytime/public/mdb.archive
docker run --rm --volume "${PWD}/mdb.archive":/mdb.archive --network bt mongo:5 mongorestore --drop --host mongodb --gzip --archive=mdb.archive
```

Local site becomes available at http://localhost:8080
30 changes: 30 additions & 0 deletions backend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"ignorePatterns": [
"node_modules/",
"dist/",
"src/**/generated-types",
"src/generated-types"
],
"overrides": [
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
}
6 changes: 6 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
build/
data/
.env
coverage/
.DS_Store
8 changes: 5 additions & 3 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM python:3.8-slim
FROM node:16.14.2-slim AS builder
RUN mkdir /backend
WORKDIR /backend
COPY package.json .
RUN npm install --prefer-offline --no-audit
COPY . .
RUN apt-get update || : && apt-get install libpq-dev gcc -y && \
python3 -m pip install -r requirements.txt
RUN npm run build
ENTRYPOINT node build
84 changes: 84 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# berkeleytime-gql

New playground for the node/graphql rewrite

## Before you start

- Duplicate the `env.example` file and rename it `.env`
- Run `npm install`

## Development

- Run `npm run dev`
- Start you docker container from the berkeleytime repo node branch

#### Access to the GraphQL Playground (Dev only)

- `http://localhost:5001/graphql`

## Typesafety

The main concern for typesafety comes from the potential inconsistency between `typedefs` (GraphQL SDL) and your actual resolvers. To maintain typesafety, we use [GraphQL Code Generation](https://www.the-guild.dev/graphql/codegen/docs/getting-started) to generate types for schemas, resolvers and more.

To generate types, run `npm run generate`

### Typesafety with Modules

Type safety is also set up within modules, see the [documentation](https://www.the-guild.dev/graphql/codegen/docs/guides/graphql-modules) for more details.

## Folder structure

#### Overview

```
.
├── src # Where your source code lives
│ ├── bootstrap # Bootstrapping and loading of the API dependencies (Express, Apollo, Database, ...)
│ ├── db # Mongo schemas, models and types
│ ├── generated-types # Generated types from codegen
│ ├── modules # Business logic of the app divided by domain (such as User and Catalog)
│ ├── tests # Where all our testing strategy lives
│ ├── utils # Collection of utils function that we use in the project
│ ├── config.ts # Config of the app, sourced by environment variables
│ └── index.ts # Entry point of the API
├── jest-mongodb-config.js # Optional if you don't use MongoDB!
├── jest.config.js # Jest configuration
├── docker-compose.yml # Docker compose configuration (Optional !)
├── .env.example # Example of what your .env file should look like
├── .gitignore # Standard gitignore file
└── codegen.ts # Code generation configurations
├── package.json # Node module dependencies
├── README.md # Simple readme file
└── tsconfig.json # TypeScript compiler options
```

#### Module example (FOR NOW)

```
.
├── src
│ └── modules
│ └── user # Module name
│ ├── index.ts # Entrypoint to the module
│ └── generated-types # Generated types from codegen
│ └── module-types.ts # Relevant GraphQL typescript types
│ └── typedefs # Typedefs
│ └── [schema].ts # A typedef for a schema
│ ├── controller.ts # Your crud controller methods
│ ├── fixture.ts # Object used for testing (can ignore)
│ ├── formatter.ts # Formats your db models to your controller/gql models
│ ├── resolver.ts # Your resolver
│ ├── schema.ts # Your gql schemas (and potentially typscript interfaces associated to the schemas)
│ └── service.ts # Business logic of your app
```

#### Build and start server for production

- Run `npm start`

#### Technologies used

- NodeJS and TypeScript
- GraphQL with Apollo Server
- MongoDB Database integrated with Mongoose
Empty file removed backend/berkeleytime/__init__.py
Empty file.
16 changes: 0 additions & 16 deletions backend/berkeleytime/asgi.py

This file was deleted.

Empty file.
Empty file.
24 changes: 0 additions & 24 deletions backend/berkeleytime/config/finals/finals.py

This file was deleted.

Loading
Loading