Skip to content

Commit a5f3024

Browse files
committed
Added first-time setup section for backend, disabled mold linking for non-linux
1 parent 37c8313 commit a5f3024

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,35 @@ vim .env
1313

1414
and then set the variables to point at your Solr and [arga-frontend](https://github.com/ARGA-Genomes/arga-frontend) services. The frontend service is only useful for development as it'll add your nodejs server to the CORS list allowing it to make requests. In production this wont be necessary.
1515

16+
### First-time setup
17+
18+
If this is your first time running the backend server, you'll need to setup the Postgres database and [tantivy](https://github.com/quickwit-oss/tantivy) search index first.
19+
20+
Open a new terminal tab, and run `devenv up` to start postgres on your machine.
21+
22+
The ARGA database can then be created by connecting to your postgres instance via `psql -d postgres` and running:
23+
24+
```postgres
25+
CREATE DATABASE arga;
26+
```
27+
28+
Once created, to follow the instructions in `core/README.md` to setup the database schema. In short, make sure you have `DATABASE_URL` set as an environment variable, and then run the following command from the `core` folder:
29+
30+
```bash
31+
atlas migrate apply --env arga
32+
```
33+
34+
You can also restore from a database dump (see [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html) and [pg_restore](https://www.postgresql.org/docs/current/app-pgrestore.html)).
35+
36+
Once complete, create a `.index` folder at the root of the project directory, and run:
37+
38+
```bash
39+
cargo run --bin arga-tasks search create
40+
```
41+
42+
43+
### Running the backend server
44+
1645
To run a development server:
1746

1847
```bash
@@ -26,6 +55,7 @@ cargo build --release
2655
./target/release/arga-backend
2756
```
2857

58+
2959
## Reproducible Builds
3060

3161
Included in the repo is a [devenv](https://devenv.sh) configuration to enable a declarative and reproducible environment. This leverages the nix package manager to provide both needed system dependencies as well as convenient developer tools without having to worry about version compatibility.

devenv.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ in
1111
diesel-cli
1212
cargo-udeps
1313
cargo-expand
14-
mold
1514
postgresql.lib
1615
atlas
17-
1816
wasm-bindgen-cli
1917
tailwindcss_4
2018
# dioxus-alpha.dioxus-cli
2119
]
20+
++ lib.optionals pkgs.stdenv.isLinux [
21+
mold
22+
]
2223
++ lib.optionals pkgs.stdenv.isDarwin [
2324
pkgs.darwin.apple_sdk.frameworks.CoreFoundation
2425
pkgs.darwin.apple_sdk.frameworks.Security

0 commit comments

Comments
 (0)