Note: the official Midspace instance at midspace.app is no longer available. You can still host your own Midspace instance using the open-source code. Thanks for using Midspace!
This is version 3 of Midspace - more functional, more robust, more scalable, and 100% open source!
If you want to contribute to Midspace, please read our contribution guidelines.
Folder | Contents | ReadMe |
---|---|---|
aws | Infrastructure as code for AWS | AWS Readme |
frontend | The frontend React web app | Frontend Readme |
hasura | The Hasura GraphQL configuration, actions and seed data. | Hasura Readme |
services | Micro-services | |
services/actions | A service that handles most Hasura actions. | Actions service readme |
services/auth | Auth service readme | |
services/caches | Caches service readme | |
services/realtime | A service that handles realtime interactions like chat and presence. | Realtime service readme |
services/playout | A service that controls video broadcast pipelines. | Playout service readme |
For contributors that only want to play with the user interface, the "Quick" version of the following instructions should get you a minimal working setup. Just skip over the steps marked Full Setup or Production and follow the steps marked Quick Setup.
Warning: The Quick Setup instructions are still being debugged and may or may not work yet!!
Caveat: The word "Quick" should be taken with a grain of salt. Even this streamlined path is likely to take you a day or two.
To test changes that affect other parts of the platform, skip the steps marked Quick Setup and follow steps marked Full Setup. To deploy Midspace publicly or run your own conference on Midspace, follow the steps marked Production as well.
.vscode/extensions
folder. VSCode may offer to install them automatically.The Hasura GraphQL engine will be configured with an arbitrary admin secret value, and this value is needed for configuring several other services that make up Midspace, so generate a secure secret value now and make note of it. A suggested method is a hex string representing a 128-bit value, which can be generated using one of the methods below depending on which tools are available on your system.
openssl rand -hex 16
node -e "console.log(require('crypto').randomBytes(16).toString('hex'))"
Several other setup steps require an arbitrarily selected secret value shared between services, and this method may be used for generating those values as well.
Install all node packages (pnpm descends into subdirectories and creates all necessary node_modules
directories):
pnpm i
Midspace relies on various cloud services, which will need to be configured for local development as well.
cd packages/shared/graphql
cp .env.example .env
.env
as per other parts of Midspace,
likely just HASURA_ADMIN_SECRET
.All -- GraphQL Codegen
. If there are errors, check
that .env
files have been populated in all relevant subdirectories as
described in previous steps.frontend/src/generate/graphql.tsx
that need to be undone:
import { useQuery } from "@midspace/urql-hasura-cache-generic-resolver/useQuery";
Urql.useQuery<
back to useQuery<
.Once you have finished setup, it's easy to run the entire environment with a single VSCode task: "Run All -- Local Development". This task starts PacketRiot tunnels as well as all Midspace services.
https://<your-domain>/su
and follow the instructions to
set up a superuser.
description
field of each key (in system.ConfigurationKey
)
for expected values.If you alter environment config, Docker Compose config, etc., then all tasks must be restarted. Tasks can be killed in VSCode using Ctrl+C or by closing the terminal window they are running in. To kill Docker containers, you will need to manually terminate the container (e.g. by pressing the stop button in Docker Desktop)
When you log into Clowdr for the first time, there will be no conferences listed. You will need a demo code to create a conference, and this cannot yet be done through the Clowdr UI. To create a demo code:
id
is set to Default and click Save. There is no need to enter any values manually.id
column of the new row. This is your demo code - you can use it to create a conference in the Midspace UI.By default, only the creator of a conference has permission to view its elements. You can give permissions to other groups of users by opening the Content admin panel in Midspace. Click the yellow button with a lock icon to open the (conference-)global element security settings.
You probably want to at least add an entry for 'Organiser' permissions with the 'Organisers' group.
This repository uses Prettier for auto-formatting and checks for both pushes and PRs. You may need to configure your editor to use Prettier (for example, by using the VSCode extension)
Procfile
s are used by Heroku to determine what services to run.public.truncate_hasura_logs
to clear out logs older than a week. You could, for example, deploy a Cron To Go task in Heroku that calls psql $DATABASE_URL -c "CALL public.truncate_hasura_logs()"
.If you want to configure the GitHub actions for CI, you will need to set the following secrets:
Secret | Value |
---|---|
HASURA_ADMIN_SECRET | The value of Hasura Cloud |
HASURA_ENDPOINT | The GraphQL API URL from Hasura Cloud but without the /v1/graphql path. |
ACTION_BASE_URL | As-per the Hasura Cloud environment variable. |
REALTIME_BASE_URL | As-per the Hasura Cloud environment variable. |
HASURA_PERSONAL_ACCESS_TOKEN | The value from Hasura Cloud |
HASURA_PROJECT_ID | The value from Hasura Cloud |
Note:: The HASURA_ENDPOINT
changes when if rename your project inside
Hasura Cloud.