Skip to content
Open
Show file tree
Hide file tree
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
27 changes: 27 additions & 0 deletions functions/realtime-chat/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Appwrite Configuration
APPWRITE_API_KEY=your_appwrite_api_key_here
APPWRITE_FUNCTION_PROJECT_ID=your_project_id_here
APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1

# Database Configuration
MASTER_DATABASE_ID=your_master_database_id_here
ROOMS_TABLE_ID=your_rooms_table_id_here
MESSAGES_TABLE_ID=your_messages_table_id_here

# Optional: LiveKit Configuration (if needed for enhanced integration)
LIVEKIT_HOST=your_livekit_host_here
LIVEKIT_API_KEY=your_livekit_api_key_here
LIVEKIT_API_SECRET=your_livekit_api_secret_here

# Optional: Rate Limiting Configuration
RATE_LIMIT_MAX_REQUESTS=10
RATE_LIMIT_WINDOW_MS=60000

# Optional: Message Configuration
MAX_MESSAGE_LENGTH=1000
MESSAGE_HISTORY_LIMIT=50

# Optional: Security Configuration
ENABLE_PROFANITY_FILTER=true
ENABLE_XSS_PROTECTION=true
ENABLE_RATE_LIMITING=true
85 changes: 85 additions & 0 deletions functions/realtime-chat/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Dependencies
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage/

# nyc test coverage
.nyc_output

# Dependency directories
node_modules/
jspm_packages/

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
10 changes: 10 additions & 0 deletions functions/realtime-chat/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"arrowParens": "avoid"
}
Loading