Giter Site home page Giter Site logo

trajkovvlatko / storage-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 110 KB

JSON API in Haskell - Organize storage units at home

License: BSD 3-Clause "New" or "Revised" License

Haskell 99.51% Shell 0.49%
functional-programming haskell rest-api

storage-api's Introduction

Storage API in Haskell

Setup locally

Edit .env file

cp sample.env .env

Edit the contents of .env with proper db credentials. The file is in .gitignore.

Generate JSON web key

Authentication generates tokens and requires a .jwk.sig file to be present in the project root.

(Tip: Use https://mkjwk.org or similar, to easily generate a JSON web key online)

Setup development database

./bin/setup-dev.sh

Run development server

./bin/dev.sh

Setup test database

./bin/setup-test.sh

Run tests

./bin/test.sh

Endpoints

Auth

  • login: POST /login
  • register: POST /register

Rooms

  • list all rooms: GET /rooms
  • preview a room: GET /rooms/:id
  • create a room: POST /rooms"
  • update a room: PATCH /rooms/:id
  • delete a room: DELETE /rooms/:id

Storage units

  • list all storage units per room: GET /storage_units
  • preview a storage unit: GET /storage_units/:id
  • create a storage unit in a room: POST /storage_units
  • update a storage unit: PATCH /storage_units/:id
  • delete a storage unit: DELETE /storage_units/:id

Drawers

  • list all drawers per storage unit: GET /drawers
  • preview a drawer: GET /drawers/:id
  • create a drawer in a storage unit: POST /drawers
  • update a drawer: PATCH /drawers/:id
  • delete a drawer: DELETE /drawers/:id

Colors

  • list all colors: GET /colors
  • preview a color: GET /colors/:id
  • create a color: POST /colors
  • update a color: PATCH /colors/:id
  • delete a color: DELETE /colors/:id

Item types

  • list all item types: GET /item_types
  • preview a item types: GET /item_types/:id
  • create a item types: POST /item_types
  • update a item types: PATCH /item_types/:id
  • delete a item types: DELETE /item_types/:id

Search

  • find an item: GET /search/basic/:term

storage-api's People

Contributors

trajkovvlatko avatar

Stargazers

 avatar

Watchers

 avatar  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.