Skip to content

Commit 7322ca1

Browse files
committed
docs: update configuration steps, update sample config port to match frontend default
1 parent 746164a commit 7322ca1

3 files changed

Lines changed: 33 additions & 16 deletions

File tree

README.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,27 @@ The Satisfactory Mod Repository backend API - a Go-based service providing REST
2626

2727
If you are on Windows, due to a bug in [mise and aqua](https://github.com/aquaproj/aqua-registry/pull/42498/), you will also need to do the following:
2828

29+
<!-- TODO make a mise task that does this for you -->
2930
```ps1
3031
> mise where aqua:minio/mc
3132
<some folder path>
3233
# Go to the folder
3334
# Rename the `mc` file to give it an extension: `mc.exe`
3435
```
3536

36-
2. Start Development Services
37+
2. (First Time Setup Only) Set up the Configuration File
38+
39+
First, start the containers so you can generate some of the required configuration tokens:
40+
41+
```bash
42+
# If this command fails, ensure you have Docker running and configured correctly
43+
mise run setup
44+
```
45+
46+
Next, create a copy of `config.sample.json` as `config.json` and fill in the required fields.
47+
See the [Configuration](#configuration) section for details.
48+
49+
3. Start Development Services
3750

3851
```bash
3952
# If this command fails, ensure you have Docker running and configured correctly
@@ -44,17 +57,14 @@ The Satisfactory Mod Repository backend API - a Go-based service providing REST
4457
mise run api
4558
```
4659

60+
If the first line of the output contains `config initialized using defaults and environment only!` then ensure your config file is formatted correctly and does not include `//` comments.
61+
4762
If running `api` produces errors about the database failing to apply migrations,
4863
you may have switched branches without cleaning up after database changes you were working on.
4964
The easiest way to get back from this state
5065
is to delete the `postgres` Docker container
5166
and delete all not-in-use volumes so it creates a fresh one.
5267

53-
3. Set up the Configuration File
54-
55-
Create a copy of `config.sample.json` as `config.json` and fill in the required fields.
56-
See the [Configuration](#configuration) section for details.
57-
5868
## Development Commands
5969

6070
```bash
@@ -150,22 +160,26 @@ Doing this requires manually creating a `user_groups` entry for you user.
150160
- Generated code in `generated/`
151161
- Database schemas in `db/schema/`
152162

153-
## Configuration
154-
155-
Create `config.json`, or use environment variables with `REPO_` prefix.
156-
A sample is provided: `config.sample.json`.
157-
158163
**Required services:**
159164

160165
1. **PostgreSQL** - Database (dev: port 5432)
161166
2. **Redis** - Cache/sessions (dev: port 6379)
162167
3. **MinIO** - Object storage (dev: ports 9000/9001)
163-
4. **OAuth providers** - GitHub, Google, Facebook. For testing purposes, [setting up just GitHub](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) is the easiest.
164-
5. **PASETO keys** - Generate these with `go run cmd/paseto/main.go`
165-
6. **VirusTotal API key** - For mod scanning. Optional for testing.
168+
4. **VirusTotal** - External API for mod scanning. Optional for testing and local development.
169+
170+
## Configuration
166171

167172
**Development services** are started automatically with `mise run setup`. MinIO configuration is included in the setup task.
168173

174+
Create `config.json`, or use environment variables with `REPO_` prefix.
175+
A sample is provided: `config.sample.json`.
176+
177+
**For local development, you should change:**
178+
179+
1. **OAuth providers** - For testing purposes, [setting up just GitHub](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) is the easiest.
180+
2. **PASETO keys** - Generate these with `mise run make_paseto_keys`
181+
3. **VirusTotal API key** - If you want to test the mod scanning features (optional).
182+
169183
See `config/config.go` for full configuration structure.
170184

171185
## Development Workflow

config.sample.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
},
5353

5454
"frontend": {
55-
"url": "http://localhost:4200"
55+
"url": "http://localhost:3000"
5656
},
5757

5858
"feature_flags": {

mise.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ run = "go run cmd/api/serve.go"
2626
description = "Run all tests (with verbose output, for CI)"
2727
run = "go test -parallel 1 -v -timeout 1h ./..."
2828

29-
# Run the tests without the verbose flag so it is easier to parse the output for local development
3029
[tasks.localtest]
3130
description = "Run all tests (without the verbose flag, so it's easier to parse the output for local development)"
3231
run = "go test -parallel 1 -timeout 1h ./..."
@@ -68,3 +67,7 @@ run_windows = "mise run migrate_diff_windows"
6867
description = "Use Atlas to create a new manual SQL migration file (see https://atlasgo.io/versioned/new)"
6968
run= "mise run migrate_new_linux"
7069
run_windows = "mise run migrate_new_windows"
70+
71+
[tasks.make_paseto_keys]
72+
description = "Generates PASETO keys for initial setup, put them in your config.json"
73+
run = "go run cmd/paseto/main.go"

0 commit comments

Comments
 (0)