### Set up Environment Variables Source: https://github.com/eduhub-org/eduhub/blob/develop/README.md Copy the example environment file to .env. This is optional for basic setup but required for Formbricks integration. Edit the .env file to add your Formbricks credentials if needed. ```bash cp .env.example .env # Edit .env and add your Formbricks credentials if needed ``` -------------------------------- ### Start Development Environment Source: https://github.com/eduhub-org/eduhub/blob/develop/CONTRIBUTING.md Start the Docker-based development environment from the project root directory. ```bash # From project root docker compose up ``` -------------------------------- ### Start Python Functions Stack on Host Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/apiProxy/README.md Install dependencies and run the development server directly on the host machine. This method requires managing Python environments and dependencies manually. ```bash cd functions python3 -m pip install -r callPythonFunction/requirements.txt -r apiProxy/requirements.txt # On PEP 668–managed Python (e.g. many Linux distros), use a venv instead, or pass --break-system-packages if you accept the risk. # Secrets (Zoom, LimeSurvey, …) live in the repo-root .env — copy from .env.example if needed python3 dev.py ``` -------------------------------- ### Run Docker Compose Source: https://github.com/eduhub-org/eduhub/blob/develop/README.md Start the EduHub application using Docker Compose. Ensure Docker is installed and the repository is cloned. ```bash docker compose up ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/callNodeFunction/README.md Run this command to install all necessary project dependencies before running tests. ```bash npm install ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/eduhub-org/eduhub/blob/develop/CONTRIBUTING.md Navigate to the frontend directory and install project dependencies using Yarn. ```bash cd frontend-nx yarn install ``` -------------------------------- ### Install Hasura CLI Source: https://github.com/eduhub-org/eduhub/blob/develop/backend/README.md Link to the official Hasura documentation for installing the Hasura CLI. This is required for local development with migrations. ```text https://hasura.io/docs/1.0/graphql/core/hasura-cli/install-hasura-cli.html#install-hasura-cli ``` -------------------------------- ### Make a Manual GET Request to API Proxy Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/apiProxy/README.md Example of how to make a manual GET request to the API Proxy using curl, including necessary headers like the API key and version. ```bash curl -X GET "http://localhost:42026/participants" \ -H "X-API-Key: edh_live_org160_sk_056afe290cadf18e2b2d7482c5f4e5a5" \ -H "User-Agent: EduHub-Client/1.0" \ -H "Accept-Version: 3.0.1" ``` -------------------------------- ### Example Test Execution Output Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/callNodeFunction/README.md This is an example of the output you might see when running the test suite. ```bash $ npm test > callNodeFunction@0.0.1 test > node --experimental-vm-modules node_modules/.bin/jest PASS sendEnrollmentEmail/__tests__/sendEnrollmentEmail.test.js PASS sendSessionReminders/__tests__/sendSessionReminders.test.js Test Suites: 2 passed, 2 total Tests: 45 passed, 45 total Snapshots: 0 total Time: 2.34s Ran all test suites. ``` -------------------------------- ### Fetch Responses using Formbricks API Key Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/FORMBRICKS_INTEGRATION_PLAN.md Example of how to make a GET request to fetch survey responses using the x-api-key header. Ensure your API key has at least 'read' permissions. ```bash curl -X GET 'https://your-formbricks-instance.com/api/v1/management/responses?surveyId=xxx' \ -H 'x-api-key: YOUR_API_KEY_HERE' ``` -------------------------------- ### Good Examples of Semantic Commit Messages Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/SEMANTIC_RELEASE_WORKFLOW.md Use these examples for commit messages to ensure clarity and adherence to semantic release conventions. ```bash chore: merge develop into staging for release candidate ``` ```bash chore: merge develop into production for stable release ``` ```bash chore: prepare staging release from develop branch ``` ```bash chore: promote staging to production release ``` -------------------------------- ### Install Apollo Client Dependencies Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/FORMBRICKS_IMPLEMENTATION_SUMMARY.md Run this command in the frontend-nx directory to install Apollo client dependencies, which may resolve missing GraphQL types. ```bash cd frontend-nx GRAPHQL_URI=http://localhost:8080/v1/graphql yarn apollo ``` -------------------------------- ### Start Hasura Console Source: https://github.com/eduhub-org/eduhub/blob/develop/backend/README.md Command to start the Hasura Console from the project directory. This command opens the console in your browser for local development. ```bash hasura console ``` -------------------------------- ### Start Development Environment with Docker Compose Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/MOOCHUB_FEED_DOCUMENTATION.md Use Docker Compose to bring up the development environment for the EduHub API. ```bash # Start the development environment docker compose up ``` -------------------------------- ### Example API Request using cURL (Bash) Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/apiProxy/README.md Example of how to make a request to the participants endpoint using cURL, including necessary authentication headers. ```bash curl -s \ -H "X-API-Key: edh_live_org353_sk_***" \ -H "User-Agent: PartnerClient/1.0" \ http://localhost:42026/participants/courses/39aa0df1-4936-5686-80a5-35d196a03520 ``` -------------------------------- ### Create .env file for Local Development Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/FORMBRICKS_IMPLEMENTATION_SUMMARY.md Copy the example environment file to create a new .env file in the project root. This file will store local development configurations. ```bash cp .env.example .env ``` -------------------------------- ### Open HTML Preview Source: https://github.com/eduhub-org/eduhub/blob/develop/design/README.md Use this command to open the interactive HTML mockups in your default browser. This requires `xdg-utils` to be installed. ```bash xdg-open design/settings-redesign-preview.html ``` -------------------------------- ### Install API Proxy Dependencies and Run Pytest Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/apiProxy/README.md Install the necessary dependencies for the API Proxy and run the automated tests using pytest. This is typically done from within the apiProxy directory. ```bash cd functions/apiProxy python3 -m pip install -r requirements.txt # or use the same venv as above python3 -m pytest -v ``` -------------------------------- ### Install Stripe CLI Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/STRIPE_INTEGRATION.md Install the Stripe Command Line Interface on macOS using Homebrew. For Linux, download from the official Stripe documentation. ```bash # macOS brew install stripe/stripe-cli/stripe # Linux # Download from https://stripe.com/docs/stripe-cli ``` -------------------------------- ### Start Local Webhook Listener Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/STRIPE_INTEGRATION.md Start the Stripe CLI to listen for webhooks locally and forward them to your development server. This command outputs a webhook signing secret for temporary use. ```bash stripe listen --forward-to localhost:5000/api/webhooks/stripe ``` -------------------------------- ### Start Python Functions Stack with Docker Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/apiProxy/README.md Use this command to start the Python functions, including the API proxy, within a Docker container. Ensure the container is healthy before proceeding. ```bash docker compose up -d python_functions ``` -------------------------------- ### Print Example SQL Statements and Verification Source: https://github.com/eduhub-org/eduhub/blob/develop/backend/seeds/utils/generate_sql_inserts.ipynb Prints the first 5 generated SQL INSERT statements and performs a uniqueness check on organization names. Asserts that all names are unique. ```python # Print a few example statements print("-- Example INSERT statements (showing first 5):") print("\n".join(sql_statements[:5])) print(f"\n-- Total statements generated: {len(sql_statements)}") # Verify uniqueness names = [org['name'] for org in orgs] unique_names = set(names) print(f"\n-- Unique names verification:") print(f"Total names: {len(names)}") print(f"Unique names: {len(unique_names)}") assert len(names) == len(unique_names), "Duplicate names found!" ``` -------------------------------- ### List Funded Courses Response Example (JSON) Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/apiProxy/README.md Example JSON response for listing courses funded by an organization. Each course entry includes a unique hash ID and an endpoint for participant data. ```json { "type": "CourseListReport", "id": "urn:report:org:353:2025-08-08T10:30:00Z", "provider": { "id": "did:web:edu.opencampus.sh", "name": "opencampus.sh", "type": "Nonprofit", "legalName": "Campus Business Box e.V.", "websiteUrl": "https://edu.opencampus.sh", "contactEmail": "edu@opencampus.sh", "address": { "streetAddress": "Wissenschaftszentrum Kiel, Fraunhoferstr. 13", "postalCode": "24118", "locality": "Kiel", "country": "DE" } }, "fundingOrganization": { "id": 353, "name": "…" }, "courses": [ { "id": "39aa0df1-4936-5686-80a5-35d196a03520", "title": "…", "participantDataEndpoint": "/participants/courses/39aa0df1-4936-5686-80a5-35d196a03520" } ], "generatedAt": "2025-08-08T10:30:00Z" } ``` -------------------------------- ### Email Template Body Example Source: https://github.com/eduhub-org/eduhub/blob/develop/design/settings-redesign-preview.html Example of the body content for an application invitation email, demonstrating rich text formatting and dynamic variables. ```html Hi [User:FirstName], You've been invited to apply for **[Enrollment:CourseId--Course:Name]**. Click the link below to complete your application. [Enrollment:CourseLink] ### Trigger This email is sent automatically when an admin invites a user to apply for a course. ``` -------------------------------- ### Conventional Commits Examples (Good) Source: https://github.com/eduhub-org/eduhub/blob/develop/CONTRIBUTING.md Examples of well-formed commit messages following the Conventional Commits specification, demonstrating various types and scopes. ```bash feat(auth): add OAuth2 integration with Keycloak ``` ```bash fix(frontend): resolve table pagination issue ``` ```bash docs: update API documentation for user endpoints ``` ```bash refactor(backend): optimize database queries ``` ```bash perf(frontend): implement virtual scrolling for large lists ``` ```bash test(api): add integration tests for user registration ``` -------------------------------- ### MOOCHub Schema with Custom Extensions Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/MOOCHUB_FEED_DOCUMENTATION.md Example JSON structure of the MOOCHub schema, demonstrating integrated custom extensions for providers like opencampus.sh. ```json { "provider": "opencampus.sh", "version": "1.0", "description": "Complete MOOCHub schema with opencampus.sh custom extensions integrated", "base_schema_url": "https://github.com/moochub/schema/releases/tag/v3.0.1", "custom_extensions": { "learning_region": { "type": "string", "description": "Physical location region where the course takes place (only for onsite courses)", "example": "KIEL" }, "learning_location": { "type": "string", "description": "Specific learning location within the region (only for onsite courses)", "example": "Starterkitchen" }, "learning_zone": { "type": "string", "description": "Specific zone within the learning location (only for onsite courses)", "example": "Eventraum" }, "funding": { "type": "array", "description": "Array of funding organizations supporting the course", "structure": { "name": "string - Name of the funding organization", "type": "string - One of: UNIVERSITY, RESEARCH_INSTITUTE, PUBLIC_SECTOR, NON_PROFIT_ORGANIZATION, CORPORATION, SCHOOL, FREELANCER, OTHER", "description": "string - Detailed description of the organization" } } }, "full_schema": { // Complete MOOCHub schema v3.0.1 with custom attributes integrated // Custom fields are added directly to the course attributes properties } } ``` -------------------------------- ### Participant Data for a Funded Course Response Example (JSON) Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/apiProxy/README.md Example JSON response for participant data associated with a specific funded course. It includes participant enrollment status, occupation status, and completion status, but no PII. ```json { "type": "ParticipantDataReport", "id": "urn:report:course:39aa0df1-4936-5686-80a5-35d196a03520:2025-08-08T10:30:00Z", "provider": { "id": "did:web:edu.opencampus.sh", "name": "opencampus.sh", "type": "Nonprofit", "legalName": "Campus Business Box e.V.", "websiteUrl": "https://edu.opencampus.sh", "contactEmail": "edu@opencampus.sh", "address": { "streetAddress": "Wissenschaftszentrum Kiel, Fraunhoferstr. 13", "postalCode": "24118", "locality": "Kiel", "country": "DE" } }, "learningOpportunity": { "id": "urn:course:39aa0df1-4936-5686-80a5-35d196a03520", "title": "…", "summary": "…", "language": ["de"], "fundingOrganization": { "id": 353, "name": "…" } }, "participants": [ { "id": "urn:hash:…", "enrollmentStatus": "REGISTERED", "enrollmentDate": "2025-05-01T12:34:56Z", "occupationStatus": "STUDENT", "completionStatus": { "hasAchievementCertificate": false, "hasAttendanceCertificate": true } } ], "generatedAt": "2025-08-08T10:30:00Z" } ``` -------------------------------- ### Variant Tab Event Listeners and Initial Setup Source: https://github.com/eduhub-org/eduhub/blob/develop/design/settings-redesign-preview.html Sets up event listeners for variant tabs to apply different UI appearances and initializes the sidebars based on the initially active screen. ```javascript const activeScreen = document.querySelector('.screen.active')?.dataset.screen || 'ia'; document.getElementById('variantTabs').style.display = activeScreen === 'ia' ? 'none' : 'flex'; document.querySelectorAll('.variant-tab').forEach(tab => { tab.addEventListener('click', () => { document.querySelectorAll('.variant-tab').forEach(t => t.classList.remove('active')); tab.classList.add('active'); applyVariant(tab.dataset.variant); }); }); initSidebars('emails'); ``` -------------------------------- ### Example MOOCHub Feed API Request Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/MOOCHUB_FEED_DOCUMENTATION.md This example demonstrates how to request a specific page and number of items per page from the MOOCHub feed API using curl. ```bash curl "https://api.edu.opencampus.sh/moochub?page=1&per_page=10" ``` -------------------------------- ### Email Notification Preview Example Source: https://github.com/eduhub-org/eduhub/blob/develop/design/settings-redesign-preview.html A preview of an email notification, showing how dynamic content and formatting will appear to the recipient. ```html **Subject:** You're invited to apply for Sample Course Title Hi John, You've been invited to apply for **Sample Course Title**. Click the link below to complete your application. [https://edu.opencampus.sh/course/123](#) ``` -------------------------------- ### Example Git Commit Flow for Semantic Releases Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/SEMANTIC_RELEASE_WORKFLOW.md This sequence demonstrates how individual commits in the 'develop' branch influence version bumps, and how merge commits are used for deployment tasks. ```bash # Individual commits in develop (these determine version bump) git commit -m "feat: add user authentication" # Will cause minor bump git commit -m "fix: resolve login validation bug" # Will cause patch bump git commit -m "docs: update API documentation" # No version impact ``` ```bash # Merge commits (deployment/maintenance tasks) git merge develop -m "chore: merge develop into staging for release candidate" git merge staging -m "chore: promote staging to production release" ``` -------------------------------- ### User Creation Email Template Variables Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/callNodeFunction/EMAIL_TEMPLATE_VARIABLES.md Utilize these variables in user creation emails to provide account setup instructions and portal access links. ```html

Hello [User:FirstName] [User:LastName],

Your account has been created for the EduHub platform.

To set your password, please click on the following link:

Set Password

You can log in here: [System:PortalUrl]

``` -------------------------------- ### Formbricks Survey Runtime Data Flow Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/FORMBRICKS_INTEGRATION_PLAN.md Illustrates the sequence of events from user application to survey completion and data retrieval. Includes example API call and response structure. ```text ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ User clicks │ │ EduHub builds │ │ Formbricks │ │ "Apply" │ ──▶ │ iframe URL with │ ──▶ │ renders survey │ │ │ │ hidden fields │ │ in embed mode │ └─────────────────┘ └─────────────────┘ └─────────────────┘ │ URL: https://formbricks.com/s/abc123 │ ?embed=true │ &userId=xxx ▼ &courseId=42 ┌─────────────────┐ &enrollmentId=123 │ User completes │ │ survey, submits │ └─────────────────┘ │ ▼ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ Instructor │ │ EduHub Hasura │ │ Formbricks API │ │ views apps │ ◀── │ action fetches │ ◀── │ returns response│ │ │ │ via API │ │ with hidden │ └─────────────────┘ └─────────────────┘ │ field data │ └─────────────────┘ API Call: GET /api/v1/management/responses?surveyId=abc123 Header: x-api-key: fb_prod_xxx Response includes: { "data": [{ "id": "resp_123", "data": { "hiddenFields": { "eduhubUserId": "xxx", "eduhubCourseId": "42", "eduhubEnrollmentId": "123" }, "question1": "Answer 1", "question2": "Answer 2" } }] } ``` -------------------------------- ### Print Formbricks Environment Variables Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/FORMBRICKS_INTEGRATION.md This command displays all environment variables within the 'node_functions' container that start with 'FORMBRICKS'. It helps verify that necessary configuration variables are set correctly. ```bash docker compose exec node_functions printenv | grep FORMBRICKS ``` -------------------------------- ### Set Formbricks API Key in .env Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/FORMBRICKS_IMPLEMENTATION_SUMMARY.md Configure your Formbricks API key in the .env file. Ensure the key is copied correctly from Formbricks settings and starts with 'fbk_'. ```bash FORMBRICKS_API_KEY=fbk_your_api_key_here ``` -------------------------------- ### Translation Keys Structure Example Source: https://github.com/eduhub-org/eduhub/blob/develop/frontend-nx/apps/edu-hub/components/pages/CourseContent/Registration/README.md Illustrates the hierarchical structure for translation keys within the 'course' namespace. This organization helps manage texts for registration, modals, statuses, errors, and general actions. ```yaml course: registration: apply_now: "Apply now" register_now: "Register Now" application_deadline: "Application deadline: " # ... other registration keys modal: title_approval: "Apply for Course" motivation_letter_label: "Motivation Letter" # ... other modal keys status: applied: "Applied" invited: "Invited" # ... other status keys errors: motivation_letter_required: "Please provide a motivation letter" # ... other error keys success_messages: success_title: "You have successfully applied" # ... other success keys onboarding_modal: important: "Important" congratulation: "Congratulations!" form_intro: "Please complete your profile information" # ... other onboarding keys general: confirm: "Confirm" reject: "Decline" # ... other general keys ``` -------------------------------- ### GraphQL Query Naming Convention Examples Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/DEVELOPMENT_GUIDE.md Examples of GraphQL query names following the convention: PascalCase, starting with the main entity/action, followed by qualifiers, and ending with 'Query'. ```graphql CoursesByInstructorQuery ``` ```graphql UserEnrolledCoursesQuery ``` ```graphql ProgramDetailQuery ``` ```graphql InstructorCoursesQuery ``` -------------------------------- ### Integrate Registration and Onboarding Components Source: https://github.com/eduhub-org/eduhub/blob/develop/frontend-nx/apps/edu-hub/components/pages/CourseContent/Registration/README.md Shows how to conditionally render the Onboarding component for invited users and the Registration component for all other cases within the CourseContent page. ```tsx {(isLoggedIn && resetValues) && ( )} ``` -------------------------------- ### Branch Naming Convention Example Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/DEVELOPMENT_GUIDE.md Example of the recommended branch naming convention: `/`. ```text issue123/fixLoginError ``` -------------------------------- ### Conventional Commits Examples (Bad) Source: https://github.com/eduhub-org/eduhub/blob/develop/CONTRIBUTING.md Examples of commit messages that do not conform to the Conventional Commits specification. ```bash update stuff ``` ```bash fix bug ``` ```bash changes ``` ```bash wip ``` -------------------------------- ### Frontend Host Commands (Node 20 + Yarn 3.4.1) Source: https://github.com/eduhub-org/eduhub/blob/develop/AGENTS.md Run these commands from the `frontend-nx/` directory for frontend development tasks. Ensure Node 20 and Yarn 3.4.1 are used. ```bash nvm use 20 yarn lint # ESLint (matches CI) yarn test # Jest + RTL yarn build GRAPHQL_URI=http://localhost:8080/v1/graphql yarn apollo # regenerate GraphQL types ``` -------------------------------- ### Run Database Migration Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/FORMBRICKS_IMPLEMENTATION_SUMMARY.md Navigate to the backend directory and apply database migrations using the appropriate command for your migration tool. This ensures the database schema is up-to-date. ```bash cd backend # Apply the migration (adjust command based on your migration tool) hasura migrate apply # Or if using Hasura CLI: hasura migrate apply --database-name default ``` -------------------------------- ### Email Template Subject Line Example Source: https://github.com/eduhub-org/eduhub/blob/develop/design/settings-redesign-preview.html An example of an email subject line for an application process notification, including a placeholder for dynamic content. ```html Subject: You're invited to apply for Sample Course Title ``` -------------------------------- ### Hasura Migrations Documentation Source: https://github.com/eduhub-org/eduhub/blob/develop/backend/README.md Link to the Hasura documentation detailing how to set up and manage migrations. ```text https://hasura.io/docs/1.0/graphql/core/migrations/migrations-setup.html ``` -------------------------------- ### SQL Migration - Up Script Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/project-type-default-documentation-instructions.plan.md This SQL script performs the 'up' migration for adding project documentation instructions per type. It inserts new project types, alters the ProjectDocumentationInstruction table, and sets up foreign keys, indexes, and a trigger. ```sql ALTER TABLE "ProjectDocumentationInstruction" ADD COLUMN "projectTypeValue" text, ADD COLUMN "isDefault" boolean NOT NULL DEFAULT false, ALTER COLUMN "url" DROP NOT NULL ``` ```sql ALTER TABLE "ProjectDocumentationInstruction" ALTER COLUMN "projectTypeValue" SET NOT NULL ``` ```sql ALTER TABLE "ProjectDocumentationInstruction" ADD CONSTRAINT "projectTypeValue" FOREIGN KEY ("projectTypeValue") REFERENCES "ProjectType"("value") ON UPDATE RESTRICT ON DELETE RESTRICT ``` ```sql CREATE INDEX "idx_project_documentation_instruction_project_type_value" ON "ProjectDocumentationInstruction" ("projectTypeValue") ``` ```sql CREATE UNIQUE INDEX "idx_project_documentation_instruction_project_type_value_is_default" ON "ProjectDocumentationInstruction" ("projectTypeValue") WHERE isDefault ``` ```sql CREATE TRIGGER "Project_instruction_matches_type_trg" BEFORE INSERT OR UPDATE ON "Project" FOR EACH ROW EXECUTE FUNCTION "Project_instruction_matches_type"() ``` -------------------------------- ### Python Function Docstring Example Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/SERVERLESS_FUNCTIONS.md Example of a Python docstring following a standard format for describing function purpose, arguments, and return values. Ensure all arguments and return fields are documented. ```python """Short description of function purpose. Args: arguments (dict): Contains: - input.param1 (type): Description - input.param2 (type): Description Returns: dict: Response containing: - success (bool): Operation status - messageKey (str): Translation key - error (str, optional): Error message """ ``` -------------------------------- ### Conventional Commit Format Examples Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/SEMANTIC_RELEASE_WORKFLOW.md Examples of conventional commit messages, including feature, fix, breaking change, and maintenance types. Ensure commits follow this format to trigger appropriate semantic-release actions. ```bash feat: add user authentication system fix: resolve navigation menu bug feat!: redesign user dashboard (breaking change) chore: update dependencies to latest versions ``` -------------------------------- ### Apply Database Migrations for Email Templates Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/EMAIL_SYSTEM_SETUP.md Apply the database migrations specifically for email templates and then apply the Hasura metadata. ```bash # Apply the database migrations (only email templates) hasura migrate apply --database-name default hasura metadata apply ``` -------------------------------- ### Get MOOCHub Schema Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/apiProxy/README.md Retrieves the MOOCHub schema, including local extensions. ```APIDOC ## GET /moochub/schema ### Description Retrieves the MOOCHub schema with local extensions. ### Method GET ### Endpoint /moochub/schema ``` -------------------------------- ### Get MOOCHub Course Feed Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/apiProxy/README.md Retrieves the MOOCHub course feed with pagination support. ```APIDOC ## GET /moochub ### Description Retrieves the MOOCHub course feed. ### Method GET ### Endpoint /moochub ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number for pagination (default 1). - **per_page** (integer) - Optional - The number of items per page (default 25, max 100). ### Response #### Success Response (200) [Details of the MOOCHub course feed response structure would be listed here if provided in the source.] ``` -------------------------------- ### Test Frontend Changes Source: https://github.com/eduhub-org/eduhub/blob/develop/CONTRIBUTING.md Navigate to the frontend directory and run tests using yarn. This ensures that all frontend changes meet the project's quality standards before proceeding. ```bash cd frontend-nx yarn test yarn build ``` -------------------------------- ### Get Participants Schema and Diagnostics Source: https://github.com/eduhub-org/eduhub/blob/develop/functions/apiProxy/README.md Provides a brief schema/info and environment diagnostics for the Participants API. ```APIDOC ## GET /participants/schema ### Description Returns a brief schema/info and environment diagnostics for the Participants API. ### Method GET ### Endpoint /participants/schema ``` -------------------------------- ### Set NEXT_PUBLIC_BASE_URL for Staging Source: https://github.com/eduhub-org/eduhub/blob/develop/frontend-nx/apps/edu-hub/pages/widget/README.md Set the NEXT_PUBLIC_BASE_URL environment variable to the staging origin. ```bash NEXT_PUBLIC_BASE_URL=https://edu-staging.opencampus.sh ``` -------------------------------- ### Set Default Project Documentation Instruction (SQL) Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/project-type-default-documentation-instructions.plan.md This SQL statement atomically updates the 'isDefault' flag for project documentation instructions. It ensures that only one instruction is marked as default for a given project type by setting 'isDefault' to true for the specified ID and false for all others within the same project type. This is crucial for maintaining data integrity and fulfilling partial unique index requirements. ```sql UPDATE "ProjectDocumentationInstruction" SET "isDefault" = (id = $1) WHERE "projectTypeValue" = (SELECT "projectTypeValue" FROM "ProjectDocumentationInstruction" WHERE id = $1); ``` -------------------------------- ### Retrieve MOOCHub Schema Documentation Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/MOOCHUB_FEED_DOCUMENTATION.md Fetch the complete MOOCHub schema, including custom extensions, from the schema endpoint. ```bash # Get schema documentation curl "http://localhost:42026/moochub/schema" ``` -------------------------------- ### Get Sample Feed Output for Validation Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/MOOCHUB_FEED_DOCUMENTATION.md Fetch a sample of the feed output using curl to use for schema validation. ```bash # Get sample feed output curl -s "http://localhost:42026/moochub?page=1&per_page=1" > feed_sample.json # Copy the schema content from moochub-schema.json # Paste both into the online validator ``` -------------------------------- ### Development Environment .env Configuration Source: https://github.com/eduhub-org/eduhub/blob/develop/docs/STRIPE_INTEGRATION.md Configure your local development environment by setting Stripe API keys and webhook secrets in the .env file. Leave STRIPE_WEBHOOK_SECRET empty to use the Stripe CLI. ```bash STRIPE_SECRET_KEY=sk_test_your_test_secret_key STRIPE_WEBHOOK_SECRET= # Leave empty, use Stripe CLI instead STRIPE_PUBLISHABLE_KEY=pk_test_your_test_publishable_key ```