Skip to content

Commit fb80fff

Browse files
committed
Add justfile
1 parent b52d96e commit fb80fff

File tree

2 files changed

+21
-25
lines changed

2 files changed

+21
-25
lines changed

README.md

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,25 @@ docker compose --profile full up -d
2121

2222
### Install tools
2323

24-
#### sqlx
25-
2624
```shell
2725
cargo install sqlx-cli --no-default-features --features rustls,sqlite
26+
cargo install
2827
```
2928

30-
### Run dependencies
31-
32-
```shell
33-
docker compose up -d
34-
```
35-
36-
### Run backend
37-
38-
> See `Config.toml` for build options (these can be overridden with environment variables)
29+
### Run
3930

4031
```shell
41-
cargo run
32+
# Set up environment and generated files
33+
just down up gen
34+
# Run backend
35+
just run
36+
# Run frontend
37+
just dev
4238
```
4339

4440
## Useful commands
4541

46-
#### Prepare compile-time checked queries
47-
48-
Should be run when:
49-
50-
* New compile-time checked queries are created
51-
* New database migrations are created
52-
53-
```shell
54-
export DATABASE_URL=sqlite://../sqlite.db
55-
cargo sqlx prepare
56-
```
57-
58-
#### Create a database dump
42+
### Create a database dump
5943

6044
Useful for creating fixtures. Run in the database container:
6145

justfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
run:
2+
cd backend && cargo run
3+
up:
4+
docker compose up -d
5+
down:
6+
docker compose down -v
7+
gen:
8+
cd backend && DATABASE_URL=sqlite://../sqlite.db cargo sqlx prepare && cd ../frontend && deno i --allow-scripts && deno task gen
9+
dev:
10+
cd frontend && deno task dev
11+
fmt:
12+
cd backend && cargo +nightly fmt && cd ../frontend && deno fmt

0 commit comments

Comments
 (0)