### 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:
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) && (