Run locally
Backend
If you want to run Spade locally for development or testing purposes, you can do so by following the instructions below.
- Clone the Spade repo (https://github.com/crugroup/spade)
- Install the required dependencies by running
pip install -r requirements/local.txt - Start the required services by running
docker-compose -f local.yml up -d postgres - Set the environment variables required for Django:
export DJANGO_READ_DOT_ENV_FILE=True
export DJANGO_ENV_FILE=.envs/.local/.local
- Run the migration by running
python manage.py migrate - Start the server by running
python manage.py runserver
This will bring up the Spade backend server on your local machine. You can access the server by visiting http://localhost:8000 in your browser.
Frontend
To run the frontend locally:
- Clone the Spade UI repo (https://github.com/crugroup/spadeui)
- This project requires yarn. You can install it globally on your machine.
Here is the recommended method for installing yarn with corepack for MacOS:
macOS (with Homebrew)
brew install node
npm install --global yarn
corepack enable
corepack prepare yarn@4.6.0 --activate
Windows (with Chocolatey)
choco install yarn
Linux (Debian/Ubuntu)
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
⚠️ Installing yarn on Windows and Linux has not been tested; please run those commands with caution.
- Install the required dependencies by running
yarn install - Start the server by running:
yarn dev: for local developmentyarn build && yarn start: for production build + preview
This will bring up the Spade frontend server on your local machine. You can access the server by visiting http://localhost:5173 in your browser for local development or http://localhost:4173 in your browser for production build and preview.