[Your existing project structure content]
For developing serverless functions, please refer to:
- Serverless Functions Guide - Complete guide for creating and maintaining serverless functions
- Function Templates - Ready-to-use templates for new functions
4001
- File uploads8080
- Hasura API5000
- Edu frontend5001
- Rent-a-scientist frontend28080
- Keycloak admin interface, login as admin with password admin42000
to420025
- serverless functions (currently most functions have their own port)
Seed data is a set of data used to initialize the database with an initial set of values. It is especially useful during development and testing.
The seed data includes the following users:
admin@example.com
student1@example.com
throughstudent5@example.com
expert1@example.com
throughexpert5@example.com
The password for all users is dev
.
There are two ways to manage seed data:
-
Temporary Changes: Use the Hasura console to make temporary changes during development.
-
Permanent Changes:
- The initial database state is defined in
backend/seeds/default/initial_seeds.sql
- This file is automatically applied when starting a fresh database
- The initial database state is defined in
You can export the current database state as a seed file using the provided script:
# Navigate to the seeds/utils directory
cd backend/seeds/utils
# Make the script executable (first time only)
chmod +x export_seeds.sh
# Run the export script
./export_seeds.sh
This will create a initial_seeds.sql
file in the backend/seeds/default/
directory. This file contains the current state of all tables in the database.
The new initial state will be applied to fresh database installations
-
regenerate-apollo.sh
- This script rebuilds Apollo GraphQL queries. It is useful when you have made changes to your GraphQL schema and you want to generate new types and queries based on the updated schema.- Call it as follows from the folder of the repo (Hasura must be running):
sudo bash regenerate-apollo.sh $USER
. It will handle running theapollo:codegen
target and then fix the problem that generated files are generated as owned by root on your host machine. This way you will be able to push/pull the files using git without access violation errors. The containers need to be up for this. Hotreloading during development should pick up the changes, though I would not be surprised if in some situations a stop/start of the containers will be required to stabilize the setup after all those files are deleted and replaced.
- Call it as follows from the folder of the repo (Hasura must be running):
-
docker_install.sh
- This script installs Docker. It is useful when setting up a new development environment.
-
Branches: <issue_label>/issue<issue_no>/<sanitized_issue_title>
- Example: bug/issue123/fixLoginError
- We recommend using the GitHub extension to create new branches and copying the
post-checkout
script provided in the folder.githooks
in the folder.git/hooks/
. Branch created and checked-out via the issues provides in the GitHub extension will then automatically be named according to the convention.
-
Translations:
- all keys use snake_case (Example:
login_error_message
) - for each page, there is a separate file in the
i18n
folder; the file name is the same as the page name but in hyphen-case (Example:course-page.json
)
- all keys use snake_case (Example:
-
Queries:
- Use PascalCase for the overall query name.
- Start with the main entity or action.
- Follow with qualifiers or specifics.
- End with the word "Query" for clarity.
Following these guidelines, here are some examples:
- CoursesByInstructorQuery
- UserEnrolledCoursesQuery
- ProgramDetailQuery
- InstructorCoursesQuery
See this document for a detailed explanation of the structure of the React app and how to use components.
- To access the Hasura admin frontend, change to the
backend
folder and executehasura console
. Changes in the database schema will be saved as migrations and can be committed correspondingly. - For implementing a new Python serverless function consider the instructions given here.
- The hasura log is spammed by the JWK update, which happens once a second. This is correct hasura behavior for this setup.
- The serverless functions watch their own code, so if it is changed the function is automatically rebuild
- When adding new frontend apps this bug workaround has to be used!
- Recommended: Manage docker as non-root user
To persist changes you made to the keycloak configuration export the edu-hub realm as described in this documentation.
docker exec -ti edu-hub_keycloak_1 /bin/sh
#This command opens a shell in the edu-hub_keycloak_1 containercd bin
#This command changes the current directory to bin./kc.sh export --file /opt/keycloak/data/import/edu-hub.json --users realm_file --realm edu-hub
#This command exports the current configuration of the edu-hub realm to a file- Your local git should highlight changes in the file
./keycloak/imports-dev/edu-hub.json
now #This step checks if there are any changes in the configuration file
- use
yarn upgrade-interactive
script to check for package updates - if package version are explicitly locked in, please check for potential issues or comments while upgrading