Backend manager for augmented books
To get started, run the following command in the root of the project:
cp .env.example .env
Edit the new .env
file to match your existing PostgreSQL instance.
Hopefully the whole project will soon be entirely available within a
Docker container.
If you can use Docker, the easiest way to spin up Alexandria is to execute the following command:
docker-compose build # build the Alexandria image
docker-compose up # spin up the project, add -d to detach
If you launched Alexandria as a detached container, you can stop it with:
docker-compose down
cargo build
# or
cargo build --release
You will first need to set up the database. For that, install diesel
:
cargo install diesel_cli
You can now run the migrations in order to prepare PostgreSQL. Note that your PostgreSQL instance must be running.
diesel migration run
In case PostgreSQL isn’t already running, you can run it in Docker
with the provided docker-compose.yml
. Just disable the Alexandria
container first (you can comment it out).
docker-compose up -d
# to turn it off:
docker-compose down
You can now run the server:
cargo run
# or
cargo run --release
cargo clippy
The specification of the REST API can be found in the file
docs/api.yml
-
/author
GET -
/author
POST -
/author
PUT -
/author/find
GET -
/author/:id
GET -
/author/:id
DELETE
-
/book
GET -
/book
POST -
/book
PUT -
/book/find
GET -
/book/:id
GET -
/book/:id
DELETE
-
/book/:id/fragments
GET -
/fragment
POST -
/fragment
PUT -
/fragment/:id
GET -
/fragment/:id
DELETE -
/fragment/:id/reorder
PUT