From 1e6387f9951b8e410d5062ef511ba970099c45a1 Mon Sep 17 00:00:00 2001 From: rohsyl Date: Wed, 19 Mar 2025 17:25:52 +0100 Subject: [PATCH 1/4] chore: Improve README.md with a getting started section using docker compose --- README.md | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 69c39fe..b1263a7 100644 --- a/README.md +++ b/README.md @@ -13,17 +13,47 @@ The mascot for the backend API is Kirovy, by [Direct & Dominate](https://www.you ![Kirovy enjoying his job](docs/images/kirovy_direct_and_dominate.png) -# Development +# Getting started -## Frontend devs +## Development -Just set up your environment file and run `docker compose up web -d`. +Follow this guide to set up the api locally for development. -This will launch the database, run the migrations, and start the django web server. +### Prerequisites -[Example env file](example.env) +> By default, we are using Docker for the sake of simplicity. If you want to run the API natively, you can check out the section [Native Guide](#native-guide). -## Backend devs +- Docker with compose +- An IDE (PyCharm strongly recommended) + +### Set up environment variables + +You can copy `example.env` to `.env` and fill in the required values. + +- Set `POSTGRES_PASSWORD` to a secure password. +- Set `SECRET_KEY` to a secure secret key. You can use `from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())` in a python shell to generate it. +- Optionally you can set `DEBUG` to `1` if needed + +### Load env variables + +Use the `load_env.sh` script to load the environment variables into your shell. + +```bash +source load_env.sh +read_env .env +``` + +### Running the API + +Run the following command to start the API: + +```bash +docker compose up -d +``` + +> Now you can access the API at `http://localhost` + +## Native Guide You can use docker compose if you'd like, but here are the native OS instructions. From 030eb5d5ab0d5b3cdacae19d1a31b09f5fb1c590 Mon Sep 17 00:00:00 2001 From: rohsyl Date: Wed, 19 Mar 2025 18:08:48 +0100 Subject: [PATCH 2/4] chore: Improve README.md fixes --- README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index b1263a7..61e3b3e 100644 --- a/README.md +++ b/README.md @@ -34,21 +34,12 @@ You can copy `example.env` to `.env` and fill in the required values. - Set `SECRET_KEY` to a secure secret key. You can use `from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())` in a python shell to generate it. - Optionally you can set `DEBUG` to `1` if needed -### Load env variables - -Use the `load_env.sh` script to load the environment variables into your shell. - -```bash -source load_env.sh -read_env .env -``` - ### Running the API Run the following command to start the API: ```bash -docker compose up -d +docker compose up nginx-server -d ``` > Now you can access the API at `http://localhost` From baec73eaaf0fac3e9c35699520078752499a9ae6 Mon Sep 17 00:00:00 2001 From: rohsyl Date: Wed, 19 Mar 2025 18:23:56 +0100 Subject: [PATCH 3/4] chore: ensure web_entry_point.sh is executable --- web_entry_point.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 web_entry_point.sh diff --git a/web_entry_point.sh b/web_entry_point.sh old mode 100644 new mode 100755 From ec449e74ef759e98be65b0513aafbebb17171ecc Mon Sep 17 00:00:00 2001 From: Alex Lambson Date: Thu, 20 Mar 2025 11:52:25 -0600 Subject: [PATCH 4/4] Update README.md Signed-off-by: Alex Lambson --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 61e3b3e..12e5442 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Follow this guide to set up the api locally for development. ### Prerequisites +> [!note] > By default, we are using Docker for the sake of simplicity. If you want to run the API natively, you can check out the section [Native Guide](#native-guide). - Docker with compose @@ -46,7 +47,10 @@ docker compose up nginx-server -d ## Native Guide -You can use docker compose if you'd like, but here are the native OS instructions. +You should use docker compose, but here are the native OS instructions in case you don't want to. + +> [!warning] +> The native OS instructions will not be maintained going forward. If you notice an issue with them, please PR the fix. ### Linux and Mac