@@ -22,6 +22,8 @@ Documentation about the exposed API and how to interact with the Homebrew Hub in
22
22
23
23
## Local Development
24
24
25
+ ### 1. Prerequisites
26
+
25
27
To run a complete local instance of Homebrew Hub, let's start with:
26
28
27
29
``` sh
@@ -32,9 +34,7 @@ git clone https://github.com/gbdev/homebrewhub
32
34
cd homebrewhub
33
35
```
34
36
35
- ### 1. Prerequisites
36
-
37
- No matter if you choose the local setup or the docker one, you will need a couple of pre-requirements on the system:
37
+ Now, no matter if you choose the local setup or the docker one, you will need a couple of pre-requirements on the system:
38
38
39
39
- ` pre-commit ` <br >
40
40
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
51
51
To populate the database, we'll need some sources. Here's how to pull all the 'official' databases (you need at least one):
52
52
53
53
``` bash
54
+ # Let's move to a subdirectory
55
+ cd db-sources
56
+
54
57
# GB/GBC
55
58
git clone https://github.com/gbdev/database/ db-sources/database-gb
56
59
# GBA
@@ -64,16 +67,16 @@ make init-db
64
67
65
68
### 3A. Docker based requirements
66
69
67
- First, install Docker ([ download link] ( https://docs.docker.com/get-docker/ ) ).
70
+ First, install Docker ([ download link] ( https://docs.docker.com/get-docker/ ) ), and compose .
68
71
69
72
After that, follow the steps below to get started running the project using containers:
70
73
71
74
``` bash
72
75
# Start up backing services (web server, database and database admin)
73
76
# NOTE: This command will also take care of synchronising the database (including migrations)
74
- docker- compose up --build
77
+ docker compose up --build
75
78
76
- # Once that's finished, in another terminal , query the /api/all route to see if everything's there
79
+ # Once that's finished, from another shell , query the /api/all route to see if everything's there
77
80
curl https://localhost:8000/api/all
78
81
```
79
82
@@ -92,10 +95,7 @@ Next, install Postgres 12 ([download link](https://www.postgresql.org/download/)
92
95
After that, follow the steps below to get started running the project manually:
93
96
94
97
``` bash
95
- # Clone the repo locally
96
- git clone https://github.com/gbdev/homebrewhub
97
-
98
- # Change into the cloned repo
98
+ # Make sure you are in the cloned repository
99
99
cd homebrewhub
100
100
101
101
# Set up a virtual env
@@ -116,12 +116,6 @@ python3 manage.py makemigrations hhub
116
116
# Sync the database for the first time
117
117
python3 manage.py migrate
118
118
119
- # Clone the database repositories
120
- # GB/GBC
121
- git clone https://github.com/gbdev/database/
122
- # GBA
123
- git clone https://github.com/gbadev-org/games database-gba
124
-
125
119
# Populate with the entries from the database repository
126
120
DATABASE_URL=postgres://yourpostgresuserhere:yourpostgrespasswordhere@localhost:5432/hh python3 manage.py runscript sync_db
127
121
@@ -147,7 +141,7 @@ The "real" database needs to be built (and updated when a commit gets pushed) fr
147
141
148
142
> Keep in mind that the two are not equivalent, as the Django database will keep additional values about each entry (e.g. simple analytics).
149
143
150
- Every time you want to trigger a database sync (e.g. you pulled some updates on the games database):
144
+ Every time you want to trigger a database sync (e.g. you pulled some updates on the games database), run :
151
145
152
146
``` bash
153
147
python3 manage.py runscript sync_db
@@ -157,6 +151,4 @@ python3 manage.py runscript sync_db
157
151
158
152
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
159
153
160
- ### Legacy
161
-
162
- If you were looking for old version written in Node/Express, check [ homebrewhub-legacy] ( https://github.com/gb-archive/homebrewhub-legacy ) .
154
+ Remember to set ` BASE_API_URL=http://localhost:8000 ` so the API calls from Virens will point to the backend we just brought up.
0 commit comments