Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Feat(doc): Add linked supabase configuration guide

Jonathan ARNAULTcf00a2545fbe
diff --git a/README.md b/README.md
index f979f635..a5241d02 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ https://user-images.githubusercontent.com/99944/116970434-4a926480-acb8-11eb-8ce
You can test it online at https://marmelab.com/react-admin-crm.
-## Setup
+## Local Supabase Setup
To run this project locally, you will need the following tools installed on your computer:
@@ -49,49 +49,9 @@ This project contains unit tests. Run them with the following command:
make test
```
-## Deploying To Production
+## Supabase Configuration
-In production, Atomic CRM is designed to be a Single-Page Application using Supabase for its API.
-
-### Supabase Setup
-
-Create a project on Supabase using the following script:
-
-```sh
-make supabase-remote-init
-```
-
-The script will open a web browser to let you log in to your Supabase account. Then it will prompt you for the project configuration, create a database, apply migrations, and deploy edge functions.
-
-### Using An Existing Supabase Instance
-
-If you already created the Supabase instance, you can link the instance manually using the following instructions.
-
-First, log into your Supabase account:
-
-```sh
-npx supabase login
-```
-
-Now, link the project to the Supabase instance. You'll be asked to enter the database password.
-
-```sh
-npx supabase link --project-ref ********************
-```
-
-Then, apply the migrations:
-
-```sh
-npx supabase db push
-npx supabase functions deploy
-```
-
-Finally, create the `.env.production.local` file with your supabase configuration:
-
-```sh
-VITE_SUPABASE_URL=<instance_url>
-VITE_SUPABASE_ANON_KEY=<instance_anon_token>
-```
+To configure supabase, please have a look at [dedicated configuration guide](./doc/supabase-configuration.md).
### Testing Production Mode
diff --git a/doc/supabase-configuration.md b/doc/supabase-configuration.md
new file mode 100644
index 00000000..f6cde613
--- /dev/null
+++ b/doc/supabase-configuration.md
@@ -0,0 +1,49 @@
+# Supabase Configuration
+
+## Remote Instance Setup
+
+You can create a remote supabase using the following script:
+```sh
+make supabase-remote-init
+```
+
+The script will prompt you for the project configuration and will apply migrations and deploy edge functions.
+
+
+## Manual Remove Instance Link
+
+If you already created the supabase instance, you can link the instance manually using the following commands:
+First, log into your supabase account:
+
+```sh
+npx supabase login
+```
+
+Now, link this project to the local supabase instance. You'll be asked to enter the database password.
+```sh
+npx supabase link --project-ref ********************
+```
+
+Then, apply the migrations on it:
+```sh
+npx supabase db push
+npx supabase functions deploy
+```
+
+Finally, create the `.env.production.local` file with your supabase configuration:
+
+```sh
+VITE_SUPABASE_URL=<instance_url>
+VITE_SUPABASE_ANON_KEY=<instance_anon_token>
+```
+
+## Login Callback
+
+To configure the authentication URL, you can go to your project dashboard at [supabase.com](https://supabase.com/). Then go to **Authentication** > **URL Configuration**. You can set up you callbacl URL in the **Site URL** field.
+
+## Fequently Asked Questions
+
+- I have a **Security Definer View** error in **Security Advisor**
+
+You can ignore this error. This warning informs you that the `init_state` state view is public and can be called by everybody.
+This view is required to test if your CRM has been setup correctly. This view has been configured to avoid data leak.