Fix readme
This commit is contained in:
parent
519fcb4c5a
commit
eb7706974e
16
README.md
16
README.md
@ -3,18 +3,23 @@
|
|||||||
1. Install and run postgres.
|
1. Install and run postgres.
|
||||||
2. Create postgres user and database (and add uuid extension while you're there
|
2. Create postgres user and database (and add uuid extension while you're there
|
||||||
):
|
):
|
||||||
|
```
|
||||||
createuser shopkeeper
|
createuser shopkeeper
|
||||||
createdb shopkeeper
|
createdb shopkeeper
|
||||||
sudo -u postgres -i psql
|
sudo -u postgres -i psql
|
||||||
postgres=# ALTER DATABASE shopkeeper OWNER TO shopkeeper;
|
postgres=# ALTER DATABASE shopkeeper OWNER TO shopkeeper;
|
||||||
\password shopkeeper
|
\password shopkeeper
|
||||||
postgres=# CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
postgres=# CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||||
|
```
|
||||||
3. Save password somewhere safe and then and add a `.env` file to the project
|
3. Save password somewhere safe and then and add a `.env` file to the project
|
||||||
directory with the contents:
|
directory with the contents:
|
||||||
|
```
|
||||||
DATABASE_URL=postgresql://shopkeeper:<password>@localhost/shopkeeper
|
DATABASE_URL=postgresql://shopkeeper:<password>@localhost/shopkeeper
|
||||||
RUST_LOG="shopkeeper=debug"
|
RUST_LOG="shopkeeper=debug"
|
||||||
HOST="http://localhost:3030"
|
HOST="http://localhost:3030"
|
||||||
|
```
|
||||||
4. Create a new file at `src/db/refinery.toml` with the contents:
|
4. Create a new file at `src/db/refinery.toml` with the contents:
|
||||||
|
```
|
||||||
[main]
|
[main]
|
||||||
db_type = "Postgres"
|
db_type = "Postgres"
|
||||||
db_host = "localhost"
|
db_host = "localhost"
|
||||||
@ -22,19 +27,16 @@
|
|||||||
db_user = "shopkeeper"
|
db_user = "shopkeeper"
|
||||||
db_pass = "<database-password-here>"
|
db_pass = "<database-password-here>"
|
||||||
db_name = "shopkeeper"
|
db_name = "shopkeeper"
|
||||||
4. Run `cargo run -- -m` which will compile the app in debug mode and run the
|
```
|
||||||
|
5. Run `cargo run -- -m` which will compile the app in debug mode and run the
|
||||||
database migrations.
|
database migrations.
|
||||||
5. Run `./devserver.sh` to run the dev server (by default it listens at
|
6. Run `./devserver.sh` to run the dev server (by default it listens at
|
||||||
`127.0.0.1:3030`).
|
`127.0.0.1:3030`).
|
||||||
|
|
||||||
# Todo
|
# Todo
|
||||||
|
|
||||||
* Add HTTP header authentication for endpoints that modify an owner's data.
|
* Add update endpoints.
|
||||||
* Add DELETE endpoints for existing resources.
|
|
||||||
* Add endpoints for the other models.
|
* Add endpoints for the other models.
|
||||||
* Add caching. Not sure how to do this exactly. Could use Redis, Varnish, Nginx,
|
|
||||||
or a lib resident in the rust web server process. I'll probably need to do
|
|
||||||
invalidations as transactions are made, or interiors are updated.
|
|
||||||
* Make self-contained docker container that can run the app without any setup.
|
* Make self-contained docker container that can run the app without any setup.
|
||||||
* Add rate-limiting per IP address. The `tower` crate has a service that might
|
* Add rate-limiting per IP address. The `tower` crate has a service that might
|
||||||
be useful for this.
|
be useful for this.
|
||||||
|
Loading…
Reference in New Issue
Block a user