Giter Site home page Giter Site logo

disa-backend's Introduction

Installation

Prerequisites

  • Python 3.11 or higher
  • poetry

Installing dependencies

You can install the dependencies by running the following command:

  poetry install

Running the server

You can start the server by running the following command:

  poetry run hypercorn start:app --reload

Testing

The postman collection used to test the API is available here

To facilitate testing, there is a toy database included in the test folder. To use it, add the following environment variable:

  export TEST=1

It comes with:

  • A user:
{
  "name": "test",
  "password": "$2b$12$iFMxI.xziyqiG7lS8jBnB.NLhU7aNTwlizXR8KrRil.zVrMncrwpi",
  "cmd_token": null,
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI5MTBkYzBjMC1jMGNhLTQ5NjctODkzMS05MmVkNmM5OGE0OGUiLCJleHAiOjE3MTI3OTQ1Njh9.B1edr-57h9LbID6BZvL5gCpM8GrANQRU1jT6K0CVZ2M",
  "id": "910dc0c0c0ca4967893192ed6c98a48e",
  "email": "[email protected]",
  "nic": "237583734",
  "role": "USER"
}
  • A simple collection:
{
  "name": "README.md",
  "share_state": "private",
  "access_from_date": null,
  "id": "69c7cd429a94437bb222be8df0d1d112",
  "owner_id": "910dc0c0c0ca4967893192ed6c98a48e"
}
  • A complex collection:
{
  "name": "c2023-adv-06.tar.gz",
  "share_state": "private",
  "access_from_date": null,
  "id": "9872c9b88f5f4eb99290613fafc948f9",
  "owner_id": "910dc0c0c0ca4967893192ed6c98a48e"
}

Development

Migrations

To create a migration, run the following command:

  poetry run alembic revision --autogenerate -m "migration message"

To apply the migration, run the following command:

  poetry run alembic upgrade head

To downgrade the migration, run the following command:

  poetry run alembic downgrade -1

Need help?

@mycsina on most platforms online

disa-backend's People

Contributors

mycsina avatar mariiajoao avatar agh4m avatar miguel-silva48 avatar brunopascoa76 avatar

Watchers

 avatar  avatar

disa-backend's Issues

Create collection in Paperless-ngx

Upload documents to paperless-ngx and group them either by tags or correspondents (tags seem preferable, unless we use correspondents as a kind of user profile)

Return manifest

The manifest should be returned on an endpoint to be available in the frontend.

Manifest format

[
   {
       "path": ...,
       "hash": ...
   },
   .....
]

hash: sha256 hash of the file
path: the path of the file relative to what the user entered

Integrate with Archivematica

sam_client.py has already been done, just need to change the logic behind uploads and also the database structure so we can use Archivematica as the storage solution

Create needed issues

As preparation for the next presentation, estimate the work needed to be done until this is able to be included in the MVP and create the necessary issues ๐Ÿซก

Change Collection name

As a User it would be useful to change the submitted collection's names for better organization (the .tar archive name could be viewable still)

Maybe consider making collection name unique to avoid confusion for the end-user.

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.