Giter VIP home page Giter VIP logo

alexandria-backend's Introduction

Alexandria

Backend manager for augmented books

Project Setup

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.

Docker

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

Unix

Compile the project

cargo build
# or
cargo build --release

Run the project

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

Lint

cargo clippy

REST API

The specification of the REST API can be found in the file docs/api.yml

Currently implemented paths

Author

  • /author GET
  • /author POST
  • /author PUT
  • /author/find GET
  • /author/:id GET
  • /author/:id DELETE

Book

  • /book GET
  • /book POST
  • /book PUT
  • /book/find GET
  • /book/:id GET
  • /book/:id DELETE

Fragments

  • /book/:id/fragments GET
  • /fragment POST
  • /fragment PUT
  • /fragment/:id GET
  • /fragment/:id DELETE
  • /fragment/:id/reorder PUT

alexandria-backend's People

Contributors

phundrak avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.