MaastrichtU-BISS / lawnotation

Legal text annotation platform for researchers, legal practioners and more!
https://lawnotation.org
Apache License 2.0
6 stars 1 forks source link

Installation and developer documentation #46

Open AlessioNar opened 1 month ago

AlessioNar commented 1 month ago

Dear colleagues,

Do you know whether there are any plans to release the technical documentation of such project in order to run Lawnotation as in a private instance?

I would be willing to contribute to its production.

Thank you,

Best regards,

Alessio

CvdL-UM commented 1 week ago

Hi Alessio,

Thank you for your interest in our project and willingness to contribute. We apologize for the late response. It is already technically possible to run a local instance. We do have a soft dependency on Supabase (you can also host this yourself) and a hard dependency on Mailtrap. We will be working on reducing the dependencies and improving the README and we will be adding Developer guides to https://docs.lawnotation.org.

Perhaps you can explain what kind of use-case you are considering. This will help us better understand your needs and how to accommodate you. Please let us know if you are able to self-host Lawnotation or if you run into any technical problems.

Friendly greetings,

Chris from the Lawnotation Team

AlessioNar commented 1 week ago

Dear Chris,

Thank you for getting back to me. I’ve managed to run the application, although I still encounter some issues, specifically concerning the database and loading its tables.

After I create a new project, no project appears - and when I reload the page, I receive the following error:

Error loading table: Error: Error in tablequery from projects: relation "public.projects" does not exist.

I believe that in my setup something is wrong with the database initialisation, as I checked in the Supabase instance I am using and I noticed I have no schema attached. I believe that may be part of the issue, but I am not knowledgeable of the Supabase platform. Authentication on the other hand works without issues

While going through the process, I also made some proposed changes in the README, which I’ve submitted via a pull request. I’ve included details on some dependencies, especially those involving third-party services (Mailtrap and Supabase).

For what it concerns the use cases, please find below some examples that came to my mind:

Thank you,

Best regards,

Alessio

eensander commented 6 days ago

Hi Alessio,

It seems that you are on the right track. Supabase may work differently than what you are used to. They provide tools for setting up a local development environment and tools to interact with the remote database. If you are only developing locally, the local development environment that Supabase provides might be sufficient. This environment relies on Docker, and includes a local postgres database, local mailserver and webstudio.

To use the local development environment of supabase:

  1. Run pnpm supabase start from the lawnotation-ui folder (params)
  2. If the services are running, copy the shown values to the .env file. (as shown here)

From your question, and the problem you're describing, it seems that you have already created an account and database on Supabase and are trying to use those in your application. Or, you're trying to deploy the application somewhere else and link to your hosted database. In these cases, you should execute the migrations to your hosted, remote database. You execute these migrations the first time on a fresh database, or when the local schema changes.

You can read more about this in the deployment guide. Essentially:

I hope that this helps. If the problem you're experiencing is not related to syncing with the remote database, or if you have any other questions, please let me know!

Best,

Sander from the Lawnotation Team