Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

oral-draw-function

Backbone of the Oral Draw system.

What it does

This function is the backbone of the Oral Draw system. It runs on a schedule (every 5 minutes by default) and processes sessions whose deadline has passed:

  • If volunteers signed up → picks one at random, marks the session as picked, and saves the winner's name and user ID
  • If nobody signed up → marks the session as failed
  • Sessions that are already picked, failed, or locked are ignored

Environment variables

Variable Description
APPWRITE_ENDPOINT Appwrite API endpoint (e.g. https://cloud.appwrite.io/v1)
APPWRITE_PROJECT_ID Your Appwrite project ID
DATABASE_ID Your Appwrite database ID
APPWRITE_API_KEY API key with databases.read, databases.write, rows.read, rows.write scopes

Requirements

  • Node.js 21 or higher
  • Appwrite Cloud (free tier is sufficient)
  • A sessions and signups collection — see the main repo README for the full schema

Deployment

See Option A, B, or C in the main README for deployment instructions.

Notes

  • The function is stateless; all state lives in the Appwrite database
  • Safe to run frequently — sessions that have already been processed are skipped

Disclaimer

This project was built with the assistance of Claude by Anthropic. The code, documentation, and design were generated and iterated through a conversational development process. This repo was written by me, with the help of Claude for starting off. (This was my first time building an Appwrite Javascript function)

About

Backbone of the Oral Draw system.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages