Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ appwrite/
**/.env
**/node_modules/
**/resonate-service-account.json
meili_data/
meili_data/
/.env
/node_modules/
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,45 @@

Go to [this repository](https://github.com/AOSSIE-Org/Resonate) to know more about the project.

## Environment Setup :
## Environment Setup

1. Pre-requisites :
1. Pre-requisites

(a) Fork the Repo

(b) Clone the Repo : `git clone https://github.com/AOSSIE-Org/Resonate-Backend`
(b) Clone the Repo: `git clone https://github.com/AOSSIE-Org/Resonate-Backend`

2. Follow [this guide](https://docs.livekit.io/cloud/project-management/keys-and-tokens/) to obtain your `HOST`, `API-KEY`, `API-SECRET` from [livekit-cloud](https://livekit.io/cloud).
Copy link
Contributor

Choose a reason for hiding this comment

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

This was necessary as part of the README, please revert

2. Set up environment variables

3. Create a new project on [Appwrite Cloud](https://appwrite.io/) or self host it locally by pulling their [docker image](https://appwrite.io/docs/self-hosting). Know more about Appwrite [here](https://appwrite.io/docs).
Copy link
Contributor

Choose a reason for hiding this comment

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

This was necessary as part of the README, please revert

```bash
cp .env.example .env
```
Comment on lines +25 to +27
Copy link
Contributor

Choose a reason for hiding this comment

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

There was no .env.example added with the PR, and bash commands work only on Unix systems, the README should also include instructions for Windows


Then fill in the values in `.env`:
- Leave the database/collection IDs as they are (they match the project structure)
- Add your Livekit credentials (see step 3)
- Add your email credentials (see step 5)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix list indentation for consistency.

The sub-items under step 2 have inconsistent indentation (3 spaces instead of the expected 0 or standard 2/4 spaces), which may affect markdown rendering.

As per static analysis hints.

Apply this diff to fix the indentation:

 Then fill in the values in `.env`:
-   - Leave the database/collection IDs as they are (they match the project structure)
-   - Add your Livekit credentials (see step 3)
-   - Add your email credentials (see step 5)
+- Leave the database/collection IDs as they are (they match the project structure)
+- Add your Livekit credentials (see step 3)
+- Add your email credentials (see step 5)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Leave the database/collection IDs as they are (they match the project structure)
- Add your Livekit credentials (see step 3)
- Add your email credentials (see step 5)
Then fill in the values in `.env`:
- Leave the database/collection IDs as they are (they match the project structure)
- Add your Livekit credentials (see step 3)
- Add your email credentials (see step 5)
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

25-25: Unordered list indentation
Expected: 0; Actual: 3

(MD007, ul-indent)


26-26: Unordered list indentation
Expected: 0; Actual: 3

(MD007, ul-indent)


27-27: Unordered list indentation
Expected: 0; Actual: 3

(MD007, ul-indent)

🤖 Prompt for AI Agents
In README.md around lines 25 to 27, the three sub-items under step 2 use
inconsistent indentation (3 spaces) which can affect Markdown rendering; update
those lines to use consistent indentation (prefer 0 or standard 2/4 spaces) so
they align with the surrounding list format, ensuring each bullet uses the same
leading spaces and dash spacing for consistent rendering across Markdown
parsers.


3. Obtain Livekit credentials

- Follow this guide to get your credentials.
- Add `LIVEKIT_HOST`, `LIVEKIT_API_KEY`, `LIVEKIT_API_SECRET` to your `.env` file.

4. Set up Appwrite

- Create a project on Appwrite Cloud or self-host.
- Create an API key with necessary scopes.
- Import the database structure: `appwrite deploy collection`.
- Copy the generated database and collection IDs into your `.env` file.

5. Email configuration (for OTP functionality)

- Set `SENDER_MAIL` to your email address.
- Set `SENDER_PASSWORD` to your app password (Gmail guide).

6. Security note

- Do not hardcode secrets in `appwrite.json`. Use environment variables. The template `.env.example` lists all variables required across functions.

## Functions :

Expand Down
4 changes: 2 additions & 2 deletions appwrite.json
Copy link
Contributor

Choose a reason for hiding this comment

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

JSONs do not have notions of env vars and setting them like this will cause the email and password to be set as literal placeholder strings

Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@
"vars": [
{
"key": "SENDER_MAIL",
"value": "[email protected]"
"value": "$SENDER_MAIL"
},
{
"key": "VERIFICATION_DATABASE_ID",
"value": "64a7bfd6b09121548bfe"
},
{
"key": "SENDER_PASSWORD",
"value": "xizkyvzhduejxjel"
"value": "$SENDER_PASSWORD"
},
{
"key": "OTP_COLLECTION_ID",
Expand Down
1 change: 1 addition & 0 deletions functions/create-room/src/main.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary and breaking change

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { throwIfMissing } from "./utils.js";
export default async ({ req, res, log, error }) => {
throwIfMissing(process.env, [
"APPWRITE_API_KEY",
"APPWRITE_FUNCTION_PROJECT_ID",
"MASTER_DATABASE_ID",
"ROOMS_COLLECTION_ID",
"LIVEKIT_HOST",
Expand Down
1 change: 1 addition & 0 deletions functions/database-cleaner/src/main.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary and breaking change

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { throwIfMissing } from "./utils.js";
export default async (context) => {
throwIfMissing(process.env, [
"APPWRITE_API_KEY",
"APPWRITE_FUNCTION_PROJECT_ID",
"ROOMS_COLLECTION_ID",
"PARTICIPANTS_COLLECTION_ID",
"ACTIVE_PAIRS_COLLECTION_ID",
Expand Down
1 change: 1 addition & 0 deletions functions/delete-room/src/main.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary and breaking change

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { throwIfMissing } from "./utils.js";
export default async ({ req, res, log, error }) => {
throwIfMissing(process.env, [
"APPWRITE_API_KEY",
"APPWRITE_FUNCTION_PROJECT_ID",
"MASTER_DATABASE_ID",
"ROOMS_COLLECTION_ID",
"PARTICIPANTS_COLLECTION_ID",
Expand Down
1 change: 1 addition & 0 deletions functions/join-room/src/main.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary and breaking change

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { throwIfMissing } from "./utils.js";

export default async ({ req, res, log, error }) => {
throwIfMissing(process.env, [
"APPWRITE_FUNCTION_PROJECT_ID",
"LIVEKIT_API_KEY",
"LIVEKIT_API_SECRET",
"LIVEKIT_SOCKET_URL",
Expand Down
1 change: 1 addition & 0 deletions functions/livekit-webhook/src/main.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary and breaking change

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default async (context) => {

throwIfMissing(process.env, [
'APPWRITE_API_KEY',
'APPWRITE_FUNCTION_PROJECT_ID',
'MASTER_DATABASE_ID',
'ROOMS_COLLECTION_ID',
'PARTICIPANTS_COLLECTION_ID',
Expand Down
1 change: 1 addition & 0 deletions functions/match-maker/src/main.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary and breaking change

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { throwIfMissing } from './utils.js';
export default async ({ req, res, log, error }) => {
throwIfMissing(process.env, [
'APPWRITE_API_KEY',
'APPWRITE_FUNCTION_PROJECT_ID',
'DATABASE_ID',
'REQUESTS_COLLECTION_ID',
'ACTIVE_PAIRS_COLLECTION_ID',
Expand Down
1 change: 1 addition & 0 deletions functions/send-otp/src/main.js
Copy link
Contributor

Choose a reason for hiding this comment

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

These changes are not part of the issue this PR attempts to solve, and they should not be part of this PR

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { randomInt } from "node:crypto"; // for generating cryptographically sec
export default async ({ req, res, log, error }) => {
throwIfMissing(process.env, [
"APPWRITE_API_KEY",
"APPWRITE_FUNCTION_PROJECT_ID",
"VERIFICATION_DATABASE_ID",
"OTP_COLLECTION_ID",
"SENDER_MAIL",
Expand Down
2 changes: 1 addition & 1 deletion functions/verify-email/src/main.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary and breaking change

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Client, Users } from 'node-appwrite';
import { throwIfMissing } from './utils.js';

export default async ({ req, res, log, error }) => {
throwIfMissing(process.env, ['APPWRITE_API_KEY']);
throwIfMissing(process.env, ['APPWRITE_API_KEY', 'APPWRITE_FUNCTION_PROJECT_ID']);

const client = new Client()
.setEndpoint(
Expand Down
1 change: 1 addition & 0 deletions functions/verify-otp/src/main.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary and breaking change

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { throwIfMissing } from './utils.js';
export default async ({ req, res, log, error }) => {
throwIfMissing(process.env, [
'APPWRITE_API_KEY',
'APPWRITE_FUNCTION_PROJECT_ID',
'VERIFICATION_DATABASE_ID',
'OTP_COLLECTION_ID',
'VERIFY_COLLECTION_ID',
Expand Down