From 0d9034e4bb27ad7ac5e3cd09dd0c2a4fbd7a2cb4 Mon Sep 17 00:00:00 2001 From: Yannic Kilcher Date: Sat, 17 Dec 2022 22:31:21 +0100 Subject: [PATCH] changed scripts location --- README.md | 4 ++-- backend/README.md | 6 +----- {backend/scripts => scripts}/backend-development/README.md | 1 + .../backend-development/docker-compose.yaml | 0 .../scripts => scripts}/backend-development/run-local.sh | 2 +- {backend/scripts => scripts}/frontend-development/README.md | 0 .../frontend-development/docker-compose.yaml | 2 +- 7 files changed, 6 insertions(+), 9 deletions(-) rename {backend/scripts => scripts}/backend-development/README.md (67%) rename {backend/scripts => scripts}/backend-development/docker-compose.yaml (100%) rename {backend/scripts => scripts}/backend-development/run-local.sh (83%) rename {backend/scripts => scripts}/frontend-development/README.md (100%) rename {backend/scripts => scripts}/frontend-development/docker-compose.yaml (95%) diff --git a/README.md b/README.md index fb542892..25104969 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ All open source projects begins with people like you. Open source is the belief Work is organized in the [project board](https://github.com/orgs/LAION-AI/projects/3). -- To get started with development, if you want to work on the backend, have a look at `backend/scripts/backend-development/README.md`. -- If you want to work on the frontend, have a look at `backend/scripts/frontend-development/README.md`. +- To get started with development, if you want to work on the backend, have a look at `scripts/backend-development/README.md`. +- If you want to work on the frontend, have a look at `scripts/frontend-development/README.md`. There is also a minimal implementation of a frontend in the `text-frontend` folder. diff --git a/backend/README.md b/backend/README.md index 25bd6d46..a559b15b 100644 --- a/backend/README.md +++ b/backend/README.md @@ -14,8 +14,4 @@ BACKEND_CORS_ORIGINS=["http://localhost", "http://localhost:4200", "http://local ## Running the REST Server locally for development -First, install the requirements in `requirements.txt`. -Then, run two terminals (note the working directory for each): - -- Terminal 1, to go `backend/scripts` and run `docker-compose up`. This will start postgres. -- Terminal 2, to go `backend` and run `scripts/run-local.sh`. This will start the REST server. +Have a look into the main `README.md` file for more information on how to set up the backend for development. diff --git a/backend/scripts/backend-development/README.md b/scripts/backend-development/README.md similarity index 67% rename from backend/scripts/backend-development/README.md rename to scripts/backend-development/README.md index 36a1b964..80706c79 100644 --- a/backend/scripts/backend-development/README.md +++ b/scripts/backend-development/README.md @@ -2,4 +2,5 @@ Run `docker compose up` to start a database. The default settings are already configured to connect to the database at `localhost:5432`. +Make sure you have all requirements installed. You can do this by running `pip install -r requirements.txt` inside the `backend` folder. Then, run the backend using the `run-local.sh` script. This will start the backend server at `http://localhost:8080`. diff --git a/backend/scripts/backend-development/docker-compose.yaml b/scripts/backend-development/docker-compose.yaml similarity index 100% rename from backend/scripts/backend-development/docker-compose.yaml rename to scripts/backend-development/docker-compose.yaml diff --git a/backend/scripts/backend-development/run-local.sh b/scripts/backend-development/run-local.sh similarity index 83% rename from backend/scripts/backend-development/run-local.sh rename to scripts/backend-development/run-local.sh index 187674f3..064612c3 100755 --- a/backend/scripts/backend-development/run-local.sh +++ b/scripts/backend-development/run-local.sh @@ -2,7 +2,7 @@ parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) # switch to backend directory -pushd "$parent_path/../../app" +pushd "$parent_path/../../backend/app" export ALLOW_ANY_API_KEY=True diff --git a/backend/scripts/frontend-development/README.md b/scripts/frontend-development/README.md similarity index 100% rename from backend/scripts/frontend-development/README.md rename to scripts/frontend-development/README.md diff --git a/backend/scripts/frontend-development/docker-compose.yaml b/scripts/frontend-development/docker-compose.yaml similarity index 95% rename from backend/scripts/frontend-development/docker-compose.yaml rename to scripts/frontend-development/docker-compose.yaml index 42f36fb4..bcde8923 100644 --- a/backend/scripts/frontend-development/docker-compose.yaml +++ b/scripts/frontend-development/docker-compose.yaml @@ -15,7 +15,7 @@ services: file: ../backend-development/docker-compose.yaml service: adminer backend: - build: ../../. + build: ../../backend/. environment: - POSTGRES_HOST=db - ALLOW_ANY_API_KEY=True