-
Notifications
You must be signed in to change notification settings - Fork 51
Getting set up for development with Sema
If you want to contribute and/or run Sema locally you are in the right place. If you have any trouble with these instructions, please follow the contributing guidelines and open an issue.
Sema requires the following dependencies to be installed:
- Chrome browser or any Chromium-based browser (e.g. Brave, Microsoft Edge, Opera)
- Node.js active LTS version (currently v14.4.0). To switch between node versions, you can use nvm.
- NPM cli OR Yarn
In order to run, Sema must connect with an api key to a Supabase backend.
- You can either install supabase locally by following these instructions, or connect to a free hosted project.
Once you have set up a project either locally or online you need to copy your api keys into a .env file in the root directory of your sema folder.
SUPABASE_URL="https://YOUR PROJECT URL.supabase.co"
SUPABASE_ANON_KEY="YOUR SUPABASE ANON KEY"
Your project url can be found via the supabase dashboard by going to
- Settings -> API
- Copy your project anon key from the Project API Keys section.
- Copy your project URL from the Config section.
Next, you want to navigate to
- Authentication -> Settings
- Change the site URL to
localhost:5000
.
- Change the site URL to
The next step is to replicate the database structure that we use for storing playgrounds, profiles etc. We provide an SQL script for this here. Copy, and run this using the supabase dashboard by creating a new sql query.
If you decide to use npm
to build sema, you can follow this list of commands:
$ cd sema
$ npm install
$ npm run build
$ npm run dev
Once you have sema running as a node application, you can load it on your browser on the following ports
- npm run dev, go to http://localhost:5000 on your browser
By default when running npm install, we install the sema-engine package from npm. This is the most recent stable version of the engine. However, if you wish to develop with a local copy of the engine you need to follow the following steps.
-
Clone the sema-engine repo
git clone https://github.com/mimic-sussex/sema-engine
-
If you plan on making your own changes, install the prerequisites.
-
Install and build the engine. Follow the instructions here.
-
Change directory to your sema install.
cd path/to/sema
-
Optional step:
git checkout develop
. This changes to the development branch, if you want to work with the most recent updates this is for you. -
Run
npm link /path/to/sema-engine
This will tell sema to use your local copy of the engine. If you make any changes make sure to rebuild the engine (see sema-engine README.md for details).
Keep in mind, if you run npm install` on sema again, it will remove all locally linked modules. You will have to run
npm link /path/to/sema-engine``` again.
Uncaught Error: supabaseUrl is required.
- This error means that you are missing a correct URL to your back-end in your .env file. Follow the instructions above on how to set up a supabase backend to get this set up.
These won't work by default. You have to set up Oauth apps with each provider if you want this feature to work. Check out these supabase tutorials to do so: