Skip to content

Commit

Permalink
Merge pull request #1183 from eduhub-org/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
steffen74 authored Jan 3, 2025
2 parents 2136874 + 53bcb96 commit 05fdcaf
Show file tree
Hide file tree
Showing 142 changed files with 1,913 additions and 1,266 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/frontend-code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,47 @@ on:
push:
paths:
- frontend-nx/**
branches-ignore:
- staging
- production
branches:
- "**"
- "!staging"
- "!production"
pull_request:
paths:
- frontend-nx/**
branches-ignore:
- staging
- production
branches:
- develop
types: [opened, synchronize, reopened]

jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'push' || (github.event_name != 'push' && !contains(github.event.head_commit.message, 'Merge pull request'))
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.head_commit.message, 'Merge pull request'))
strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout project
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Nx Cache
uses: actions/cache@v3
with:
path: |
node_modules/.cache/nx
.nx/cache
key: ${{ runner.os }}-nx-${{ hashFiles('yarn.lock') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-nx-${{ hashFiles('yarn.lock') }}-
${{ runner.os }}-nx-
- name: Install yarn dependencies
working-directory: frontend-nx
run: yarn
Expand Down
55 changes: 48 additions & 7 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,61 @@
tasks:
- name: Start Docker Compose
init: docker compose -f docker-compose.yml up -d
command: echo "Docker Compose is up and running!"
- name: Development Environment
init: |
echo "STORAGE_BUCKET_URL=https://4001-${GITPOD_WORKSPACE_URL#https://}" > .env
echo "HASURA_GRAPHQL_ADMIN_SECRET=myadminsecretkey" >> .env
docker compose -f docker-compose.yml up -d &&
echo "Waiting for Hasura to be ready..." &&
until curl -s -f -o /dev/null "https://8080-${GITPOD_WORKSPACE_URL#https://}/healthz"; do
sleep 2
done &&
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash &&
# Install frontend dependencies
if [ -d "frontend-nx" ]; then
cd frontend-nx &&
yarn install --ignore-engines &&
cd ..
else
echo "frontend-nx directory not found!"
fi
command: |
# Start Hasura console
if [ -d "backend" ]; then
cd backend &&
source ../.env &&
echo "Environment is ready! You can now use Hasura Console with:" &&
echo "hasura console --endpoint https://8080-${GITPOD_WORKSPACE_URL#https://} --address 0.0.0.0" &&
hasura console --endpoint https://8080-${GITPOD_WORKSPACE_URL#https://} --address 0.0.0.0 &
cd ..
fi
# Start frontend development
if [ -d "frontend-nx" ]; then
cd frontend-nx &&
export NEXT_PUBLIC_STORAGE_BUCKET_URL=https://4001-${GITPOD_WORKSPACE_URL#https://}/emulated-bucket &&
export NEXT_PUBLIC_ENVIRONMENT=development &&
yarn dev
else
echo "frontend-nx directory not found!"
fi
ports:
- port: 5000
onOpen: open-preview
onOpen: open-browser
visibility: public
- port: 5001
onOpen: open-preview
onOpen: open-browser
visibility: public
- port: 42000
onOpen: ignore
- port: 42001-42024
onOpen: ignore
- port: 4001
onOpen: ignore
- port: 8080
onOpen: open-preview
onOpen: ignore
visibility: public
- port: 28080
onOpen: open-preview
onOpen: ignore
- port: 9695
onOpen: open-browser
visibility: public
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# EduHub :mortar_board:

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/edu-hub-project/application)

A comprehensive education platform focusing on course applications, event registrations, learning communities, and more.

## Introduction
Expand Down
1 change: 0 additions & 1 deletion backend/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
version: 3
endpoint: http://localhost:8080/
admin_secret: myadminsecretkey
api_paths:
v1_query: v1/query
Expand Down
2 changes: 1 addition & 1 deletion backend/dockerfile-dev-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cd /hasura
graphql-engine serve &

# Wait for Hasura to become ready
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/healthz)" != "200" ]]; do
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://hasura:8080/healthz)" != "200" ]]; do
sleep 2
done

Expand Down
3 changes: 3 additions & 0 deletions backend/metadata/databases/default/tables/public_Course.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ table:
name: Course
schema: public
object_relationships:
- name: CourseRegistrationType
using:
foreign_key_constraint_on: registrationType
- name: CourseStatus
using:
foreign_key_constraint_on: status
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
table:
name: CourseRegistrationType
schema: public
is_enum: true
array_relationships:
- name: Courses
using:
foreign_key_constraint_on:
column: registrationType
table:
name: Course
schema: public
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
table:
name: CourseType
schema: public
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ table:
name: Employment
schema: public
is_enum: true
array_relationships:
- name: Users
using:
foreign_key_constraint_on:
column: employment
table:
name: User
schema: public
select_permissions:
- role: anonymous
permission:
Expand Down
4 changes: 4 additions & 0 deletions backend/metadata/databases/default/tables/public_Program.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
table:
name: Program
schema: public
object_relationships:
- name: ProgramType
using:
foreign_key_constraint_on: type
array_relationships:
- name: CertificateTemplatePrograms
using:
Expand Down
12 changes: 12 additions & 0 deletions backend/metadata/databases/default/tables/public_ProgramType.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
table:
name: ProgramType
schema: public
is_enum: true
array_relationships:
- name: Programs
using:
foreign_key_constraint_on:
column: type
table:
name: Program
schema: public
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ table:
name: University
schema: public
is_enum: true
array_relationships:
- name: Users
using:
foreign_key_constraint_on:
column: university
table:
name: User
schema: public
select_permissions:
- role: anonymous
permission:
Expand Down
33 changes: 8 additions & 25 deletions backend/metadata/databases/default/tables/public_User.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ object_relationships:
- name: UserStatus
using:
foreign_key_constraint_on: status
- name: employmentByEmployment
using:
foreign_key_constraint_on: employment
- name: universityByUniversity
using:
foreign_key_constraint_on: university
array_relationships:
- name: AchievementOptionMentors
using:
Expand Down Expand Up @@ -64,20 +58,18 @@ select_permissions:
- role: admin-ras
permission:
columns:
- created_at
- updated_at
- id
- externalProfile
- anonymousId
- newsletterRegistration
- otherUniversity
- university
- employment
- created_at
- email
- externalProfile
- firstName
- id
- lastName
- matriculationNumber
- newsletterRegistration
- occupation
- picture
- updated_at
filter: {}
- role: anonymous
permission:
Expand All @@ -86,10 +78,9 @@ select_permissions:
- firstName
- id
- lastName
- occupation
- organizationId
- otherUniversity
- picture
- university
filter: {}
limit: 10
- role: instructor_access
Expand All @@ -98,24 +89,21 @@ select_permissions:
- anonymousId
- created_at
- email
- employment
- externalProfile
- firstName
- id
- lastName
- matriculationNumber
- newsletterRegistration
- otherUniversity
- occupation
- picture
- university
- updated_at
filter: {}
limit: 100
- role: user_access
permission:
columns:
- email
- employment
- externalProfile
- firstName
- id
Expand All @@ -124,10 +112,8 @@ select_permissions:
- newsletterRegistration
- occupation
- organizationId
- otherUniversity
- picture
- status
- university
filter:
id:
_eq: X-Hasura-User-Id
Expand All @@ -137,17 +123,14 @@ update_permissions:
permission:
columns:
- email
- employment
- externalProfile
- firstName
- lastName
- matriculationNumber
- newsletterRegistration
- occupation
- organizationId
- otherUniversity
- picture
- university
filter:
id:
_eq: X-Hasura-User-Id
Expand Down
4 changes: 2 additions & 2 deletions backend/metadata/databases/default/tables/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
- "!include public_CourseGroupOption.yaml"
- "!include public_CourseInstructor.yaml"
- "!include public_CourseLocation.yaml"
- "!include public_CourseRegistrationType.yaml"
- "!include public_CourseStatus.yaml"
- "!include public_Employment.yaml"
- "!include public_Expert.yaml"
- "!include public_Language.yaml"
- "!include public_LocationOption.yaml"
Expand All @@ -34,10 +34,10 @@
- "!include public_Organization.yaml"
- "!include public_OrganizationType.yaml"
- "!include public_Program.yaml"
- "!include public_ProgramType.yaml"
- "!include public_Session.yaml"
- "!include public_SessionAddress.yaml"
- "!include public_SessionSpeaker.yaml"
- "!include public_University.yaml"
- "!include public_User.yaml"
- "!include public_UserOccupation.yaml"
- "!include public_UserStatus.yaml"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
alter table "public"."User"
add constraint "User_employment_fkey"
foreign key (employment)
references "public"."Employment"
(value) on update set null on delete set null;
alter table "public"."User" alter column "employment" drop not null;
alter table "public"."User" add column "employment" text;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."User" drop column "employment" cascade;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
alter table "public"."User"
add constraint "User_university_fkey"
foreign key (university)
references "public"."University"
(value) on update set null on delete set null;
alter table "public"."User" alter column "university" drop not null;
alter table "public"."User" add column "university" text;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."User" drop column "university" cascade;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table "public"."User" alter column "otherUniversity" drop not null;
alter table "public"."User" add column "otherUniversity" text;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table "public"."User" drop column "otherUniversity" cascade;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- DROP table "public"."University";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP table "public"."University";
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- DROP table "public"."Employment";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP table "public"."Employment";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "public"."CourseRegistrationType";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE TABLE "public"."CourseRegistrationType" ("value" text NOT NULL, "comment" text NOT NULL, PRIMARY KEY ("value") , UNIQUE ("value"));COMMENT ON TABLE "public"."CourseRegistrationType" IS E'Defines how users can register for a course';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DELETE FROM "public"."CourseRegistrationType" WHERE "value" = 'APPROVAL_WITH_INPUT';
Loading

0 comments on commit 05fdcaf

Please sign in to comment.