Setup
Prerequisites
-
Install Docker:
Download and install Docker Desktop from Docker's official site.
Follow the installation instructions for your distribution from Docker's official site.
-
Clone the repo:
bash git clone https://github.com/sjb-deck/deck.git -
Move into the directory:
bash cd deck -
Copy the
.envfile into the current directory.
Running the Development Server with Docker
You can run the development server using Docker and the provided run.sh script.
-
Make the
run.shscript executable:bash chmod +x run.sh -
Add the following line to your
/etc/hostsfile:bash 127.0.0.1 deck-dev.nhhs-sjb.org ::1 deck-dev.nhhs-sjb.org -
Run the script in development mode:
bash ./run.sh -
Visit the site at https://deck-dev.nhhs-sjb.org.
This script will build and start the Docker containers for the frontend, backend, and MySQL services.
Additional Notes
- The
run.shscript will create a superuser account with the username and password defined byDEFAULT_ADMIN_USERNAMEandDEFAULT_ADMIN_PASSWORDin.env.
Running tests
Backend
Running tests with test.sh
-
Make the
test.shscript executable:bash chmod +x test.sh -
Run the script:
bash ./test.sh [optional_test_args]Example:
bash ./test.sh accounts.__tests__.triggers.test_trigger_user_extras.TestTriggerUserExtras -
The script will run the backend tests and output the results.
Running tests with Docker
-
Start a shell in the backend container:
bash docker exec -it [backend_container_id] sh -
Run the following command to run the tests:
bash python manage.py test [optional_test_args] -
The tests will run and output the results.
Frontend
-
Go to the frontend directory:
bash cd frontend -
Run the following command to run the tests:
bash npm run test -
The tests will run and output the results.