git clone git@github.com:undrfined/robotchallenge.git --recursive
cd robotchallenge
You'll need:
- NodeJS
- Rust
rustup target add wasm32-wasi
npm run build:vendor
npm run build:core
npm install
Instructions on how to do that are here.
npm run start
Either start a local Postgres & Redis server or use Docker Compose:
docker compose up postgres redis
Don't forget to update /etc/hosts
file:
127.0.0.1 redis
127.0.0.1 postgres
Also if you're running a local (not docker) Postgres server, you'll need to run the postgres/init.sql
script.
cd backend && cargo run
git clone git@github.com:undrfined/robotchallenge.git --recursive
cd robotchallenge
Instructions on how to do that are here.
cp .env.example .env
# edit .env file
docker compose up -d
For local setup, you'll need to set the following fields in the .env
file like so:
APP_API_ENDPOINT="localhost:8080/"
APP_UI_ENDPOINT="http://localhost:3000/"
For the docker setup, you'll need to set the following fields in the .env
file like so:
APP_API_ENDPOINT="example.com/api"
APP_UI_ENDPOINT="https://example.com/"
Firstly, you'll need to create a new OAuth application on GitHub. You can do that here.
The callback URL should be https://YOUR_DOMAIN/api/callback
if you're running in docker compose, and http://localhost:8080/callback
if you're running locally.
Copy client id, client secret and redirect URL to the .env
file (fields are GH_CLIENT_ID
, GH_CLIENT_SECRET
and GH_REDIRECT_URI
respectively).
You'll need to specify the following fields in the .env
file:
POSTGRES_USER
- a username for the userPOSTGRES_PASSWORD
- a password for the user
Optionally, if you're running a docker container, you can specify the following fields:
PGADMIN_DEFAULT_EMAIL
- an email address for the pgadmin userPGADMIN_DEFAULT_PASSWORD
- a password for the pgadmin user
If you're deploying with docker compose, you'll need to set up Let's Encrypt. You can do that by setting the following fields in the .env
file:
DOMAINS
- a domain that you want to use for the app. For example,DOMAINS="example.com"
CERTBOT_EMAILS
- an email address that will be used for Let's Encrypt notifications. For example,CERTBOT_EMAILS="example@example.com"
Create a .env.test
file and populate it with the same values as .env
file.
Then run:
cargo test