From 31400014d412c365b57222807a96260ac877a360 Mon Sep 17 00:00:00 2001 From: Antonio Vivace Date: Fri, 18 Oct 2024 22:04:11 +0200 Subject: [PATCH] docs: minor improvements and rewordings in README --- README.md | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 265c70a..052fc1f 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ Documentation about the exposed API and how to interact with the Homebrew Hub in ## Local Development +### 1. Prerequisites + To run a complete local instance of Homebrew Hub, let's start with: ```sh @@ -32,9 +34,7 @@ git clone https://github.com/gbdev/homebrewhub cd homebrewhub ``` -### 1. Prerequisites - -No matter if you choose the local setup or the docker one, you will need a couple of pre-requirements on the system: +Now, no matter if you choose the local setup or the docker one, you will need a couple of pre-requirements on the system: - `pre-commit`
E.g. Install it from pip: @@ -51,6 +51,9 @@ No matter if you choose the local setup or the docker one, you will need a coupl To populate the database, we'll need some sources. Here's how to pull all the 'official' databases (you need at least one): ```bash +# Let's move to a subdirectory +cd db-sources + # GB/GBC git clone https://github.com/gbdev/database/ db-sources/database-gb # GBA @@ -64,16 +67,16 @@ make init-db ### 3A. Docker based requirements -First, install Docker ([download link](https://docs.docker.com/get-docker/)). +First, install Docker ([download link](https://docs.docker.com/get-docker/)), and compose. After that, follow the steps below to get started running the project using containers: ```bash # Start up backing services (web server, database and database admin) # NOTE: This command will also take care of synchronising the database (including migrations) -docker-compose up --build +docker compose up --build -# Once that's finished, in another terminal, query the /api/all route to see if everything's there +# Once that's finished, from another shell, query the /api/all route to see if everything's there curl https://localhost:8000/api/all ``` @@ -92,10 +95,7 @@ Next, install Postgres 12 ([download link](https://www.postgresql.org/download/) After that, follow the steps below to get started running the project manually: ```bash -# Clone the repo locally -git clone https://github.com/gbdev/homebrewhub - -# Change into the cloned repo +# Make sure you are in the cloned repository cd homebrewhub # Set up a virtual env @@ -116,12 +116,6 @@ python3 manage.py makemigrations hhub # Sync the database for the first time python3 manage.py migrate -# Clone the database repositories -# GB/GBC -git clone https://github.com/gbdev/database/ -# GBA -git clone https://github.com/gbadev-org/games database-gba - # Populate with the entries from the database repository DATABASE_URL=postgres://yourpostgresuserhere:yourpostgrespasswordhere@localhost:5432/hh python3 manage.py runscript sync_db @@ -147,7 +141,7 @@ The "real" database needs to be built (and updated when a commit gets pushed) fr > Keep in mind that the two are not equivalent, as the Django database will keep additional values about each entry (e.g. simple analytics). -Every time you want to trigger a database sync (e.g. you pulled some updates on the games database): +Every time you want to trigger a database sync (e.g. you pulled some updates on the games database), run: ```bash python3 manage.py runscript sync_db @@ -157,6 +151,4 @@ python3 manage.py runscript sync_db Now that you have your Homebrew Hub backend up and running, you can check [Virens](https://github.com/gbdev/virens), our VueJS based frontend shipping web assembly builds of mGBA and binjgb to actually play all these entries directly on a browser :D -### Legacy - -If you were looking for old version written in Node/Express, check [homebrewhub-legacy](https://github.com/gb-archive/homebrewhub-legacy). +Remember to set `BASE_API_URL=http://localhost:8000` so the API calls from Virens will point to the backend we just brought up.