DocuInsight uses Postgres and it's main database. This database consists of the user of two schemas and mainly 4 tables:
-
schema: next_auth
- accounts
- verification_tokens
-
schema: public
- jobs
- reports
This database is hosted on Supabase and, in this project, is mainly accessed though Supabase's API. With all that in mind, follow the steps below to easily setup DocuInsight's database on Supabase.
-
Create a Supabase account and/or sign in
-
Create a new project named "DocuInsight"
-
Go to the projects page and click on "DocuInsight"
-
On the left side of the window, click on the "Table Editor" tab were you will be presented with an editor. In that editor, copy the SQL code/commands located in the setup.sql file in the same directory as this README into that editor. Then click the green button with the label "Run" which is located on the right side of the window. These commands were written by us, the developers, and Auth.js as we used Auth.js to handle the user auth logic.
-
After the commands are ran successfully, go to the far left side of the window and click the "Project Settings" tab then go to the "API" tab that is under the "CONFIGURATION" label.
-
Afterwards, scroll to the "Data API Settings" section and look at the "Exposed schemas" line. On that line, along with "public" and "graphql_public", add the following tag as well: "next_auth".
-
Then on the same page, click the "save" button at the bottom of the same page you added "next_auth".
-
Scroll back up on the same page, add grab the API key(s) named URL, anon public, and service_role. You will need these for your environment variables for this project.
-
With all of that set, go to the far left side of the window and click on the "Storage" tab which will take you to the project's buckets page.
-
When you see the buckets page, click the "New bucket" button and create a new bucket named "contracts".
-
With all of these steps done, you can now focus on setting up the frontend and analyzer to run DocuInsight. Thanks for reading!