From 9575c8bc4794946df9f2705a0057a18821876964 Mon Sep 17 00:00:00 2001 From: Mawoka Date: Tue, 14 Jun 2022 16:58:18 +0200 Subject: [PATCH] :technologist: Improved developer-docs --- frontend/src/routes/docs/develop.svelte | 83 +++++++++++++++++++------ 1 file changed, 64 insertions(+), 19 deletions(-) diff --git a/frontend/src/routes/docs/develop.svelte b/frontend/src/routes/docs/develop.svelte index 15e87fd..266424a 100644 --- a/frontend/src/routes/docs/develop.svelte +++ b/frontend/src/routes/docs/develop.svelte @@ -1,3 +1,13 @@ + + ClassQuiz/docs - Development-setup Development-setup

Requirements

-

Backend

- -

Frontend

- @@ -35,14 +38,14 @@
  • Clone the repo: -
    git clone https://github.com/mawoka-myblock/classquiz
    +
    git clone https://github.com/mawoka-myblock/ClassQuiz
  • Install the dependencies
    • Python: -
      pipenv install
      +
      pipenv install -d
    • JS: @@ -52,21 +55,49 @@
    • Start the other services -
        +

        + There's a small helper-script: It's called run_tests.sh and does more than + you think. +

        +

        run_tests.sh - Docs

        +

        + You can run this script with bash. It helps you managing docker-containers you need + to run ClassQuiz. The standard workflow is the following: +

        +
        1. - Caddy: + Prepare all the containers: +
          ./run_tests.sh +
          +
        2. +
        3. + Start the Python-server: +
          pipenv run uvicorn classquiz:app --reload --proxy-headers
          +
        4. +
        5. + Start the frontend-dev-server: +
          cd frontend && API_URL=http://localhost:8080 REDIS_URL=redis://localhost:6379/0?decode_responses=True pnpm dev
          +
        6. +
        7. + Start Caddy:
          caddy run
        8. -
        9. - Redis: -
          redis-server
          -
        10. -
      + +

      If you're done developing: ./run_tests.sh -

      +

      If you want to run all the tests: ./run_tests.sh a

    • Add the following line to your /etc/hosts-file, so you can visit ClassQuiz via test.com (Required for the Captcha and Mapbox)
      127.0.0.1 test.com
      + + Now you can visit ClassQuiz athttp://test.com:8080.
    • Set your config up in your .env-file. What you have to set up can you see in the @@ -79,7 +110,14 @@
    • mail_server
    • mail_port
    • secret_key
    • -
    • meilisearch_url
    • +
    +

    + You'll have to set up the storage. For developing, I'd recommend using the local + file system. to do that, set the following 2 environment-varialbes: +

    +
      +
    • STORAGE_PATH=/tmp/storage
    • +
    • STORAGE_BACKEND=local
  • @@ -97,6 +135,13 @@
+

Pre-Commit

+

+ We're using Pre-Commit for our pre-commit hooks. Install + it by running the following command: +

+
pipenv run pre-commit install
+

BEFORE you submit a Pull-Request

Please use Gitmoji for your commits.

Frontend

@@ -104,5 +149,5 @@
pnpm run format && pnpm run lint

Backend

-

IDK, just check that it works!

+

Run the tests: ./run_tests.sh a