Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ You can use these accounts to explore the platform:

### Prerequisites
- Node.js (v16 or higher)
- MongoDB (local or remote)
- Supabase project with PostgreSQL database

### Installation

Expand All @@ -77,7 +77,10 @@ You can use these accounts to explore the platform:
3. Create a `.env` file in the root directory with the following variables:
```
PORT=3000
MONGODB_URI=mongodb://localhost:27017/wirebase
SUPABASE_URL=your-supabase-url
SUPABASE_KEY=your-anon-key
SUPABASE_SERVICE_KEY=your-service-role-key
SUPABASE_DB_PASSWORD=your-database-password
Comment on lines +80 to +83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Thank you for adding SUPABASE_DB_PASSWORD to the example environment variables. This aligns with the standard practice for providing the Supabase project's database password.

However, this raises an important question regarding the application's current database configuration:

Could you clarify if the Knex configuration in server.js (specifically around line 43, password: process.env.SUPABASE_SERVICE_KEY.split('.')[0]) has been or will be updated to use process.env.SUPABASE_DB_PASSWORD?

The current method of deriving the password from SUPABASE_SERVICE_KEY is non-standard and unlikely to yield the correct database password, which is a separate credential obtained from your Supabase project settings (typically under Database > Connection Info).

Ensuring server.js uses the actual SUPABASE_DB_PASSWORD is critical for successful database connections. The test failures mentioned in the PR description (npm test (fails: Missing required Supabase environment variables)) might be related if the application or tests now expect SUPABASE_DB_PASSWORD to be correctly set and utilized.

SESSION_SECRET=your-session-secret
NODE_ENV=development
```
Expand Down Expand Up @@ -118,9 +121,12 @@ You can use these accounts to explore the platform:
- `NODE_ENV`: `production`
- `SESSION_SECRET`: (generate a random string)
- `PORT`: `10000` (or use Render assigned port)
- `MONGODB_URI`: (your MongoDB connection string)
- `SUPABASE_URL`: your Supabase project URL
- `SUPABASE_KEY`: your anon key
- `SUPABASE_SERVICE_KEY`: your service role key
- `SUPABASE_DB_PASSWORD`: your database password
Comment on lines +124 to +127
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

It's good to see SUPABASE_DB_PASSWORD included in the list of environment variables for deployment. This consistency is important.

As with the local setup, it's crucial that the deployed application's Knex configuration in server.js correctly uses this SUPABASE_DB_PASSWORD to connect to the Supabase PostgreSQL database. If the application continues to rely on the current password derivation logic from SUPABASE_SERVICE_KEY (as seen in server.js:43), it will likely face database connection issues in the deployment environment.

A quick observation regarding render.yaml: it defines a DATABASE_URL sourced from a Render-managed PostgreSQL instance. However, the application's primary database connection via Knex in server.js appears to be configured to connect directly to Supabase (using SUPABASE_URL, etc.). If Supabase is indeed the sole primary database, ensuring the deployment instructions and render.yaml clearly reflect this (and that server.js uses the correct Supabase credentials including SUPABASE_DB_PASSWORD) will prevent potential confusion and configuration errors during deployment.


3. Create a MongoDB database and connect it to your service
3. Create a Supabase project and connect it to your service using the variables above

## Customization

Expand Down Expand Up @@ -151,6 +157,7 @@ Users can create their profiles with raw HTML/CSS, either through:
SUPABASE_URL=your-supabase-url
SUPABASE_KEY=your-anon-key
SUPABASE_SERVICE_KEY=your-service-role-key
SUPABASE_DB_PASSWORD=your-database-password
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Adding SUPABASE_DB_PASSWORD to this example .env content is a good step for consistency with the other sections.

This reinforces the need to ensure that the application's database connection logic (in server.js) is correctly using process.env.SUPABASE_DB_PASSWORD rather than attempting to derive it from other Supabase keys. Clear and accurate documentation here is helpful, but it must align with the application's actual requirements for a smooth setup.

SESSION_SECRET=your-secret
PORT=3000
NODE_ENV=development
Expand Down