A chat app with real-time capabilities that utilizes Appwrite on the backend.
After cloning the repo ensure you complete the necessary installations
$ npm install
$ npm run dev
Create a new .env
folder and create the necessary variables based on the src/appwriteConfig.js
file. Appwrite setup will be covered in the next step.
//appwrite.Config.js
...
export const API_ENDPOINT = import.meta.env.VITE_API_ENDPOINT
export const PROJECT_ID = import.meta.env.VITE_PROJECT_ID
export const DATABASE_ID = import.meta.env.VITE_DATABASE_ID
export const COLLECTION_ID_MESSAGES = import.meta.env.VITE_COLLECTION_ID_MESSAGES
const client = new Client()
.setEndpoint(API_ENDPOINT)
.setProject(PROJECT_ID);
...
Setting Up Appwrite Account
Set up a local instance of Appwrite or create an account with Appwrite Cloud.
In your appwrite console create a project and database.
- Create a collection called "messages" and add the following attributes:
Atrtibute Name | Type | Size |
---|---|---|
user_id | string | 50 |
username | string | 50 |
body | string | 250 |
Once you've set up your project you should be able to update all necessary env variables. Run your development server to view the output.